From fdfccb29a6dbafaf4cda35ff7693e05bfd0f4eeb Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Mon, 6 Jan 2025 09:37:51 -0500 Subject: [PATCH] A Java 21 Execution Environment is required at a minimum. - Eclipse Platform 4.35 now requires Java 21 - Remove unnecessary Jenkinsfile (builds occur on Github Actions) Signed-off-by: Roland Grunberg --- .github/workflows/pr-verify.yml | 2 +- .github/workflows/release.yml | 2 +- .sdkmanrc | 2 +- Jenkinsfile | 160 -------------------------------- README.md | 4 +- gulpfile.js | 14 +-- package.json | 4 +- src/requirements.ts | 4 +- 8 files changed, 16 insertions(+), 176 deletions(-) delete mode 100644 Jenkinsfile diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 0e72b06fe..238bfd514 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -18,7 +18,7 @@ jobs: - name: Set Up Java uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'adopt' - run: npm install -g typescript "vsce" - run: wget http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a65a409b0..1bb6816d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,7 +135,7 @@ jobs: run: | platforms=("win32-x64" "linux-x64" "linux-arm64" "darwin-x64" "darwin-arm64") for platform in ${platforms[@]}; do - npx gulp download_jre --target ${platform} --javaVersion 17 + npx gulp download_jre --target ${platform} --javaVersion 21 vsce package ${{ env.publishPreReleaseFlag }} --target ${platform} -o java-${platform}-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix done rm -rf jre/ diff --git a/.sdkmanrc b/.sdkmanrc index 0f7aaf5a5..d2635abfa 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,3 +1,3 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=17.0.3-tem +java=21.0.5-tem diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index da9baff3f..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env groovy - -def installBuildRequirements(){ - def nodeHome = tool 'nodejs-lts' - env.PATH="${env.PATH}:${nodeHome}/bin" - sh "npm install -g typescript" - sh 'npm install -g --force "@vscode/vsce"' - sh 'npm install -g "ovsx"' -} - -def buildVscodeExtension(){ - sh "npm install" - sh "npm run vscode:prepublish" -} - -def downloadLombokJar(){ - stage "Download lombok.jar" - sh "npx gulp download_lombok" -} - -def packageSpecificExtensions() { - stage "Package platform specific vscode-java" - def platforms = ["win32-x64", "linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64"] - def embeddedJRE = 17 - for(platform in platforms){ - sh "npx gulp download_jre --target ${platform} --javaVersion ${embeddedJRE}" - sh "vsce package ${env.publishPreReleaseFlag} --target ${platform} -o java-${platform}-${env.EXTENSION_VERSION}-${env.BUILD_NUMBER}.vsix" - } -} - -def packageExtensions() { - env.publishPreReleaseFlag = "" - if (publishPreRelease.equals('true')) { - stage "replace extension version" - sh "npx gulp prepare_pre_release" - - def packageJson = readJSON file: 'package.json' - env.EXTENSION_VERSION = "${packageJson.version}" - env.publishPreReleaseFlag = "--pre-release" - - packageSpecificExtensions() - } else { - stage "package generic version" - def packageJson = readJSON file: 'package.json' - env.EXTENSION_VERSION = "${packageJson.version}" - - sh "vsce package ${env.publishPreReleaseFlag} -o java-${env.EXTENSION_VERSION}-${env.BUILD_NUMBER}.vsix" - - packageSpecificExtensions() - stash name:'platformVsix', includes:'java-win32-*.vsix,java-linux-*.vsix,java-darwin-*.vsix' - - stage 'Upload vscode-java to staging' - def artifactDir = "java-${env.EXTENSION_VERSION}-${env.BUILD_NUMBER}" - sh "mkdir ${artifactDir}" - sh "mv *.vsix ${artifactDir}" - - sh "sftp ${UPLOAD_LOCATION}/jdt.ls/staging <<< \$'mkdir ${artifactDir}\nput -r ${artifactDir}'" - // Clean up build vsix - sh "rm -rf ${artifactDir}" - unstash 'platformVsix' - } -} - -def publishExtensions() { - // Clean up embedded jre folder from previous build - sh 'npx gulp clean_jre' - - if (publishToMarketPlace.equals('true') || publishToOVSX.equals('true')) { - timeout(time:5, unit:'DAYS') { - input message:'Approve deployment?', submitter: 'fbricon,rgrunber' - } - } - - def platformVsixes = findFiles(glob: '**.vsix') - - stage "publish generic version to VS Code Marketplace" - withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) { - sh 'vsce publish -p ${TOKEN}' + " ${env.publishPreReleaseFlag}" - } - - stage "publish specific version to VS Code Marketplace" - - withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) { - for(platformVsix in platformVsixes){ - sh 'vsce publish -p ${TOKEN}' + " --packagePath ${platformVsix.path}" - } - } - - stage "Publish generic version to Open-VSX Marketplace" - withCredentials([[$class: 'StringBinding', credentialsId: 'open-vsx-access-token', variable: 'OVSX_TOKEN']]) { - sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${env.publishPreReleaseFlag}" - } - - stage "Publish specific version to Open-VSX Marketplace" - withCredentials([[$class: 'StringBinding', credentialsId: 'open-vsx-access-token', variable: 'OVSX_TOKEN']]) { - for(platformVsix in platformVsixes){ - sh 'ovsx publish -p ${OVSX_TOKEN}' + " --packagePath ${platformVsix.path}" - } - } - - if (publishToMarketPlace.equals('true') || publishToOVSX.equals('true')) { - stage "Publish to http://download.jboss.org/jbosstools/static/jdt.ls/stable/" - def artifactDir = "java-${env.EXTENSION_VERSION}" - sh "mkdir ${artifactDir}" - sh "mv *.vsix ${artifactDir}" - - archive includes:"${artifactDir}/**/*.*" - - // copy this stable build to Akamai-mirrored /static/ URL, so staging can be cleaned out more easily - sh "sftp ${UPLOAD_LOCATION}/static/jdt.ls/stable/ <<< \$'mkdir ${artifactDir}\nput -r ${artifactDir}'" - } -} - -node('rhel8'){ - stage 'Build JDT LS' - - env.JAVA_HOME="${tool 'openjdk-17'}" - env.PATH="${env.JAVA_HOME}/bin:${env.PATH}" - sh 'java -version' - - git url: 'https://github.com/eclipse/eclipse.jdt.ls.git' - sh "./mvnw clean verify -B -U -e -Pserver-distro -Dtycho.disableP2Mirrors=true -DskipTests -P!jboss-maven-repos,!redhat-ga-repository,!redhat-ea-repository" - - def files = findFiles(glob: '**/org.eclipse.jdt.ls.product/distro/**.tar.gz') - stash name: 'server_distro', includes :files[0].path -} - -node('rhel8'){ - env.JAVA_HOME="${tool 'openjdk-17'}" - env.PATH="${env.JAVA_HOME}/bin:${env.PATH}" - stage 'Checkout vscode-java code' - deleteDir() - git url: 'https://github.com/redhat-developer/vscode-java.git' - - stage 'install vscode-java build requirements' - installBuildRequirements() - - stage 'Build vscode-java' - buildVscodeExtension() - unstash 'server_distro' - def files = findFiles(glob: '**/org.eclipse.jdt.ls.product/distro/**.tar.gz') - sh "rm -rf ./out" - sh "mkdir ./server" - sh "tar -xvzf ${files[0].path} -C ./server" - - stage 'Test vscode-java for staging' - wrap([$class: 'Xvnc']) { - sh "npm run compile" //compile the test code too - env.SKIP_COMMANDS_TEST="true" - sh "npm test --silent" - } - - downloadLombokJar() - - packageExtensions() - - if (publishPreRelease.equals('true') || publishToMarketPlace.equals('true') || publishToOVSX.equals('true')) { - publishExtensions() - } -} diff --git a/README.md b/README.md index 266688994..f15e3c239 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Quick Start ============ 1. Install the Extension 2. On the following platforms, the extension should activate without any setup : `win32-x64`, `darwin-x64`, `darwin-arm64`, `linux-x64`, `linux-arm64`.\ -If on another platform, or using the "universal" version, you can [set](#setting-the-jdk) a _Java_ Development Kit. It must be Java 17 or above. +If on another platform, or using the "universal" version, you can [set](#setting-the-jdk) a _Java_ Development Kit. It must be Java 21 or above. 3. Optionally, download and install a Java Development Kit for your project (Java 1.8 or above is supported). See [Project JDKs](#project-jdks) for more details 4. Extension is activated when you first access a Java file * Recognizes projects with *Maven* or *Gradle* build files in the directory hierarchy. @@ -60,7 +60,7 @@ Now that Java extension will publish platform specific versions, it will embed a The following part is only kept for the universal version without embedded JRE. ->The tooling JDK will be used to launch the Language Server for Java. And by default, will also be used to compile your projects. Java 17 is the minimum required version.\ +>The tooling JDK will be used to launch the Language Server for Java. And by default, will also be used to compile your projects. Java 21 is the minimum required version.\ \ The path to the Java Development Kit can be specified by the `java.jdt.ls.java.home` setting in VS Code settings (workspace/user settings). If not specified, it is searched in the following order until a JDK meets current minimum requirement. >- the `JDK_HOME` environment variable diff --git a/gulpfile.js b/gulpfile.js index 836fcf818..b9fc46f5c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -29,12 +29,12 @@ gulp.task('clean_jre', function (done) { }); // Pls update the latest JRE if a new JDK is announced. -const LATEST_JRE = 17; +const LATEST_JRE = 21; /** * Usage: * npx gulp download_jre // Download the latest JRE for the platform of the current running machine. - * npx gulp download_jre --target darwin-x64 --javaVersion 17 // Download the specified JRE for the specified platform. + * npx gulp download_jre --target darwin-x64 --javaVersion 21 // Download the specified JRE for the specified platform. * * Supported platforms: * win32-x64, @@ -80,11 +80,11 @@ gulp.task('download_jre', async function (done) { /** * Here are the contents for a sample justj.manifest file: - * ../20211012_0921/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-17-linux-aarch64.tar.gz - * ../20211012_0921/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-17-linux-x86_64.tar.gz - * ../20211012_0921/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-17-macosx-aarch64.tar.gz - * ../20211012_0921/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-17-macosx-x86_64.tar.gz - * ../20211012_0921/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-17-win32-x86_64.tar.gz + * ../20241101_1100/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-21.0.5-linux-aarch64.tar.gz + * ../20241101_1100/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-21.0.5-linux-x86_64.tar.gz + * ../20241101_1100/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-21.0.5-macosx-aarch64.tar.gz + * ../20241101_1100/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-21.0.5-macosx-x86_64.tar.gz + * ../20241101_1100/org.eclipse.justj.openjdk.hotspot.jre.full.stripped-21.0.5-win32-x86_64.tar.gz */ const javaPlatform = platformMapping[targetPlatform]; const list = manifest.split(/\r?\n/); diff --git a/package.json b/package.json index fc10cfa64..0a63ed48c 100644 --- a/package.json +++ b/package.json @@ -311,7 +311,7 @@ "null" ], "default": null, - "description": "Specifies the folder path to the JDK (17 or more recent) used to launch the Java Language Server.\nOn Windows, backslashes must be escaped, i.e.\n\"java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-17.0_3\"", + "description": "Specifies the folder path to the JDK (21 or more recent) used to launch the Java Language Server.\nOn Windows, backslashes must be escaped, i.e.\n\"java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-21.0_5\"", "scope": "machine-overridable", "deprecationMessage": "This setting is deprecated, please use 'java.jdt.ls.java.home' instead.", "order": 0 @@ -322,7 +322,7 @@ "null" ], "default": null, - "description": "Specifies the folder path to the JDK (17 or more recent) used to launch the Java Language Server. This setting will replace the Java extension's embedded JRE to start the Java Language Server. \n\nOn Windows, backslashes must be escaped, i.e.\n\"java.jdt.ls.java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-17.0_3\"", + "description": "Specifies the folder path to the JDK (21 or more recent) used to launch the Java Language Server. This setting will replace the Java extension's embedded JRE to start the Java Language Server. \n\nOn Windows, backslashes must be escaped, i.e.\n\"java.jdt.ls.java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-21.0_5\"", "scope": "machine-overridable", "order": 10 }, diff --git a/src/requirements.ts b/src/requirements.ts index b30dfe812..717e5e062 100644 --- a/src/requirements.ts +++ b/src/requirements.ts @@ -41,7 +41,7 @@ export async function resolveRequirements(context: ExtensionContext): Promise { } const runtime = await getRuntime(javaHome, { withVersion: true }); return runtime?.version?.major || 0; -} \ No newline at end of file +}