diff --git a/DeviceTests/build.cake b/DeviceTests/build.cake index 4bea8f8b0..5f851f1f9 100644 --- a/DeviceTests/build.cake +++ b/DeviceTests/build.cake @@ -41,6 +41,7 @@ System.Environment.SetEnvironmentVariable("PATH", $"{ANDROID_HOME}/emulator" + System.IO.Path.PathSeparator + EnvironmentVariable("PATH")); +var RESTORE_CONFIG = MakeAbsolute((FilePath)"../devopsnuget.config").FullPath; // utils @@ -99,6 +100,7 @@ Task("build-ios") c.Properties["Platform"] = new List { "iPhoneSimulator" }; c.Properties["BuildIpa"] = new List { "true" }; c.Properties["ContinuousIntegrationBuild"] = new List { "false" }; + c.Properties["RestoreConfigFile"] = new List { RESTORE_CONFIG }; c.Targets.Clear(); c.Targets.Add("Rebuild"); c.BinaryLogger = new MSBuildBinaryLogSettings { @@ -142,6 +144,7 @@ Task("build-android") c.Configuration = "Debug"; // needs to be debug so unit tests get discovered c.Restore = true; c.Properties["ContinuousIntegrationBuild"] = new List { "false" }; + c.Properties["RestoreConfigFile"] = new List { RESTORE_CONFIG }; c.Targets.Clear(); c.Targets.Add("Rebuild"); c.Targets.Add("SignAndroidPackage"); @@ -221,6 +224,7 @@ Task("build-uwp") c.Properties["AppxBundlePlatforms"] = new List { "x86" }; c.Properties["AppxBundle"] = new List { "Always" }; c.Properties["AppxPackageSigningEnabled"] = new List { "true" }; + c.Properties["RestoreConfigFile"] = new List { RESTORE_CONFIG }; c.Targets.Clear(); c.Targets.Add("Rebuild"); c.BinaryLogger = new MSBuildBinaryLogSettings { diff --git a/build.cake b/build.cake index 172267bc3..a5f25f82a 100644 --- a/build.cake +++ b/build.cake @@ -4,6 +4,8 @@ var NUGET_VERSION = EnvironmentVariable("NUGET_VERSION") ?? "1.0.0"; var GIT_SHA = Argument("gitSha", EnvironmentVariable("GIT_SHA") ?? ""); var GIT_BRANCH_NAME = Argument("gitBranch", EnvironmentVariable("GIT_BRANCH_NAME") ?? ""); +var RESTORE_CONFIG = MakeAbsolute(new FilePath("./devopsnuget.config")).FullPath; + Task("prepare") .Does(() => { @@ -18,6 +20,7 @@ Task("libs") MSBuild("./Xamarin.Essentials/Xamarin.Essentials.csproj", new MSBuildSettings() .EnableBinaryLogger("./output/binlogs/libs.binlog") .SetConfiguration("Release") + .WithProperty("RestoreConfigFile", RESTORE_CONFIG) .WithRestore()); }); @@ -32,6 +35,7 @@ Task("nugets") .SetConfiguration("Release") .WithRestore() .WithProperty("PackageOutputPath", MakeAbsolute(new FilePath("./output/")).FullPath) + .WithProperty("RestoreConfigFile", RESTORE_CONFIG) .WithTarget("Pack")); }); @@ -46,6 +50,9 @@ Task("tests") DotNetCoreTest(csproj.FullPath, new DotNetCoreTestSettings { Configuration = "Release", Logger = $"trx;LogFileName={csproj.GetFilenameWithoutExtension()}.trx", + EnvironmentVariables = new Dictionary { + { "RestoreConfigFile", RESTORE_CONFIG } + } }); } catch (Exception) { failed++; @@ -67,6 +74,7 @@ Task("samples") MSBuild("./Xamarin.Essentials.sln", new MSBuildSettings() .EnableBinaryLogger("./output/binlogs/samples.binlog") .SetConfiguration("Release") + .WithProperty("RestoreConfigFile", RESTORE_CONFIG) .WithRestore()); }); @@ -79,6 +87,7 @@ Task("docs") .EnableBinaryLogger("./output/binlogs/docs.binlog") .SetConfiguration("Release") .WithRestore() + .WithProperty("RestoreConfigFile", RESTORE_CONFIG) .WithTarget("mdocupdatedocs")); }); diff --git a/devopsnuget.config b/devopsnuget.config new file mode 100644 index 000000000..db87568b5 --- /dev/null +++ b/devopsnuget.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/nuget.config b/nuget.config deleted file mode 100644 index 3e56f9971..000000000 --- a/nuget.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file