Generate RPM Installer

This commit is contained in:
Daniel Plaisted 2018-11-05 13:38:10 -08:00
parent d2528332b2
commit 24ccfbae1a
13 changed files with 42 additions and 26 deletions

View file

@ -8,6 +8,7 @@
<PackageReference Include="Microsoft.Build" Version="15.7.177" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.7.177" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">

View file

@ -17,5 +17,6 @@
<Import Project="targets\GenerateMSIs.targets" />
<Import Project="targets\LinuxNativeInstallerDependencyVersions.targets" />
<Import Project="targets\GenerateDebs.targets" />
<Import Project="targets\GenerateRPMs.targets" />
</Project>

View file

@ -30,4 +30,6 @@
<UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(CoreSdkTaskDll)" />
<UsingTask TaskName="Chmod" AssemblyFile="$(CoreSdkTaskDll)" />
<UsingTask TaskName="DotNetDebTool" AssemblyFile="$(CoreSdkTaskDll)" />
<UsingTask TaskName="BuildFPMToolPreReqs" AssemblyFile="$(CoreSdkTaskDll)"/>
</Project>

View file

@ -143,14 +143,15 @@
</ItemGroup>
</Target>
<!-- Outer GenerateDebs target so that GetCurrentRuntimeInformation will set IsDebianBasedDistro before target
condition is evaluated -->
<Target Name="GenerateDebsOuter"
<!-- Outer GenerateDebs target so that GetCurrentRuntimeInformation will set IsDebianBasedDistro before
GenerateDebsInner condition is evaluated -->
<Target Name="GenerateDebs"
DependsOnTargets="GetCurrentRuntimeInformation;
GenerateDebs"/>
<!-- Re-enable "TestSdkDeb" when the following issue is resolved: https://github.com/dotnet/cli/issues/9672 -->
<Target Name="GenerateDebs"
<Target Name="GenerateDebsInner"
DependsOnTargets="SetupDebProps;
TestDebuild;
BuildSdkDeb"

View file

@ -0,0 +1,7 @@
<Project>
<Target Name="GenerateInstallers"
DependsOnTargets="GetCurrentRuntimeInformation;
GenerateMsis;
GenerateDebs;"
/>
</Project>

View file

