From e1ba3f23efb2703cf06823f245020bc67f03018d Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Fri, 18 Mar 2016 01:54:40 -0700 Subject: [PATCH] Reference Shared Framework from Shared Host --- packaging/debian/dotnet-debian_config.json | 5 +++-- scripts/dotnet-cli-build/DebTargets.cs | 10 +++++++++- scripts/dotnet-cli-build/PrepareTargets.cs | 16 ++++++++-------- scripts/package/package-debian.sh | 11 +++++++++++ 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/packaging/debian/dotnet-debian_config.json b/packaging/debian/dotnet-debian_config.json index be5b4406f..3ce0f070b 100644 --- a/packaging/debian/dotnet-debian_config.json +++ b/packaging/debian/dotnet-debian_config.json @@ -2,7 +2,8 @@ "maintainer_name":"Microsoft", "maintainer_email": "dotnetcore@microsoft.com", - "package_name": "dotnet", + "package_name": "dotnet-dev-%SDK_NUGET_VERSION%", + "install_root": "/usr/share/dotnet/sdk/%SDK_NUGET_VERSION%", "short_description": ".NET Core & command line tools", "long_description": ".NET Core is a cross-platform implementation of .NET Framework, a modern, modular platform\n for building diverse kinds of applications, from command-line applications to microservices and \n modern websites.\n This package contains the tools you will need to start writing applications for .NET Core. It includes \n compilers, package managers and other utilities that developers need.", @@ -33,7 +34,7 @@ }, "package_conflicts" : [ - "dotnet-nightly" + "dotnet-dev-nightly" ], "symlinks": { diff --git a/scripts/dotnet-cli-build/DebTargets.cs b/scripts/dotnet-cli-build/DebTargets.cs index 44fafad0f..32027bd92 100644 --- a/scripts/dotnet-cli-build/DebTargets.cs +++ b/scripts/dotnet-cli-build/DebTargets.cs @@ -42,7 +42,15 @@ namespace Microsoft.DotNet.Cli.Build Directory.CreateDirectory(objRoot); Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "package", "package-debian.sh"), - "-v", version, "-i", Dirs.Stage2, "-o", debFile, "-p", packageName, "-m", manPagesDir, "--previous-version-url", previousVersionURL, "--obj-root", objRoot) + "-v", version, + "-i", Dirs.Stage2, + "-o", debFile, + "-p", packageName, + "-m", manPagesDir, + "--framework-nuget-name", Monikers.SharedFrameworkName, + "--framework-nuget-version", c.BuildContext.Get("SharedFrameworkNugetVersion"), + "--previous-version-url", previousVersionURL, + "--obj-root", objRoot) .Execute() .EnsureSuccessful(); return c.Success(); diff --git a/scripts/dotnet-cli-build/PrepareTargets.cs b/scripts/dotnet-cli-build/PrepareTargets.cs index f4fb21ae5..0600bce7b 100644 --- a/scripts/dotnet-cli-build/PrepareTargets.cs +++ b/scripts/dotnet-cli-build/PrepareTargets.cs @@ -101,16 +101,16 @@ namespace Microsoft.DotNet.Cli.Build return c.Failed($"Stage 0 directory does not exist: {stage0}"); } - // // Identify the version - // string versionFile = Directory.GetFiles(stage0, ".version", SearchOption.AllDirectories).FirstOrDefault(); + // Identify the version + string versionFile = Directory.GetFiles(stage0, ".version", SearchOption.AllDirectories).FirstOrDefault(); - // if (string.IsNullOrEmpty(versionFile)) - // { - // throw new Exception($"'.version' file not found in '{stage0}' folder"); - // } + if (string.IsNullOrEmpty(versionFile)) + { + throw new Exception($"'.version' file not found in '{stage0}' folder"); + } - // var version = File.ReadAllLines(versionFile); - // c.Info($"Using Stage 0 Version: {version[1]}"); + var version = File.ReadAllLines(versionFile); + c.Info($"Using Stage 0 Version: {version[1]}"); return c.Success(); } diff --git a/scripts/package/package-debian.sh b/scripts/package/package-debian.sh index 63eba0280..8951062a2 100755 --- a/scripts/package/package-debian.sh +++ b/scripts/package/package-debian.sh @@ -28,6 +28,8 @@ help(){ echo " --manpages Directory containing man pages for the package (Optional)." echo " --output The full path to which the package will be written." echo " --package-name Package to identify during installation. Example - 'dotnet-nightly', 'dotnet'" + echo " --framework-nuget-name The name of the nuget package that produced this shared framework." + echo " --framework-nuget-version The versionf of the nuget package that produced this shared framework." echo " --previous-version-url Url to the previous version of the debian packge against which to run the upgrade tests." echo " --obj-root Root folder for intermediate objects." exit 1 @@ -104,6 +106,14 @@ parseargs(){ echo "Provide a URL to the previous debian pacakge (Required for running upgrade tests). Missing option '--previous-version-url'" && help fi + if [ -z "$SHARED_FRAMEWORK_NUGET_NAME" ]; then + echo "Provide the NuGet name of the targetted Shared Framework. Missing option '--framework-nuget-name'" && help + fi + + if [ -z "$SHARED_FRAMEWORK_NUGET_VERSION" ]; then + echo "Provide the NuGet version of the targetted Shared Framework. Missing option '--framework-nuget-version'" && help + fi + if [ ! -d "$REPO_BINARIES_DIR" ]; then echo "'$REPO_BINARIES_DIR' - is either missing or not a directory" 1>&2 exit 1 @@ -172,6 +182,7 @@ update_debian_json() header "Updating debian.json file" sed -i "s/%SHARED_FRAMEWORK_NUGET_NAME%/$SHARED_FRAMEWORK_NUGET_NAME/g" "$PACKAGE_LAYOUT_DIR"/debian_config.json sed -i "s/%SHARED_FRAMEWORK_NUGET_VERSION%/$SHARED_FRAMEWORK_NUGET_VERSION/g" "$PACKAGE_LAYOUT_DIR"/debian_config.json + sed -i "s/%SDK_NUGET_VERSION%/$DOTNET_CLI_VERSION/g" "$PACKAGE_LAYOUT_DIR"/debian_config.json } test_debian_package(){