Skip to content

Commit

Permalink
azdevops: xamarin#63.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Apr 3, 2019
1 parent db12e66 commit d515777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tools/devops/build-samples.csx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ string FindVariable (string variable)

switch (variable) {
case "XI_PACKAGE":
value = GetManifest ().Where ((v) => v.Contains ("xamarin.ios-") && v.EndsWith (".pkg", StringComparison.Ordinal)).FirstOrDefault ();
value = GetManifest (provision_from_commit).Where ((v) => v.Contains ("xamarin.ios-") && v.EndsWith (".pkg", StringComparison.Ordinal)).FirstOrDefault ();
break;
case "XM_PACKAGE":
value = GetManifest ().Where ((v) => v.Contains ("xamarin.mac-") && v.EndsWith (".pkg", StringComparison.Ordinal)).FirstOrDefault ();
value = GetManifest (provision_from_commit).Where ((v) => v.Contains ("xamarin.mac-") && v.EndsWith (".pkg", StringComparison.Ordinal)).FirstOrDefault ();
break;
}

Expand Down
12 changes: 6 additions & 6 deletions tools/devops/utils.csx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ string DownloadWithGithubAuth (string uri)
}

string manifest_url = null;
string GetManifestUrl (string org, string repo, string hash)
string GetManifestUrl (string hash)
{
if (manifest_url == null) {
var url = $"https://api.github.com/repos/{org}/{repo}/statuses/{hash}";
var url = $"https://api.github.com/repos/xamarin/xamarin-macios/statuses/{hash}";
var json = JToken.Parse (DownloadWithGithubAuth (url));
var value = (JValue) ((JArray) json).Where ((v) => v ["context"].ToString () == "manifest").Select ((v) => v ["target_url"]).FirstOrDefault ();
manifest_url = (string) value?.Value;
Expand All @@ -46,10 +46,10 @@ string GetManifestUrl (string org, string repo, string hash)
}

string[] manifest = null;
string[] GetManifest (string org, string repo, string hash)
string[] GetManifest (string hash)
{
if (manifest == null)
manifest = ReadAllText (GetManifestUrl (org, repo, hash)).Split ('\n');
manifest = ReadAllText (GetManifestUrl (hash)).Split ('\n');
return manifest;
}

Expand All @@ -75,6 +75,6 @@ string FindConfigurationVariable (string variable, string hash = "HEAD")
void InstallPackage (string name, string url)
{
Console.WriteLine ($"Installing {name} from {url}");
var version = Regex.Match (mono_package, "[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)?").Value;
Item (name, GetVersion (url)).Source (url);
var version = Regex.Match (url, "[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)?").Value;
Item (name, version).Source (url);
}

0 comments on commit d515777

Please sign in to comment.