From 73474132d112a8b5d1df3ef4ba47298eedf0266a Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Mon, 3 Aug 2015 17:12:39 -0700 Subject: [PATCH] Added a target to verify nupkgs with NugetPackageVerifier --- build/_k-standard-goals.shade | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build/_k-standard-goals.shade b/build/_k-standard-goals.shade index b53dd7f030..cb65ca044c 100644 --- a/build/_k-standard-goals.shade +++ b/build/_k-standard-goals.shade @@ -13,6 +13,8 @@ default BUILD_DIR='${Path.Combine(TARGET_DIR, "build")}' default TEST_DIR='${Path.Combine(TARGET_DIR, "test")}' default Configuration='${E("Configuration")}' default Quiet='${ false }' +default PACKAGELIST_JSON_FILENAME = 'packages.json' +default DNX_TOOLS_FEED = 'https://www.myget.org/F/dnxtools/api/v2' @{ if (string.IsNullOrEmpty(E("DNX_BUILD_VERSION"))) @@ -187,6 +189,17 @@ default Quiet='${ false }' } } +#nuget-verify target='test' if='File.Exists(PACKAGELIST_JSON_FILENAME) && ShouldVerifyNupkgs' description='Verify if all the packages are generated properly' + var commandsDirectory = '${Path.Combine(BASE_DIR, "commands")}' + exec program='cmd' commandline='/C dnu commands install --source ${DNX_TOOLS_FEED} NuGetPackageVerifier --packages "${commandsDirectory}"' + exec program='cmd' commandline='/C ${Path.Combine(commandsDirectory, "nugetverify")} "${BUILD_DIR}" "${Path.Combine(BASE_DIR, PACKAGELIST_JSON_FILENAME)}"' + @{ + if (Directory.Exists(commandsDirectory)) + { + Directory.Delete(commandsDirectory, recursive: true); + } + } + #make-roslyn-fast ngen-roslyn @@ -293,6 +306,11 @@ functions @{ { get { return !string.IsNullOrEmpty(E("KOREBUILD_PARALLEL")); } } + + bool ShouldVerifyNupkgs + { + get { return E("KOREBUILD_VERIFY_NUPKGS") == "1"; } + } } macro name='Exec' program='string' commandline='string'