diff --git a/images/macos/provision/assets/select-xamarin.sh b/images/macos/provision/assets/select-xamarin.sh new file mode 100644 index 000000000..45adc969c --- /dev/null +++ b/images/macos/provision/assets/select-xamarin.sh @@ -0,0 +1,22 @@ +#!/bin/bash +if [ -z "$1" ]; then + echo "No Xamarin SDK specified." + exit 0 +fi + +XAMARIN_SDK=$1 + +echo "Set Xamarin SDK to ${XAMARIN_SDK}" +FOLDERS_LIST=( + '/Library/Frameworks/Mono.framework/Versions' + '/Library/Frameworks/Xamarin.iOS.framework/Versions' + '/Library/Frameworks/Xamarin.Android.framework/Versions' + '/Library/Frameworks/Xamarin.Mac.framework/Versions' + ) + +for FOLDER in "${FOLDERS_LIST[@]}" +do + echo "Set Current folder for ${FOLDER}" + sudo rm -f ${FOLDER}/Current + sudo ln -s ${FOLDER}/${XAMARIN_SDK} ${FOLDER}/Current +done \ No newline at end of file diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index b01b3c232..90abf20a0 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -12,6 +12,12 @@ fi # Put documentation to $HOME root cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/ +# Put build vm assets scripts to proper directory +sudo mkdir -p /usr/local/opt/$USER/scripts +sudo chmod ugo+rwx /usr/local/opt/$USER/scripts +sudo chown $USER:admin /usr/local/opt/$USER +mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts + # Clean up npm cache which collected during image-generation # we have to do that here because `npm install` is run in a few different places during image-generation npm cache clean --force diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index 2190a6b4a..d1737ac5d 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 269ffa71f..ba6a0add3 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 3dcc3d33e..468f02e9b 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index 6da9df38d..f270fc43c 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests",