Skip to content

Commit

Permalink
Clean up toolchain usage and reduce changes to required minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Apr 20, 2023
1 parent 8e378fb commit d1c7520
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 65 deletions.
29 changes: 11 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ pipeline {

parameters {
choice(name: 'TARGET_PLATFORM', choices: ['r202203', 'r202206', 'r202209', 'r202212', 'r202303', 'latest'], description: 'Which Target Platform should be used?')
choice(name: 'JDK_VERSION', choices: [ '11', '17' ], description: 'Which JDK version should be used?')
// see https://wiki.eclipse.org/Jenkins#JDK
choice(name: 'JDK_VERSION', description: 'Which JDK should be used?', choices: [
'temurin-jdk11-latest', 'temurin-jdk17-latest'
])
}

triggers {
parameterizedCron(env.BRANCH_NAME == 'main' ? '''
H H(0-1) * * * %TARGET_PLATFORM=r202203;JDK_VERSION=17
H H(3-4) * * * %TARGET_PLATFORM=latest;JDK_VERSION=17
H H(0-1) * * * %TARGET_PLATFORM=r202203;JDK_VERSION=temurin-jdk17-latest
H H(3-4) * * * %TARGET_PLATFORM=latest;JDK_VERSION=temurin-jdk17-latest
''' : '')
}

Expand All @@ -25,7 +28,6 @@ pipeline {

tools {
maven "apache-maven-3.8.6"
// see https://wiki.eclipse.org/Jenkins#JDK
jdk "temurin-jdk17-latest"
}

Expand Down Expand Up @@ -62,19 +64,10 @@ pipeline {
}
steps {
xvnc(useXauthority: true) {
//TODO: remove the following test print out
sh '''
echo 'JAVA_HOME_11_X64=${JAVA_HOME_11_X64}'
echo 'JAVA_HOME_17_X64=${JAVA_HOME_17_X64}'
echo 'Predefined Jenkins Toolchain content'
cat ~/.m2/toolchains.xml
'''
script {
def toolChainArgs = params.JDK_VERSION == '17' ? '' : '-Pstrict-jdk --toolchains releng/toolchains.xml'
sh """
./full-build.sh --tp=${selectedTargetPlatform()} ${toolChainArgs}
"""
}
sh """
./full-build.sh --tp=${selectedTargetPlatform()} \
${javaVersion() == 17 ? '' : '--toolchains releng/toolchains.xml -Pstrict-release-jdk'}
"""
}
}// END steps
} // END stage
Expand Down Expand Up @@ -128,7 +121,7 @@ pipeline {

/** return the Java version as Integer (8, 11, ...) */
def javaVersion() {
return Integer.parseInt(params.JDK_VERSION)
return Integer.parseInt(params.JDK_VERSION.replaceAll(".*-jdk(\\d+).*", "\$1"))
}

/** returns true when this build was triggered by an upstream build */
Expand Down
6 changes: 1 addition & 5 deletions jenkins/nightly-deploy/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@ pipeline {
}
}
stage('Maven Tycho Build, Sign, Deploy') {
environment {
JAVA_HOME_11_X64 = tool(type:'jdk', name:'temurin-jdk11-latest')
JAVA_HOME_17_X64 = tool(type:'jdk', name:'temurin-jdk17-latest')
}
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
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'
}
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh ' ./full-deploy.sh -Peclipse-sign,sonatype-oss-release,release-snapshot,strict-jdk --toolchains releng/toolchains.xml'
sh './full-deploy.sh -Peclipse-sign,sonatype-oss-release,release-snapshot'
}
}
}
Expand Down
44 changes: 2 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@
<current-release-zip-directory>${releases-zip-directory}/${current-release-zip-subdirectory}</current-release-zip-directory>

<site.label>TMF Xtext Update Site</site.label>

<!-- By default use running java version in test runtimes-->
<maven.surefire.runtimeJDK>${java.specification.version}</maven.surefire.runtimeJDK>
<tycho.surefire.runtimeJDK>SYSTEM</tycho.surefire.runtimeJDK>

</properties>

<dependencyManagement>
Expand Down Expand Up @@ -406,7 +401,7 @@
</build>
</profile>
<profile>
<id>strict-jdk</id>
<id>strict-release-jdk</id>
<build>
<plugins>
<plugin>
Expand All @@ -423,48 +418,13 @@
<configuration>
<toolchains>
<jdk>
<!-- Toolchain selected by maven/tycho-compiler for compilation and maven/tycho-surefire as JRE of launched test-runtimes-->
<version>${maven.compiler.release}</version>
</jdk>
</toolchains>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<configuration>
<useJDK>SYSTEM</useJDK>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useJDK>SYSTEM</useJDK>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${maven.compiler.release}</version>
</jdkToolchain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${maven.compiler.release}</version>
</jdkToolchain>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
Expand Down

0 comments on commit d1c7520

Please sign in to comment.