Skip to content

Commit

Permalink
Only install Java 17 on Linux
Browse files Browse the repository at this point in the history
- Mac and Windows should now be pre-installed
  • Loading branch information
mikeharder committed Jan 24, 2022
1 parent b30ec7d commit 4c0b04a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
3 changes: 1 addition & 2 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ jobs:
arguments: '--project-list $(ProjectList)'
condition: and(succeeded(), eq(variables['ShouldRunSourceTests'],'true'))

- ${{ if contains(variables['Agent.OS'], 'linux') }}:
- template: /eng/pipelines/templates/steps/install-java-17.yml
- template: /eng/pipelines/templates/steps/install-java-17.yml

- task: Maven@3
displayName: 'Build for non-From Source run'
Expand Down
6 changes: 2 additions & 4 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ jobs:
pip install markdown2 BeautifulSoup4
displayName: 'pip install markdown2 and BeautifulSoup4'
- ${{ if contains(variables['Agent.OS'], 'linux') }}:
- template: /eng/pipelines/templates/steps/install-java-17.yml
- template: /eng/pipelines/templates/steps/install-java-17.yml

- task: Maven@3
displayName: 'Build and Package, JDK Version: $(JavaBuildVersion)'
Expand Down Expand Up @@ -308,8 +307,7 @@ jobs:
# reports. This means it is available as part of that, but also so that this is not documented in the project report.
- template: ../steps/install-reporting-tools.yml

- ${{ if contains(variables['Agent.OS'], 'linux') }}:
- template: /eng/pipelines/templates/steps/install-java-17.yml
- template: /eng/pipelines/templates/steps/install-java-17.yml

# maven dependency:tree needs to be able to resolve dependencies, so these should be installed.
- task: Maven@3
Expand Down
44 changes: 22 additions & 22 deletions eng/pipelines/templates/steps/install-java-17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ steps:
- pwsh: Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz -OutFile $(agent.tempDirectory)/openjdk-17_linux-x64_bin.tar.gz
condition: and(succeeded(), contains(variables['Agent.OS'], 'linux'))

- pwsh: Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_macos-x64_bin.tar.gz -OutFile $(agent.tempDirectory)/openjdk-17_macos-x64_bin.tar.gz
condition: and(succeeded(), contains(variables['Agent.OS'], 'darwin'))
# - pwsh: Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_macos-x64_bin.tar.gz -OutFile $(agent.tempDirectory)/openjdk-17_macos-x64_bin.tar.gz
# condition: and(succeeded(), contains(variables['Agent.OS'], 'darwin'))

- pwsh: Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_windows-x64_bin.zip -OutFile $(agent.tempDirectory)/openjdk-17_windows-x64_bin.zip
condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))
# - pwsh: Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_windows-x64_bin.zip -OutFile $(agent.tempDirectory)/openjdk-17_windows-x64_bin.zip
# condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))

- task: JavaToolInstaller@0
inputs:
Expand All @@ -18,22 +18,22 @@ steps:
cleanDestinationDirectory: false
condition: and(succeeded(), contains(variables['Agent.OS'], 'linux'))

- task: JavaToolInstaller@0
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: LocalDirectory
jdkFile: "$(agent.tempDirectory)/openjdk-17_macos-x64_bin.tar.gz"
jdkDestinationDirectory: "$(agent.toolsDirectory)/jdk17"
cleanDestinationDirectory: false
condition: and(succeeded(), contains(variables['Agent.OS'], 'darwin'))
# - task: JavaToolInstaller@0
# inputs:
# versionSpec: "17"
# jdkArchitectureOption: x64
# jdkSourceOption: LocalDirectory
# jdkFile: "$(agent.tempDirectory)/openjdk-17_macos-x64_bin.tar.gz"
# jdkDestinationDirectory: "$(agent.toolsDirectory)/jdk17"
# cleanDestinationDirectory: false
# condition: and(succeeded(), contains(variables['Agent.OS'], 'darwin'))

- task: JavaToolInstaller@0
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: LocalDirectory
jdkFile: "$(agent.tempDirectory)/openjdk-17_windows-x64_bin.zip"
jdkDestinationDirectory: "$(agent.toolsDirectory)/jdk17"
cleanDestinationDirectory: false
condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))
# - task: JavaToolInstaller@0
# inputs:
# versionSpec: "17"
# jdkArchitectureOption: x64
# jdkSourceOption: LocalDirectory
# jdkFile: "$(agent.tempDirectory)/openjdk-17_windows-x64_bin.zip"
# jdkDestinationDirectory: "$(agent.toolsDirectory)/jdk17"
# cleanDestinationDirectory: false
# condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))

0 comments on commit 4c0b04a

Please sign in to comment.