@ -1,29 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<RpmConfigJsonName>rpm_config.json</RpmConfigJsonName>
<TemplatesDir>$(RepoRoot)/packaging/rpm/templates</TemplatesDir>
<ScriptsDir>$(RepoRoot)/packaging/rpm/scripts</ScriptsDir>
<TemplatesDir>$(MSBuildThisFileDirectory)packaging/rpm/templates</TemplatesDir>
<ScriptsDir>$(MSBuildThisFileDirectory)packaging/rpm/scripts</ScriptsDir>
<AfterInstallHostScriptName>after_install_host.sh</AfterInstallHostScriptName>
</PropertyGroup>
<UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(CLIBuildDll)"/>
<UsingTask TaskName="BuildFPMToolPreReqs" AssemblyFile="$(CLIBuildDll)"/>
<PropertyGroup>
<BuildRpmPackage Condition=" '$(IsRPMBasedDistro)' == 'True' ">True</BuildRpmPackage>
</PropertyGroup>
<Target Name="GenerateRpms"
DependsOnTargets="GetCurrentRuntimeInformation;
GenerateRpmsInner" />
<!-- Re-enable "TestSdkRpm" when the following issue is resolved: https://github.com/dotnet/cli/issues/9672 -->
<Target Name="GenerateRpms"
<Target Name="GenerateRpmsInner"
DependsOnTargets="TestFPMTool;BuildRpms"
Condition=" '$(BuildRpmPackage)' == 'True' "
Condition=" '$(IsRPMBasedDistro)' == 'True' "
Outputs="@(GeneratedInstallers)"/>
<Target Name="BuildRpms"
DependsOnTargets="GenerateSdkRpm"
Condition=" '$(BuildRpmPackage)' == 'True' and '$(FPMPresent)' == 'True' "/>
Condition=" '$(IsRPMBasedDistro)' == 'True' and '$(FPMPresent)' == 'True' "/>
<Target Name="GenerateSdkRpm"
DependsOnTargets="SetupRpmProps">
@ -103,12 +100,12 @@
<ItemGroup>
<TestSdkRpmTaskEnvironmentVariables Include="PATH=$(RpmInstalledDirectory)$(PathListSeparator)$(PATH)" />
<TestSdkRpmTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
<!--<TestSdkRpmTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
<TestSdkRpmTaskEnvironmentVariables Include="TEST_PACKAGES=$(TestPackagesDir)" />
<TestSdkRpmTaskEnvironmentVariables Include="PreviousStageProps=$(NextStagePropsPath)" />
<TestSdkRpmTaskEnvironmentVariables Include="PreviousStageProps=$(NextStagePropsPath)" />-->
<!-- Consumed By Publish -->
<GeneratedInstallers Include="$(SdkInstallerFile)" />
<!--<GeneratedInstallers Include="$(SdkInstallerFile)" />-->
</ItemGroup>
<ReplaceFileContents InputFiles="$(AfterInstallHostScriptTemplateFile)"
@ -150,17 +147,22 @@
</Target>
<Target Name="SetupRpmProps" DependsOnTargets="CalculateLinuxNativeInstallerDependencyVersions">
<Target Name="SetupRpmProps"
DependsOnTargets="SetSdkVersionInfo;CalculateLinuxNativeInstallerDependencyVersions;GetCurrentRuntimeInformation;SetupFileExtensions">
<PropertyGroup>
<SdkRpmPackageVersion>$(MajorMinorVersion)</SdkRpmPackageVersion>
<SdkRpmPackageName>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion)</SdkRpmPackageName>
<RuntimeDepsPackageVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeDepsPackageVersion>
<RuntimeDepsPackageFileName>dotnet-runtime-deps-$(RuntimeDepsPackageVersion)</RuntimeDepsPackageFileName>
<RpmPackageVersion>$(SdkVersion)</RpmPackageVersion>
<InputRoot>$(OutputDirectory)/sdk</InputRoot>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
<InputRoot>$(RedistLayoutPath)sdk/</InputRoot>
<SdkInstallerFile>$(ArtifactsShippingPackagesDir)$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
<RpmFile>$(SdkInstallerFile)</RpmFile>
<!-- Need to acquire manpage files from CLI repo: https://github.com/dotnet/cli/issues/10266 -->
<ManPagesDir>$(RepoRoot)/Documentation/manpages</ManPagesDir>
<ConfigJsonFile>$(RepoRoot)/packaging/rpm/dotnet-config.json</ConfigJsonFile>
<RpmIntermediatesDir>$(IntermediateDirectory)/$(RpmPackageName)/$(RpmPackageVersion)</RpmIntermediatesDir>
<ConfigJsonFile>$(MSBuildThisFileDirectory)packaging/rpm/dotnet-config.json</ConfigJsonFile>
<RpmIntermediatesDir>$(IntermediateOutputPath)$(SdkRpmPackageName)/$(RpmPackageVersion)</RpmIntermediatesDir>
<RpmTestResultsXmlFile>$(RpmIntermediatesDir)/debian-testResults.xml</RpmTestResultsXmlFile>
<RpmInstalledDirectory>/usr/share/dotnet</RpmInstalledDirectory>
</PropertyGroup>
@ -175,8 +177,7 @@
</PropertyGroup>
<PropertyGroup>
<SdkRpmPackageVersion>$(MajorMinorVersion)</SdkRpmPackageVersion>
<SdkRpmPackageName>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion)</SdkRpmPackageName>
<SharedFxRpmPackageVersion>$(MicrosoftNETCoreAppMajorMinorVersion)</SharedFxRpmPackageVersion>
<SharedFxRpmPackageFileVersion>$(MicrosoftNETCoreAppPackageVersion)</SharedFxRpmPackageFileVersion>
<SharedFxRpmPackageName>dotnet-runtime-$(SharedFxRpmPackageVersion)</SharedFxRpmPackageName>

View file

@ -37,6 +37,9 @@
<IncludeWpfAndWinForms Condition=" '$(IncludeWpfAndWinForms)' == '' AND '$(OS)' == 'Windows_NT' ">true</IncludeWpfAndWinForms>
<IncludeWpfAndWinForms Condition=" '$(IncludeWpfAndWinForms)' == '' ">false</IncludeWpfAndWinForms>-->
<PathListSeparator>:</PathListSeparator>
<PathListSeparator Condition=" '$(OS)' == 'Windows_NT' ">%3b</PathListSeparator>
</PropertyGroup>
</Target>
</Project>