Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provisionator's XcodeSelect now configures Xamarin Settings.plist #15079

Merged
merged 1 commit into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions tools/devops/build-provisioning.csx.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,3 @@ Item ("@MONO_PACKAGE@");
Item ("@MIN_SHARPIE_URL@");
Item ("@VS_PACKAGE@");
DotNetCoreSdk ("@SYSTEM_DOTNET_VERSION@");

var appleSdkOverride = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library", "Preferences", "Xamarin", "Settings.plist");
Item ("Override Apple SDK Settings")
.Condition (item => !File.Exists (appleSdkOverride) || GetSettingValue (appleSdkOverride, "AppleSdkRoot") != GetSelectedXcodePath ())
.Action (item => {
DeleteSafe (appleSdkOverride);
CreateSetting (appleSdkOverride, "AppleSdkRoot", GetSelectedXcodePath ());
Console.WriteLine ($"New VSMac iOS SDK Location: {GetSelectedXcodePath ()}");
});

void DeleteSafe (string file)
{
if (File.Exists (file))
File.Delete (file);
}

void CreateSetting (string settingFile, string key, string value)
{
Exec ("defaults", "write", settingFile, key, value);
}

string GetSettingValue (string settingFile, string keyName)
{
return Exec ("defaults", "read", settingFile, keyName).FirstOrDefault ();
}
25 changes: 0 additions & 25 deletions tools/devops/device-tests-provisioning.csx.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,3 @@ Item ("@MIN_SHARPIE_URL@");
DotNetCoreSdk ("@SYSTEM_DOTNET_VERSION@");

BrewPackages ("p7zip");

var appleSdkOverride = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library", "Preferences", "Xamarin", "Settings.plist");
Item ("Override Apple SDK Settings")
.Condition (item => !File.Exists (appleSdkOverride) || GetSettingValue (appleSdkOverride, "AppleSdkRoot") != GetSelectedXcodePath ())
.Action (item => {
DeleteSafe (appleSdkOverride);
CreateSetting (appleSdkOverride, "AppleSdkRoot", GetSelectedXcodePath ());
Console.WriteLine ($"New VSMac iOS SDK Location: {GetSelectedXcodePath ()}");
});

void DeleteSafe (string file)
{
if (File.Exists (file))
File.Delete (file);
}

void CreateSetting (string settingFile, string key, string value)
{
Exec ("defaults", "write", settingFile, key, value);
}

string GetSettingValue (string settingFile, string keyName)
{
return Exec ("defaults", "read", settingFile, keyName).FirstOrDefault ();
}
8 changes: 0 additions & 8 deletions tools/devops/provision-shared.csx
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ bool IsAtLeastVersion(string actualVer, string minVer)
return actualVerChars.Length > minVerChars.Length;
}

void CreateSetting (string settingFile, string key, string value) => Exec ("defaults", "write", settingFile, key, value);
string GetSettingValue (string settingFile, string keyName) => Exec ("defaults", "read", settingFile, keyName).FirstOrDefault ();
void DeleteSafe (string file)
{
if (File.Exists (file))
File.Delete (file);
}

void RemoveXcodeSymlinks (string xcodePath)
{
Console.WriteLine ($"Checkig if '{xcodePath}' is a symlink...");
Expand Down
9 changes: 0 additions & 9 deletions tools/devops/provision-xcode.csx.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,4 @@ RemoveXcodeSymlinks (reqXcode);
// Provision Xcode using the xip name declared in Make.config
Xcode ("@XCODE_XIP_NAME@").XcodeSelect (allowUntrusted: true);

var appleSdkOverride = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library", "Preferences", "Xamarin", "Settings.plist");
Item ("Override Apple SDK Settings")
.Condition (item => !File.Exists (appleSdkOverride) || GetSettingValue (appleSdkOverride, "AppleSdkRoot") != GetSelectedXcodePath ())
.Action (item => {
DeleteSafe (appleSdkOverride);
CreateSetting (appleSdkOverride, "AppleSdkRoot", GetSelectedXcodePath ());
Console.WriteLine ($"New VSMac iOS SDK Location: {GetSelectedXcodePath ()}");
});

LogInstalledXcodes ();