Skip to content

Commit 598d1d2

Browse files
committed
Use maven instead of gradle as build technology
Fixes #937 (comment)
1 parent 2ae2f9e commit 598d1d2

File tree

78 files changed

+953
-2051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+953
-2051
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ jobs:
7474
name: Test Results ${{ matrix.os }}
7575
if-no-files-found: warn
7676
path: |
77-
${{ github.workspace }}/**/build/test-results/**/*.xml
78-
${{ github.workspace }}/**/build/reports/
77+
${{ github.workspace }}/**/target/surefire-reports**
7978
8079
8180
- name: Run API Compare

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ bin/
44
target/
55
build/
66
xtend-gen/
7-
.gradle/
87
.idea/
98
*.class
109
*._trace

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Contribution Guide
22

3-
The project is build with Gradle and written in Java 11.
3+
The project is build with Maven and written in Java 11.
44

5-
To start working on it simply clone and run `./gradlew build`. See the section [below](#Eclipse) on building and editing with Eclipse for step-by-step instructions.
5+
To start working on it simply clone and run `mvn verify`. See the section [below](#Eclipse) on building and editing with Eclipse for step-by-step instructions.
66

77
# ECA
88

Jenkinsfile

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
pipeline {
2+
agent {
3+
kubernetes {
4+
// See comment in deplog-build.sh (gpg:sign-and-deploy-file)
5+
inheritFrom 'ubuntu-2404'
6+
}
7+
}
8+
tools {
9+
maven 'apache-maven-latest'
10+
// Default JDK picked up from here, build and test requires
11+
// older JDKs too, which are discovered by gradle from ~/.m2/toolchains.xml
12+
jdk 'temurin-jdk21-latest'
13+
}
14+
options {
15+
timestamps()
16+
disableConcurrentBuilds()
17+
}
18+
stages {
19+
stage('Clean') {
20+
steps {
21+
timeout(activity: true, time: 20) {
22+
sh '''
23+
git status --ignored
24+
git clean -dfx
25+
git reset --hard HEAD
26+
git status --ignored
27+
'''
28+
}
29+
}
30+
}
31+
stage('Gradle') {
32+
steps {
33+
timeout(activity: true, time: 20) {
34+
sh "echo $JAVA_HOME"
35+
sh "java -version"
36+
sh "which java"
37+
sh "cat ~/.m2/toolchains.xml"
38+
sh "./gradlew \
39+
--no-daemon \
40+
-PignoreTestFailures=true \
41+
--refresh-dependencies \
42+
--continue \
43+
clean build jmhCompileGeneratedClasses testOlderJavas signJar publish \
44+
"
45+
}
46+
}
47+
}
48+
stage('Maven') {
49+
steps {
50+
timeout(activity: true, time: 20) {
51+
sh "mvn \
52+
-f releng/pom.xml \
53+
-Dmaven.repo.local=.repository \
54+
--batch-mode --update-snapshots \
55+
clean install -Psign \
56+
"
57+
}
58+
}
59+
}
60+
stage('japicmp') {
61+
steps {
62+
timeout(activity: true, time: 20) {
63+
sh "./releng/runjapicmp.sh"
64+
}
65+
}
66+
}
67+
stage('Deploy Snapshot') {
68+
steps {
69+
timeout(activity: true, time: 20) {
70+
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
71+
sh 'gpg --batch --import "${KEYRING}"'
72+
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
73+
}
74+
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
75+
// Skip Deploy on release builds
76+
// XXX: Can release vs snapshot be detected automatically so that
77+
// the following line does not have to be commented/uncommented
78+
// on each change to/from SNAPSHOT?
79+
sh 'cd releng && ./deploy-build.sh'
80+
}
81+
}
82+
}
83+
}
84+
}
85+
post {
86+
always {
87+
junit '**/target/surefire-reports**/*.xml'
88+
archiveArtifacts '**/target/surefire-reports**'
89+
}
90+
cleanup {
91+
script {
92+
def curResult = currentBuild.currentResult
93+
def lastResult = 'NEW'
94+
if (currentBuild.previousBuild != null) {
95+
lastResult = currentBuild.previousBuild.result
96+
}
97+
98+
if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') {
99+
def color = ''
100+
switch (curResult) {
101+
case 'SUCCESS':
102+
color = '#00FF00'
103+
break
104+
case 'UNSTABLE':
105+
color = '#FFFF00'
106+
break
107+
case 'FAILURE':
108+
color = '#FF0000'
109+
break
110+
default: // e.g. ABORTED
111+
color = '#666666'
112+
}
113+
114+
matrixSendMessage https: true,
115+
hostname: 'matrix.eclipse.org',
116+
accessTokenCredentialsId: "matrix-token",
117+
roomId: '!OVFCkkbjNkALzklVdr:matrix.eclipse.org',
118+
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}",
119+
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>"
120+
}
121+
}
122+
}
123+
}
124+
}

bnd-common.bnd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Eclipse-SourceReferences: \
2+
scm:git:https://github.com/eclipse-lsp4j/lsp4j.git;path="${project.artifactId}"
3+
Bundle-SymbolicName: ${project.artifactId}
4+
Bundle-Name: ${project.name}
5+
Bundle-Version: ${project.version}
6+
Bundle-Vendor: Eclipse LSP4J
7+
Bundle-RequiredExecutionEnvironment: JavaSE-${maven.compiler.release}
8+
Automatic-Module-Name: ${project.artifactId}
9+
10+
pkg.version: ${version;===;${version_cleanup;${project.version}}}
11+
-exportcontents: org.eclipse.lsp4j.*;version="${pkg.version}"
12+
13+
# Use https://github.com/bndtools/bnd/blob/master/maven-plugins/bnd-maven-plugin/README.md#reproducible-builds
14+
# to allow saving the manifest into git too - this makes it easier
15+
# to verify the MANIFEST is changed as expected
16+
-savemanifest: ${project.basedir}/META-INF/MANIFEST.MF
17+
-snapshot: SNAPSHOT
18+
-noextraheaders: true
19+
-removeheaders: Bundle-DocURL
20+
21+
# Place this warning comment in the output MANIFEST
22+
X-Comment-LSP4J: This file is auto-generates, edit the bnd.bnd file, not the MANIFEST.MF file, and regenerate with maven

bnd.bnd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-include: bnd-common.bnd
2+
Import-Package: com.google.gson.*;version="${gson.version.range}",*

build.gradle

Lines changed: 0 additions & 192 deletions
This file was deleted.

gradle.properties

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)