Added logic to handle backslash

On azure needs 1 backslash, locally 2 to be able to find csproj inside solution
This commit is contained in:
Israel Soto 2019-08-26 13:05:01 -05:00 коммит произвёл GitHub
Родитель d8374f85bb
Коммит 714648a954
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -10,6 +10,9 @@
var TARGET = Argument ("t", Argument ("target", "build"));
var SDKS = Argument ("sdks", "");
var IS_LOCAL_BUILD = true;
var BACKSLASH = string.Empty;
var SOLUTION_PATH = "./Xamarin.Google.sln";
// Artifacts that need to be built from pods or be copied from pods
@ -54,6 +57,12 @@ void BuildCake (string target)
// From Cake.Xamarin.Build, dumps out versions of things
// LogSystemInfo ();
Setup (context =>
{
IS_LOCAL_BUILD = string.IsNullOrWhiteSpace (EnvironmentVariable ("AGENT_ID"));
Information ("Is a local build? {IS_LOCAL_BUILD}");
BACKSLASH = IS_LOCAL_BUILD ? @"\\" : @"\";
});
Task("build")
.Does(() =>
@ -101,14 +110,14 @@ Task("prepare-artifacts")
Information ("Build order:");
foreach (var artifact in ARTIFACTS_TO_BUILD) {
SOURCES_TARGETS.Add($@"{artifact.ComponentGroup}\{artifact.CsprojName.Replace ('.', '_')}");
SOURCES_TARGETS.Add($@"{artifact.ComponentGroup}{BACKSLASH}{artifact.CsprojName.Replace ('.', '_')}");
Information (artifact.Id);
}
foreach (var artifact in orderedArtifactsForSamples)
if (artifact.Samples != null)
foreach (var sample in artifact.Samples)
SAMPLES_TARGETS.Add($@"{artifact.ComponentGroup}\{sample.Replace ('.', '_')}");
SAMPLES_TARGETS.Add($@"{artifact.ComponentGroup}{BACKSLASH}{sample.Replace ('.', '_')}");
});
Task ("externals")
@ -150,7 +159,7 @@ Task ("libs")
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add($@"source\{target}");
c.Targets.Add($@"source{BACKSLASH}{target}");
});
});
@ -163,7 +172,7 @@ Task ("samples")
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add($@"samples\{target}");
c.Targets.Add($@"samples{BACKSLASH}{target}");
});
});
@ -178,7 +187,7 @@ Task ("nuget")
c.Configuration = "Release";
c.MaxCpuCount = 0;
c.Targets.Clear();
c.Targets.Add($@"source\{target}:Pack");
c.Targets.Add($@"source{BACKSLASH}{target}:Pack");
c.Properties.Add("PackageOutputPath", new [] { "../../../artifacts/" });
});
});