From 2abde0f99845f90e8d3b777611349d758599ff59 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Thu, 3 Apr 2025 11:08:38 +0800 Subject: [PATCH 1/3] build - Update java to 21 --- .azure-pipelines/vscode-java-test-ci.yml | 4 ++-- .azure-pipelines/vscode-java-test-nightly.yml | 12 ++++++------ .azure-pipelines/vscode-java-test-rc.yml | 12 ++++++------ .github/workflows/build.yml | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/vscode-java-test-ci.yml b/.azure-pipelines/vscode-java-test-ci.yml index 911e2c3e..2dfe81ab 100644 --- a/.azure-pipelines/vscode-java-test-ci.yml +++ b/.azure-pipelines/vscode-java-test-ci.yml @@ -44,9 +44,9 @@ extends: - checkout: self fetchTags: false - task: JavaToolInstaller@0 - displayName: Use Java 17 + displayName: Use Java 21 inputs: - versionSpec: "17" + versionSpec: "21" jdkArchitectureOption: x64 jdkSourceOption: PreInstalled - task: Npm@1 diff --git a/.azure-pipelines/vscode-java-test-nightly.yml b/.azure-pipelines/vscode-java-test-nightly.yml index 9a7be1ad..a13a5ba6 100644 --- a/.azure-pipelines/vscode-java-test-nightly.yml +++ b/.azure-pipelines/vscode-java-test-nightly.yml @@ -48,20 +48,20 @@ extends: version: '20.x' # The image does not have jdk preinstalled, we need to download it first. - task: PowerShell@2 - displayName: Download JDK 17 + displayName: Download JDK 21 inputs: targetType: 'inline' script: |- New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" - Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-17-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-17-windows-x64.zip" + Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-21-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-21-windows-x64.zip" - task: JavaToolInstaller@0 - displayName: Use Java 17 + displayName: Use Java 21 inputs: - versionSpec: "17" + versionSpec: "21" jdkArchitectureOption: x64 jdkSourceOption: LocalDirectory - jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-17-windows-x64.zip - jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk17 + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-21-windows-x64.zip + jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk21 - script: java --version displayName: 'Check Java installation' - task: Npm@1 diff --git a/.azure-pipelines/vscode-java-test-rc.yml b/.azure-pipelines/vscode-java-test-rc.yml index d6a85e8f..d8134c38 100644 --- a/.azure-pipelines/vscode-java-test-rc.yml +++ b/.azure-pipelines/vscode-java-test-rc.yml @@ -43,20 +43,20 @@ extends: version: '20.x' # The image does not have jdk preinstalled, we need to download it first. - task: PowerShell@2 - displayName: Download JDK 17 + displayName: Download JDK 21 inputs: targetType: 'inline' script: |- New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" - Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-17-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-17-windows-x64.zip" + Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-21-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-21-windows-x64.zip" - task: JavaToolInstaller@0 - displayName: Use Java 17 + displayName: Use Java 21 inputs: - versionSpec: "17" + versionSpec: "21" jdkArchitectureOption: x64 jdkSourceOption: LocalDirectory - jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-17-windows-x64.zip - jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk17 + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-21-windows-x64.zip + jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk21 - script: java --version displayName: 'Check Java installation' - task: Npm@1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 747da3b0..e8654be1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install @@ -65,7 +65,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install @@ -101,7 +101,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install From 74f0a440e82a5d09d69cf14ae51efacdc3925218 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Thu, 3 Apr 2025 11:31:19 +0800 Subject: [PATCH 2/3] add windows option for spawn --- test/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/index.ts b/test/index.ts index ac7e2077..a6052808 100644 --- a/test/index.ts +++ b/test/index.ts @@ -15,11 +15,13 @@ async function main(): Promise { cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java', '--pre-release'], { encoding: 'utf-8', stdio: 'inherit', + shell: true, }); cp.spawnSync(cli, [...args, '--install-extension', 'vscjava.vscode-java-debug', '--pre-release'], { encoding: 'utf-8', stdio: 'inherit', + shell: true, }); // The folder containing the Extension Manifest package.json From c4fcac6b0fd359711a6ac09f8cc046a406ea38a0 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Thu, 3 Apr 2025 12:19:47 +0800 Subject: [PATCH 3/3] fix test --- test/index.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/index.ts b/test/index.ts index a6052808..31d58994 100644 --- a/test/index.ts +++ b/test/index.ts @@ -12,17 +12,16 @@ async function main(): Promise { const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); // Resolve redhat.java dependency - cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java', '--pre-release'], { + const options: cp.SpawnSyncOptionsWithStringEncoding = { encoding: 'utf-8', stdio: 'inherit', - shell: true, - }); + }; + if (process.platform === 'win32') { + options.shell = true; + } + cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java', '--pre-release'], options); - cp.spawnSync(cli, [...args, '--install-extension', 'vscjava.vscode-java-debug', '--pre-release'], { - encoding: 'utf-8', - stdio: 'inherit', - shell: true, - }); + cp.spawnSync(cli, [...args, '--install-extension', 'vscjava.vscode-java-debug', '--pre-release'], options); // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath`