Azure-devops-docs: Why does the select-xamarin-sdk.sh script take the Mono version as parameter?

Created on 7 Sep 2018  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

Hello,

It's not clear why does the select-xamarin-sdk.sh script take the Mono version as parameter?

I would assume that select-xamarin-sdk.sh should be used to set either the Xamarin.iOS version, or the Xamarin.Android version.

We actually need "hardcoding" the Xamarin.iOS and Xamarin.Android version as part of our build, to make sure we get repeatable builds, regardless of what is the Current / Stable Xamarin.iOS and Xamarin.Android version.

So can we pass it the Xamarin.iOS and Xamarin.Android version?

Thank you,
Cosmin


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devopprod

Most helpful comment

https://github.com/MicrosoftDocs/vsts-docs/issues/2129 is my work around. @cosminstirbu @bartdkmediahuis @andyjlewis @vtbassmatt

All 7 comments

Good questions, since we are facing a similar issue with the "default agent" running our builds.

https://developercommunity.visualstudio.com/content/problem/324857/macos-preview-unable-to-use-weakattribute-introduc.html

Hello,

Any news on this ticket?

Thank you,
Cosmin

When I run "cat $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh" the output I see shows:

!/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

When looking at my actual machine, the Mono Version does get sym linked to the Current folder however, the Xamarin versions don't share the same format. Also, we're told to use underscores in the version numbers but I don't see where that's being transformed into a valid path. At a bare minimum this script should check that the path including the version numbers exists prior to making the sym link.

To create the sym links myself for Mono and Xamarin.iOS versions I'm using the commands below I'd assume setting the Xamarin.Android version would be similar. I still have no idea why we're supposed to use underscores.

/bin/bash -c "sudo xcode-select -s /Applications/Xcode_10.app/Contents/Developer"
xcodebuild -showsdks

/bin/bash -c "sudo rm -f '/Library/Frameworks/Mono.framework/Versions/Current'"
/bin/bash -c "sudo ln -s '/Library/Frameworks/Mono.framework/Versions/5.12.0' '/Library/Frameworks/Mono.framework/Versions/Current'"

/bin/bash -c "sudo rm -f '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current'"
/bin/bash -c "sudo ln -s '/Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15' '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current'"

https://github.com/MicrosoftDocs/vsts-docs/issues/2129 is my work around. @cosminstirbu @bartdkmediahuis @andyjlewis @vtbassmatt

Apologies for the delay on this. We're working to make it better. In the meantime, please refer to the workaround that mrooths mentioned above (#2129).

FYI:
get extra logs from agent.
/Library/Frameworks/Xamarin.iOS.framework/Versions folder has links to folders with names like
/Library/Frameworks/Xamarin.iOS.framework/Versions/6_2_2
those links are linked to some real version folder like 11.0.3 etc
same for Android and Mac
that's how it works

Was this page helpful?
0 / 5 - 0 ratings