diff --git a/build.cake b/build.cake index 57acd7017..6b3e2d41b 100755 --- a/build.cake +++ b/build.cake @@ -7,6 +7,7 @@ #addin nuget:?package=SharpZipLib&version=1.4.2 // Imported scripts +#load "build/cake/nuget-install.cake" #load "build/cake/setup-environment.cake" #load "build/cake/update-config.cake" #load "build/cake/tests.cake" @@ -43,6 +44,8 @@ Information ($"BUILD_COMMIT : {BUILD_COMMIT}"); Information ($"BUILD_NUMBER : {BUILD_NUMBER}"); Information ($"BUILD_TIMESTAMP : {BUILD_TIMESTAMP}"); +RunTarget("nuget-install"); + Task ("packages") .IsDependentOn ("binderate") .IsDependentOn ("nuget"); diff --git a/build/cake/binderate.cake b/build/cake/binderate.cake index b355bdf51..3f3cdf7f7 100644 --- a/build/cake/binderate.cake +++ b/build/cake/binderate.cake @@ -10,6 +10,8 @@ Task ("binderate") var configFile = MakeAbsolute (new FilePath ("./config.json")).FullPath; var basePath = MakeAbsolute (new DirectoryPath ("./")).FullPath; + EnsureDirectoryExists ("./output"); + // Run the binderator project var args = new ProcessArgumentBuilder () .Append ("binderate") diff --git a/build/cake/build-and-package.cake b/build/cake/build-and-package.cake index 0e372ab6a..0031fd5c0 100644 --- a/build/cake/build-and-package.cake +++ b/build/cake/build-and-package.cake @@ -18,6 +18,12 @@ Task ("nuget") "./generated/AndroidX.sln", new DotNetBuildSettings { MSBuildSettings = settings } ); + + // validation fails on CI if the package is in the output directory + DeleteFile ($"./output/cliwrap.3.8.2.nupkg"); + DeleteFile ($"./output/holisticware.core.net.http.0.0.4.nupkg"); + DeleteFile ($"./output/holisticware.core.io.0.0.4.nupkg"); + DeleteFile ($"./output/holisticware.xamarin.tools.componentgovernance.0.0.1.4.nupkg"); }); // Builds the .csproj projects diff --git a/build/cake/nuget-install.cake b/build/cake/nuget-install.cake new file mode 100644 index 000000000..5de8d37db --- /dev/null +++ b/build/cake/nuget-install.cake @@ -0,0 +1,97 @@ +/* +Nuget download + +https://www.nuget.org/api/v2/package/{packageID}/ + + +https://api.nuget.org/v3/index.json?package=CliWrap&version=3.8.2 +https://api.nuget.org/v3-flatcontainer/cliwrap/3.8.2/cliwrap.3.8.2.nupkg + }, +https://www.nuget.org/api/v2/package/cake.coreclr/1.3.0/ + +*/ +/* +#addin nuget:https://api.nuget.org/v3/index.json?package=Mono.Cecil&version=0.11.6 +#addin nuget:https://api.nuget.org/v3/index.json?package=HolisticWare.Xamarin.Tools.ComponentGovernance&version=0.0.1.4 +#addin nuget:https://api.nuget.org/v3/index.json?package=HolisticWare.Core.Net.HTTP&version=0.0.4 +#addin nuget:https://api.nuget.org/v3/index.json?package=HolisticWare.Core.IO&version=0.0.4 +*/ + +Dictionary nuget_packages = new () +{ + // { "cake.coreclr", "1.3.0" } + { "HolisticWare.Xamarin.Tools.ComponentGovernance", "0.0.1.4" }, + { "HolisticWare.Core.Net.HTTP", "0.0.4" }, + { "HolisticWare.Core.IO", "0.0.4" }, +}; + +Task("nuget-install") + .Does + ( + () => + { + EnsureDirectoryExists("./output"); + + /* + nuget.exe must be in the PATH + NuGetInstall + ( + "HolisticWare.Xamarin.Tools.ComponentGovernance", + new NuGetInstallSettings + { + Version = "0.0.1.4", + OutputDirectory = "./tools/Addins" + } + ); + NuGetInstall + ( + "HolisticWare.Core.Net.HTTP", + new NuGetInstallSettings + { + Version = "0.0.4", + OutputDirectory = "./tools/Addins" + } + ); + NuGetInstall + ( + "HolisticWare.Core.IO", + new NuGetInstallSettings + { + Version = "0.0.4", + OutputDirectory = "./tools/Addins" + } + ); + NuGetInstall + ( + "CliWrap", + new NuGetInstallSettings + { + Version = "3.8.2", + OutputDirectory = "./tools/Addins" + } + ); + */ + DownloadFile + ( + "https://api.nuget.org/v3-flatcontainer/cliwrap/3.8.2/cliwrap.3.8.2.nupkg", + $"./output/cliwrap.3.8.2.nupkg" + ); + DownloadFile + ( + "https://api.nuget.org/v3-flatcontainer/holisticware.core.net.http/0.0.4/holisticware.core.net.http.0.0.4.nupkg", + $"./output/holisticware.core.net.http.0.0.4.nupkg" + ); + DownloadFile + ( + "https://api.nuget.org/v3-flatcontainer/holisticware.core.io/0.0.4/holisticware.core.io.0.0.4.nupkg", + $"./output/holisticware.core.io.0.0.4.nupkg" + ); + DownloadFile + ( + "https://api.nuget.org/v3-flatcontainer/holisticware.xamarin.tools.componentgovernance/0.0.1.4/holisticware.xamarin.tools.componentgovernance.0.0.1.4.nupkg", + $"./output/holisticware.xamarin.tools.componentgovernance.0.0.1.4.nupkg" + ); + /* + */ + } + ); diff --git a/tests/common/NuGet.config b/tests/common/NuGet.config index 4021ec78f..dc9a1b349 100644 --- a/tests/common/NuGet.config +++ b/tests/common/NuGet.config @@ -3,8 +3,29 @@ - + + + + + + + + + + + + + + + + + + + + + +