Skip to content

Commit

Permalink
unixpb: Add Xcode11 installation tasks to Unix playbook (#3197)
Browse files Browse the repository at this point in the history
* unixPb: add xcode11 install tasks to playbook

* update message

* correct tags

* correct condition and update comment

* fix conditional

* change command to shell

* xcode11

* change hosts parameter back to original

* typo

* switch to blob storage

---------

Co-authored-by: George Adams <[email protected]>
  • Loading branch information
Haroon-Khel and gdams authored Nov 16, 2023
1 parent 8519a18 commit a1c45af
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
tags: [build_tools]
- role: Xcode
when: ansible_distribution == "MacOSX"
tags: [build_tools, xcode, adoptopenjdk]
- role: Xcode11
when: ansible_distribution == "MacOSX" and ansible_architecture == "arm64"
tags: [xcode11]
- role: cmake # OpenJ9 / OpenJFX
when: ansible_distribution != "Solaris" # Compile fails on Solaris
tags: [build_tools, build_tools_openj9, build_tools_openjfx]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# Xcode 11.7 is needed to build x64 JDK8 om Arm64 Mac
# Xcode11.7 can be downloaded from https://developer.apple.com/download/all after authentication with apple ID and password
# See https://github.com/adoptium/infrastructure/issues/2536#issuecomment-1708716478

- name: Check if Xcode11.7 is installed
stat:
path: /Applications/Xcode-11.7.app/
register: xcode11_installed

- name: Check if SAS variable is defined
set_fact:
apple_variables: yes
when: not xcode11_installed.stat.exists and XCode11.7_SAS_TOKEN is defined

- name: Display Information when XCode11.7_SAS_TOKEN is not defined
debug:
msg: "XCode11.7_SAS_TOKEN is not defined. Xcode will need to be installed manually.
Skipping Xcode installation"
when: not xcode11_installed.stat.exists and apple_variables is not defined

- name: Install Xcode11.7
when: not xcode11_installed.stat.exists and apple_variables is defined
block:
- name: Download XCode 11.7 from Azure blob storage
get_url:
url: "https://ansiblestorageadopt.blob.core.windows.net/xcode11-7/Xcode_11.7.xip?{{ XCode11.7_SAS_TOKEN }}"
dest: /tmp/Xcode_11.7.xip
mode: 0755

- name: Extract Xcode11.7
shell: xip -x /tmp/Xcode_11.7.xip
args:
chdir: /tmp
creates: /tmp/Xcode.app

- name: Move Xcode11.7 to /Applications directory
copy:
src: /tmp/Xcode.app
dest: /Applications/Xcode-11.7.app/
remote_src: true

- name: Clean up Xcode11.7.xip file
file:
path: /tmp/Xcode_11.7.xip
state: absent

0 comments on commit a1c45af

Please sign in to comment.