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 diff --git a/test/index.ts b/test/index.ts index ac7e2077..31d58994 100644 --- a/test/index.ts +++ b/test/index.ts @@ -12,15 +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', - }); + }; + 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', - }); + cp.spawnSync(cli, [...args, '--install-extension', 'vscjava.vscode-java-debug', '--pre-release'], options); // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath`