From 143bee75ff81e7564664417d583f61682fe7ba81 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Thu, 1 Nov 2018 23:15:59 -0700 Subject: [PATCH] Produce deb packages --- eng/restore-toolset.sh | 39 +++++++ .../core-sdk-tasks}/Chmod.cs | 0 .../core-sdk-tasks}/Constants.cs | 0 .../core-sdk-tasks}/DotNetDebTool.cs | 0 .../core-sdk-tasks}/DotNetTool.cs | 0 .../EnvironmentVariableFilter.cs | 0 .../core-sdk-tasks}/ReplaceFileContents.cs | 0 src/core-sdk-tasks/core-sdk-tasks.csproj | 1 + src/redist/redist.csproj | 3 +- src/redist/targets/BuildCoreSdkTasks.targets | 3 + src/redist/targets/GenerateDebs.targets | 104 +++++++++++------- src/redist/targets/GenerateLayout.targets | 5 +- src/redist/targets/GenerateMSIs.targets | 4 +- ...xNativeInstallerDependencyVersions.targets | 2 +- .../packaging/deb/dotnet-debian_config.json | 0 .../redist/targets}/packaging/deb/postinst | 0 16 files changed, 116 insertions(+), 45 deletions(-) create mode 100644 eng/restore-toolset.sh rename {old/build_projects/dotnet-cli-build => src/core-sdk-tasks}/Chmod.cs (100%) rename {old/build_projects/Microsoft.DotNet.Cli.Build.Framework => src/core-sdk-tasks}/Constants.cs (100%) rename {old/build_projects/dotnet-cli-build => src/core-sdk-tasks}/DotNetDebTool.cs (100%) rename {old/build_projects/dotnet-cli-build => src/core-sdk-tasks}/DotNetTool.cs (100%) rename {old/build_projects/dotnet-cli-build => src/core-sdk-tasks}/EnvironmentVariableFilter.cs (100%) rename {old/build_projects/dotnet-cli-build => src/core-sdk-tasks}/ReplaceFileContents.cs (100%) rename {old/build/package => src/redist/targets}/LinuxNativeInstallerDependencyVersions.targets (97%) rename {old => src/redist/targets}/packaging/deb/dotnet-debian_config.json (100%) rename {old => src/redist/targets}/packaging/deb/postinst (100%) diff --git a/eng/restore-toolset.sh b/eng/restore-toolset.sh new file mode 100644 index 000000000..a7291dc90 --- /dev/null +++ b/eng/restore-toolset.sh @@ -0,0 +1,39 @@ +function InitializeCustomSDKToolset { + if [[ "$restore" != true ]]; then + return + fi + + # The following frameworks and tools are used only for testing. + # Do not attempt to install them in source build. + if [[ "${DotNetBuildFromSource:-}" == "true" ]]; then + return + fi + + #InstallDotNetSharedFramework "1.0.5" + #InstallDotNetSharedFramework "1.1.2" + + # Install 2.1 framework for dotnet-deb-tool + InstallDotNetSharedFramework "2.1.0" +} + +# Installs additional shared frameworks for testing purposes +function InstallDotNetSharedFramework { + local version=$1 + local dotnet_root=$DOTNET_INSTALL_DIR + local fx_dir="$dotnet_root/shared/Microsoft.NETCore.App/$version" + + if [[ ! -d "$fx_dir" ]]; then + GetDotNetInstallScript "$dotnet_root" + local install_script=$_GetDotNetInstallScript + + bash "$install_script" --version $version --install-dir "$dotnet_root" --runtime "dotnet" + local lastexitcode=$? + + if [[ $lastexitcode != 0 ]]; then + echo "Failed to install Shared Framework $version to '$dotnet_root' (exit code '$lastexitcode')." + ExitWithExitCode $lastexitcode + fi + fi +} + +InitializeCustomSDKToolset \ No newline at end of file diff --git a/old/build_projects/dotnet-cli-build/Chmod.cs b/src/core-sdk-tasks/Chmod.cs similarity index 100% rename from old/build_projects/dotnet-cli-build/Chmod.cs rename to src/core-sdk-tasks/Chmod.cs diff --git a/old/build_projects/Microsoft.DotNet.Cli.Build.Framework/Constants.cs b/src/core-sdk-tasks/Constants.cs similarity index 100% rename from old/build_projects/Microsoft.DotNet.Cli.Build.Framework/Constants.cs rename to src/core-sdk-tasks/Constants.cs diff --git a/old/build_projects/dotnet-cli-build/DotNetDebTool.cs b/src/core-sdk-tasks/DotNetDebTool.cs similarity index 100% rename from old/build_projects/dotnet-cli-build/DotNetDebTool.cs rename to src/core-sdk-tasks/DotNetDebTool.cs diff --git a/old/build_projects/dotnet-cli-build/DotNetTool.cs b/src/core-sdk-tasks/DotNetTool.cs similarity index 100% rename from old/build_projects/dotnet-cli-build/DotNetTool.cs rename to src/core-sdk-tasks/DotNetTool.cs diff --git a/old/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs b/src/core-sdk-tasks/EnvironmentVariableFilter.cs similarity index 100% rename from old/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs rename to src/core-sdk-tasks/EnvironmentVariableFilter.cs diff --git a/old/build_projects/dotnet-cli-build/ReplaceFileContents.cs b/src/core-sdk-tasks/ReplaceFileContents.cs similarity index 100% rename from old/build_projects/dotnet-cli-build/ReplaceFileContents.cs rename to src/core-sdk-tasks/ReplaceFileContents.cs diff --git a/src/core-sdk-tasks/core-sdk-tasks.csproj b/src/core-sdk-tasks/core-sdk-tasks.csproj index 0973ec464..c20c03c23 100644 --- a/src/core-sdk-tasks/core-sdk-tasks.csproj +++ b/src/core-sdk-tasks/core-sdk-tasks.csproj @@ -1,6 +1,7 @@  $(CoreSdkTargetFramework);net472 + $(CoreSdkTargetFramework) diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index f77eca84c..63ca1a071 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -15,6 +15,7 @@ - + + diff --git a/src/redist/targets/BuildCoreSdkTasks.targets b/src/redist/targets/BuildCoreSdkTasks.targets index 4ffcf3dba..1b469fb54 100644 --- a/src/redist/targets/BuildCoreSdkTasks.targets +++ b/src/redist/targets/BuildCoreSdkTasks.targets @@ -27,4 +27,7 @@ + + + diff --git a/src/redist/targets/GenerateDebs.targets b/src/redist/targets/GenerateDebs.targets index 969dc583f..5be1a55d4 100644 --- a/src/redist/targets/GenerateDebs.targets +++ b/src/redist/targets/GenerateDebs.targets @@ -1,15 +1,21 @@ - - + + + + + - + DependsOnTargets="SetSdkVersionInfo; + GetCurrentRuntimeInformation; + SetupFileExtensions; + CalculateLinuxNativeInstallerDependencyVersions; + SetSdkBrandingInfo"> - $(MSBuildThisFileDirectory)/dotnet-deb-tool-consumer - $(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp2.0/tool/package_tool + $(MSBuildProjectDirectory) + + @@ -48,9 +54,11 @@ - $(RepoRoot)/Documentation/manpages - $(RepoRoot)/test/EndToEnd/EndToEnd.csproj - $(OutputDirectory)/sdk + + $(RepoRoot)Documentation/manpages + + $(RepoRoot)test/EndToEnd/EndToEnd.Tests.csproj + $(RedistLayoutPath)sdk/ @@ -60,32 +68,32 @@ - $(PackagesDirectory) - $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) - $(IntermediateDirectory)/debian/sdk - $(SdkDebianIntermediateDirectory)/deb-tool-output - $(SdkDebianIntermediateDirectory)/debian-testResults.xml + $(ArtifactsShippingPackagesDir) + $(InstallerOutputDirectory)$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) + $(IntermediateOutputPath)debian/sdk/ + $(SdkDebianIntermediateDirectory)deb-tool-output + $(SdkDebianIntermediateDirectory)debian-testResults.xml - $(SdkDebianIntermediateDirectory)/debianLayoutDirectory - $(LayoutDirectory)/$(LayoutPackageRootDirName) - $(LayoutDirectory)/$(LayoutAbsolutePlacementDirName) - $(LayoutDirectory)/$(LayoutSamplesDirName) - $(LayoutDirectory)/$(LayoutDocsDirName) - $(LayoutDirectory)/$(LayoutDebianFilesDirName) + $(SdkDebianIntermediateDirectory)debianLayoutDirectory/ + $(LayoutDirectory)$(LayoutPackageRootDirName) + $(LayoutDirectory)$(LayoutAbsolutePlacementDirName) + $(LayoutDirectory)$(LayoutSamplesDirName) + $(LayoutDirectory)$(LayoutDocsDirName) + $(LayoutDirectory)$(LayoutDebianFilesDirName) - $(RepoRoot)/packaging/deb/dotnet-debian_config.json - $(LayoutDirectory)/debian_config.json + $(MSBuildThisFileDirectory)packaging/deb/dotnet-debian_config.json + $(LayoutDirectory)debian_config.json - $(RepoRoot)/packaging/deb/postinst - $(LayoutDirectory)/debian/postinst + $(MSBuildThisFileDirectory)packaging/deb/postinst + $(LayoutDirectory)debian/postinst @@ -125,16 +133,22 @@ - + + + + - + + + + + + + + + + $(AspNetCoreSharedFxBaseRuntimeVersion.IndexOf('-')) $(AspNetCoreSharedFxBaseRuntimeVersion) @@ -166,11 +192,11 @@ Outputs="$(SdkInstallerFile)" > - - - - - + + + + + - + Mode="u+x" />--> - - + @@ -319,8 +345,8 @@ - + diff --git a/src/redist/targets/GenerateLayout.targets b/src/redist/targets/GenerateLayout.targets index 9e9ffb70a..c40b66f10 100644 --- a/src/redist/targets/GenerateLayout.targets +++ b/src/redist/targets/GenerateLayout.targets @@ -2,6 +2,7 @@ $(BaseOutputPath)$(Configuration)\dotnet\ $(BaseOutputPath)$(Configuration)\dotnet-internal\ + $(IntermediateOutputPath)downloads\ @@ -168,10 +169,10 @@ - $(IntermediateOutputPath)downloads\%(DownloadFileName) + $(DownloadsFolder)%(DownloadFileName) - $(IntermediateOutputPath)downloads\%(DownloadFileName) + $(DownloadsFolder)%(DownloadFileName) true diff --git a/src/redist/targets/GenerateMSIs.targets b/src/redist/targets/GenerateMSIs.targets index 56a619959..be96408eb 100644 --- a/src/redist/targets/GenerateMSIs.targets +++ b/src/redist/targets/GenerateMSIs.targets @@ -31,11 +31,11 @@ $(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionSdk)$(InstallerExtension) $(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension) - $(IntermediateOutputPath)debian/sdk/ + diff --git a/old/build/package/LinuxNativeInstallerDependencyVersions.targets b/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets similarity index 97% rename from old/build/package/LinuxNativeInstallerDependencyVersions.targets rename to src/redist/targets/LinuxNativeInstallerDependencyVersions.targets index 27acc4fb3..ed5f6bea6 100644 --- a/old/build/package/LinuxNativeInstallerDependencyVersions.targets +++ b/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets @@ -1,5 +1,5 @@ - + $([MSBuild]::Add($(MicrosoftNETCoreAppPackageVersion.IndexOf('.')), 1)) diff --git a/old/packaging/deb/dotnet-debian_config.json b/src/redist/targets/packaging/deb/dotnet-debian_config.json similarity index 100% rename from old/packaging/deb/dotnet-debian_config.json rename to src/redist/targets/packaging/deb/dotnet-debian_config.json diff --git a/old/packaging/deb/postinst b/src/redist/targets/packaging/deb/postinst similarity index 100% rename from old/packaging/deb/postinst rename to src/redist/targets/packaging/deb/postinst