From 5ffdcd5797ef0d699bcc3140d2f5e5f9f44da6ac Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Thu, 18 Aug 2016 10:11:20 -0700 Subject: [PATCH] DEB start --- .../Microsoft.DotNet.Cli.Installer.DEB.props | 15 ++ ...Microsoft.DotNet.Cli.Installer.DEB.targets | 221 ++++++++++-------- .../Utils/DebPackageCreator.cs | 30 +-- 3 files changed, 147 insertions(+), 119 deletions(-) create mode 100644 build/package/Microsoft.DotNet.Cli.Installer.DEB.props diff --git a/build/package/Microsoft.DotNet.Cli.Installer.DEB.props b/build/package/Microsoft.DotNet.Cli.Installer.DEB.props new file mode 100644 index 000000000..eacf60d61 --- /dev/null +++ b/build/package/Microsoft.DotNet.Cli.Installer.DEB.props @@ -0,0 +1,15 @@ + + + + dotnet-deb-tool + 1.0.0-* + dotnet-deb-tool-consumer + debian_config.json + + package_root + $ + samples + docs + debian + + diff --git a/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets b/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets index 8dad18c11..4bddd0c23 100644 --- a/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets +++ b/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets @@ -1,114 +1,151 @@ - - - - + + + + + - - + + - - false - true + + false + true - $(RepoRoot)/scripts/package/package-debian.sh - $(RepoRoot)/Documentation/manpages + + - $(PackagesDirectory) - $(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) + $(RepoRoot)/scripts/package/package-debian.sh + $(RepoRoot)/Documentation/manpages - dotnet-dev-$(SdkVersion) - dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFrameworkVersion) - $(SharedFrameworkDebianPackageName.ToLower()) - dotnet-hostfxr-$(HostFxrVersion) - $(HostFxrDebianPackageName.ToLower()) - dotnet-host + $(PackagesDirectory) + $(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) - $(IntermediateDirectory)/debian/sdk + dotnet-dev-$(SdkVersion) + dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFrameworkVersion) + $(SharedFrameworkDebianPackageName.ToLower()) + dotnet-hostfxr-$(HostFxrVersion) + $(HostFxrDebianPackageName.ToLower()) + dotnet-host - $(SdkDebianIntermediateDirectory)/debian-testResults.xml - /usr/share/dotnet - $(RepoRoot)/test/EndToEnd - + $(IntermediateDirectory)/debian/sdk - - - + $(SdkDebianIntermediateDirectory)/debian-testResults.xml + /usr/share/dotnet + $(RepoRoot)/test/EndToEnd + - - - - + + + - - - - + + + + - + + + + - - - - + - + + + + - - - - - - + + + + - + + + - - - - - + + + + - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build_projects/shared-build-targets-utils/Utils/DebPackageCreator.cs b/build_projects/shared-build-targets-utils/Utils/DebPackageCreator.cs index 6d2a9dc6e..747532227 100644 --- a/build_projects/shared-build-targets-utils/Utils/DebPackageCreator.cs +++ b/build_projects/shared-build-targets-utils/Utils/DebPackageCreator.cs @@ -9,35 +9,22 @@ using System.Text; using System.Threading.Tasks; using Microsoft.DotNet.Cli.Build.Framework; -using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers; - namespace Microsoft.DotNet.Cli.Build { public class DebPackageCreator { - private static readonly string s_dotnetDebToolPackageId = "dotnet-deb-tool"; - private static readonly string s_toolConsumerProjectName = "dotnet-deb-tool-consumer"; - private static readonly string s_debianConfigJsonFileName = "debian_config.json"; - - private DotNetCli _dotnet; + private string _dotnet; private string _intermediateDirectory; private string _dotnetDebToolVersion; private string _dotnetDebToolPackageSource; private string _consumingProjectDirectory; public DebPackageCreator( - DotNetCli dotnet, + string dotnet, string intermediateDirectory, - string dotnetDebToolVersion = "1.0.0-*", + string dotnetDebToolVersion, string dotnetDebToolPackageSource = null) { - _dotnet = dotnet; - _intermediateDirectory = intermediateDirectory; - _dotnetDebToolVersion = dotnetDebToolVersion; - _dotnetDebToolPackageSource = dotnetDebToolPackageSource; - - _consumingProjectDirectory = Path.Combine(_intermediateDirectory, s_toolConsumerProjectName); - InitializeDotnetDebTool(); } @@ -53,11 +40,6 @@ namespace Microsoft.DotNet.Cli.Build IEnumerable debianFiles = null) { string debIntermediatesDirectory = Path.Combine(_intermediateDirectory, packageName, packageVersion); - if (Directory.Exists(debIntermediatesDirectory)) - { - FS.Rmdir(debIntermediatesDirectory); - } - FS.Mkdirp(debIntermediatesDirectory); string layoutDirectory = Path.Combine(debIntermediatesDirectory, "debianLayoutDirectory"); var debianLayoutDirectories = new DebianLayoutDirectories(layoutDirectory); @@ -77,12 +59,6 @@ namespace Microsoft.DotNet.Cli.Build private void CreateEmptyDebianLayout(DebianLayoutDirectories layoutDirectories) { - if (Directory.Exists(layoutDirectories.LayoutDirectory)) - { - FS.Rmdir(layoutDirectories.LayoutDirectory); - } - Directory.CreateDirectory(layoutDirectories.LayoutDirectory); - Directory.CreateDirectory(layoutDirectories.AbsolutePlacement); Directory.CreateDirectory(layoutDirectories.PackageRoot); Directory.CreateDirectory(layoutDirectories.Samples);