Create Linux installers for the aspnetcore targeting pack (#7776)

This creates 3 new build outputs:

* aspnetcore-targeting-pack-$(version).tar.gz
* aspnetcore-targeting-pack-$(version)-linux-x64.deb
* aspnetcore-targeting-pack-$(version)-linux-x64.rpm

Other changes:
* Make RPM packaging consistent with other installers. Vendor == Microsoft Corporation
* Add shared properties for building the targeting pack (or not building it in a servicing build)
This commit is contained in:
Nate McMaster 2019-02-25 12:00:36 -08:00 committed by GitHub
parent d48fa09d2b
commit d2d60000eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 417 additions and 202 deletions

View File

@ -162,9 +162,11 @@ jobs:
--arch x64 \
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
--no-restore \
--no-build-deps \
/t:BuildSharedFx \
/p:BuildRuntimeArchive=false \
/p:LinuxInstallerType=deb
/p:LinuxInstallerType=deb \
/bl:artifacts/logs/build.deb.binlog
displayName: Build Debian installers
- script: |
rm -rf .dotnet/
@ -173,9 +175,12 @@ jobs:
--ci --pack --all --no-build-nodejs --no-build-java \
--arch x64 \
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
--no-restore \
--no-build-deps \
/t:BuildSharedFx \
/p:BuildRuntimeArchive=false \
/p:LinuxInstallerType=rpm
/p:LinuxInstallerType=rpm \
/bl:artifacts/logs/build.rpm.binlog
displayName: Build RPM installers
afterBuild:
# Remove packages that are not rid-specific.

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ StyleCop.Cache
node_modules/
*.snk
.nuget
.packages/
.r
.w
.deps

View File

@ -6,7 +6,6 @@
<Authors>Microsoft</Authors>
<Company>Microsoft Corporation.</Company>
<RpmPackageVendor>.NET Foundation</RpmPackageVendor>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>

View File

@ -12,8 +12,8 @@
<FxProjectToBuild Include="$(UnitTestFxProject)" />
<FxProjectToBuild Condition=" '$(BuildRuntimeArchive)' != 'false' " Include="$(RepositoryRoot)src\Installers\Archive\*.*proj" />
<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'deb' " Include="$(RepositoryRoot)src\Installers\Debian\*.*proj" />
<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'rpm' " Include="$(RepositoryRoot)src\Installers\Rpm\*.*proj" />
<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'deb' " Include="$(RepositoryRoot)src\Installers\Debian\**\*.*proj" />
<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'rpm' " Include="$(RepositoryRoot)src\Installers\Rpm\**\*.*proj" />
<FxProjectToBuild Condition=" '$(BuildSiteExtensions)' == 'true' " Include="$(RepositoryRoot)src\SiteExtensions\Runtime\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj" />
<FxProjectToBuild Condition=" '$(BuildSiteExtensions)' == 'true' " Include="$(RepositoryRoot)src\SiteExtensions\LoggingBranch\LoggingBranch.csproj" />

View File

@ -21,6 +21,10 @@ _kill git.exe
_kill vctip.exe
_kill chrome.exe
_kill h2spec.exe
iisreset /restart
_kill WerFault.exe
if (Get-Command iisreset -ErrorAction ignore) {
iisreset /restart
}
Stop-Service w3svc -NoWait -ErrorAction Ignore
exit 0

View File

@ -12,6 +12,10 @@
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsShippingPackage>true</IsShippingPackage>
<IsPackable>true</IsPackable>
<IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable>
<PackageId>$(TargetingPackName)</PackageId>
<PackageVersion>$(TargetingPackVersion)</PackageVersion>
<PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains reference assemblies, documentation, and other design-time assets.
This package is an internal implementation of the .NET Core SDK and is not meant to be used as a normal PackageReference.</PackageDescription>
@ -22,7 +26,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>
<LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/</LayoutTargetDir>
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
<ArchiveOutputFileName Condition="'$(TargetRuntimeIdentifier)' == 'win-x64'">aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
<ArchiveOutputFileName Condition="'$(TargetRuntimeIdentifier)' == 'linux-x64'">aspnetcore-targeting-pack-$(PackageVersion).tar.gz</ArchiveOutputFileName>
<ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>
<!-- There are no symbols for reference assemblies. -->
@ -54,7 +59,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<BuildDependsOn>
<!-- If this project won't produce a package, don't bother building anything. -->
<BuildDependsOn Condition="'$(IsPackable)' != 'false'">
$(BuildDependsOn);
GeneratePackageConflictManifest;
_ResolveTargetingPackContent;
@ -65,9 +71,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->
<Target Name="GetTargetPath" />
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)">
<Message Importance="High" Text="$(MSBuildProjectName) -> $(TargetDir)" />
</Target>
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
<!-- This project doesn't compile anything. -->
<Target Name="CoreCompile" />
@ -115,20 +119,25 @@ This package is an internal implementation of the .NET Core SDK and is not meant
DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
<Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(LayoutTargetDir)" />
</Target>
<Target Name="_CreateTargetingPackArchive"
Inputs="@(RefPackContent)"
Outputs="$(ArchiveOutputPath)"
Condition="'$(IsPackable)' != 'false'">
Outputs="$(ArchiveOutputPath)">
<ZipDirectory
SourceDirectory="$(TargetingPackLayoutRoot)"
DestinationFile="$(ArchiveOutputPath)"
Overwrite="true" />
Overwrite="true"
Condition="'$(TargetRuntimeIdentifier)' == 'win-x64'" />
<Exec
Command="tar -czf $(ArchiveOutputPath) ."
WorkingDirectory="$(TargetingPackLayoutRoot)"
Condition="'$(TargetRuntimeIdentifier)' == 'linux-x64'" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(ArchiveOutputPath)" />
</Target>
</Project>

View File

@ -12,7 +12,6 @@
<RuntimeIdentifier>$(TargetRuntimeIdentifier)</RuntimeIdentifier>
<!-- Even though RuntimeIdentifier is set, shared framework projects are not self-contained projects -->
<SelfContained>false</SelfContained>
<SharedFxName>Microsoft.AspNetCore.App</SharedFxName>
<PackageId>$(MSBuildProjectName).$(RuntimeIdentifier)</PackageId>
<IsShippingPackage>true</IsShippingPackage>
<HasReferenceAssembly>false</HasReferenceAssembly>

View File

@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<OutputInRepoRoot>true</OutputInRepoRoot>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
<UsingTask Condition=" '$(BuildToolsTaskAssembly)' != '' AND Exists('$(BuildToolsTaskAssembly)') " TaskName="Microsoft.AspNetCore.BuildTools.GenerateFileFromTemplate" AssemblyFile="$(BuildToolsTaskAssembly)" />
<PropertyGroup>
<OutputPath>$(InstallersOutputPath)</OutputPath>
<IntermediateOutputPath>$(IntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
<!-- Must be named "package_root/". This is expected by the build.sh script in the tools folder. -->
<IntermediatePackageRoot>$(IntermediateOutputPath)package_root\</IntermediatePackageRoot>
<!-- Installer settings -->
<DebianPackageInstallRoot>/usr/share/dotnet</DebianPackageInstallRoot>
<DebianPackageArch Condition=" '$(TargetArchitecture)' == 'x64' ">amd64</DebianPackageArch>
<DebianBuildScript>$(MSBuildThisFileDirectory)tools/build.sh</DebianBuildScript>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,58 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />
<PropertyGroup>
<TargetPath>$(OutputPath)$(TargetFileName)</TargetPath>
<DebBuildDependsOn>
$(DebBuildDependsOn);
PrepareForBuild;
ResolveProjectReferences;
GetTargetPath;
</DebBuildDependsOn>
</PropertyGroup>
<Target Name="PrepareForBuild">
<Error Text="Currently only linux-x64 is supported by Debian installers." Condition=" '$(TargetRuntimeIdentifier)' != 'linux-x64' " />
<MakeDir Directories="$(IntermediateOutputPath);$(IntermediatePackageRoot);$(OutputPath)" />
</Target>
<Target Name="GetTargetPath" Returns="$(TargetPath)" />
<Target Name="Build" DependsOnTargets="DebBuild" />
<Target Name="DebBuild" DependsOnTargets="$(DebBuildDependsOn)">
<!-- Generate debian_config.json. We can't simply use WriteLinesToFile because of https://github.com/Microsoft/msbuild/issues/1622. Use our custom GenerateFileFromTemplate task instead -->
<PropertyGroup>
<DebianConfigProperties>
$(DebianConfigProperties);
AspNetCoreMajorVersion=$(AspNetCoreMajorVersion);
AspNetCoreMinorVersion=$(AspNetCoreMinorVersion);
Authors=$(Authors);
DebianPackageInstallRoot=$(DebianPackageInstallRoot);
MaintainerEmail=$(MaintainerEmail);
PackageId=$(PackageId);
PackageLicenseType=$(PackageLicenseType);
PackageProjectUrl=$(PackageProjectUrl);
PackageRevision=$(PackageRevision);
PackageVersion=$(PackageVersion);
PackageSummary=$(PackageSummary);
PackageDescription=$(PackageDescription);
</DebianConfigProperties>
</PropertyGroup>
<GenerateFileFromTemplate TemplateFile="debian_config.json.in"
Properties="$(DebianConfigProperties)"
OutputPath="$(IntermediateOutputPath)debian_config.json" />
<!-- Build SharedFx Bundle Deb package -->
<Exec Command="$(DebianBuildScript) -i '$(IntermediateOutputPath)' -o '$(IntermediateOutputPath)out/'" />
<PropertyGroup>
<BuildScriptOutputFileName>$(PackageId)_$(PackageVersion)-$(PackageRevision)_$(DebianPackageArch).deb</BuildScriptOutputFileName>
</PropertyGroup>
<Copy SourceFiles="$(IntermediateOutputPath)out/$(BuildScriptOutputFileName)" DestinationFiles="$(TargetPath)" />
</Target>
</Project>

View File

@ -1,105 +0,0 @@
<!--
This project produces a debian installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<UsingTask Condition=" '$(BuildToolsTaskAssembly)' != '' AND Exists('$(BuildToolsTaskAssembly)') " TaskName="Microsoft.AspNetCore.BuildTools.GenerateFileFromTemplate" AssemblyFile="$(BuildToolsTaskAssembly)" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<!-- Output paths -->
<PropertyGroup>
<BaseIntermediateOutputPath>$(ArtifactsObjDir)Debian\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
<!-- Must be named "package_root/". This is expected by the build.sh script in this project. -->
<IntermediatePackageRoot>$(IntermediateOutputPath)package_root\</IntermediatePackageRoot>
<OutputFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.deb</OutputFileName>
<OutputPath>$(InstallersOutputPath)</OutputPath>
<TargetPath>$(InstallersOutputPath)$(OutputFileName)</TargetPath>
</PropertyGroup>
<!-- Installer settings -->
<PropertyGroup>
<DebianPackageInstallRoot>/usr/share/dotnet</DebianPackageInstallRoot>
</PropertyGroup>
<!-- Installer versions -->
<PropertyGroup>
<!-- CLI would take a dependency such as 'aspnetcore-runtime-M.N >= M.N.P'. Here M.N is part of the id and M.N.P is the PackageVersion -->
<PackageId>$(RuntimeInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<!-- PackageVersion does not match the ASP.NET Core runtime verison. -->
<PackageVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</PackageVersion>
<!-- Deb installers are versioned as M.N.P~PreReleaseLabel-Build following the core-setup convention -->
<PackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(PackageVersion)~$(PreReleaseLabel)-$(BuildNumberSuffix)</PackageVersion>
<PackageRevision>1</PackageRevision>
<!-- Needed some creativity to convert the PackageVersion M.N.P-PreReleaseLabel-Build to the installer version M.N.P~PreReleaseLabel-Build, The conditional handles stabilized builds -->
<DotnetRuntimeDependencyVersion>$(MicrosoftNETCoreAppPackageVersion)</DotnetRuntimeDependencyVersion>
<DotnetRuntimeDependencyVersion Condition="$(DotnetRuntimeDependencyVersion.Contains('-'))">$(DotnetRuntimeDependencyVersion.Substring(0, $(DotnetRuntimeDependencyVersion.IndexOf('-'))))~$(DotnetRuntimeDependencyVersion.Substring($([MSBuild]::Add($(DotnetRuntimeDependencyVersion.IndexOf('-')), 1))))</DotnetRuntimeDependencyVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Target Name="GetTargetPath" Returns="$(TargetPath)" />
<Target Name="PrepareForBuild">
<Error Text="Currently only linux-x64 is supported by Debian installers." Condition=" '$(TargetRuntimeIdentifier)' != 'linux-x64' " />
<MakeDir Directories="$(IntermediateOutputPath);$(IntermediatePackageRoot);$(OutputPath)" />
</Target>
<Target Name="Build" DependsOnTargets="PrepareForBuild;ResolveProjectReferences;GetTargetPath">
<!-- Layout files in package_root/ for the build.sh script. -->
<ItemGroup>
<SharedFxAssetFolder Include="%(_ResolvedFxProjects.InstallerAssetPaths)" SharedFxName="%(_ResolvedFxProjects.SharedFxName)" />
<PackageFiles Include="%(SharedFxAssetFolder.Identity)\**\*">
<DestinationDir>$(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\</DestinationDir>
</PackageFiles>
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)" DestinationFiles="@(PackageFiles->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')" />
<!-- Generate debian_config.json. We can't simply use WriteLinesToFile because of https://github.com/Microsoft/msbuild/issues/1622. Use our custom GenerateFileFromTemplate task instead -->
<PropertyGroup>
<DebianConfigProperties>
AspNetCoreMajorVersion=$(AspNetCoreMajorVersion);
AspNetCoreMinorVersion=$(AspNetCoreMinorVersion);
Authors=$(Authors);
DebianPackageInstallRoot=$(DebianPackageInstallRoot);
DotnetRuntimeDependencyVersion=$(DotnetRuntimeDependencyVersion);
MaintainerEmail=$(MaintainerEmail);
PackageId=$(PackageId);
PackageLicenseType=$(PackageLicenseType);
PackageProjectUrl=$(PackageProjectUrl);
PackageRevision=$(PackageRevision);
PackageVersion=$(PackageVersion);
SharedFxDescription=$(SharedFxDescription);
SharedFxProductName=$(SharedFxProductName);
</DebianConfigProperties>
</PropertyGroup>
<GenerateFileFromTemplate TemplateFile="debian_config.json.in"
Properties="$(DebianConfigProperties)"
OutputPath="$(IntermediateOutputPath)debian_config.json" />
<!-- Build SharedFx Bundle Deb package -->
<Exec Command="./build.sh -i '$(IntermediateOutputPath)' -o '$(IntermediateOutputPath)out/'" />
<PropertyGroup>
<DebArch Condition=" '$(TargetArchitecture)' == 'x64' ">amd64</DebArch>
<BuildScriptOutputFileName>$(PackageId)_$(PackageVersion)-$(PackageRevision)_$(DebArch).deb</BuildScriptOutputFileName>
</PropertyGroup>
<Copy SourceFiles="$(IntermediateOutputPath)out/$(BuildScriptOutputFileName)" DestinationFiles="$(TargetPath)" />
</Target>
</Project>

View File

@ -0,0 +1,56 @@
<!--
This project produces a debian installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.deb</TargetFileName>
<!-- CLI would take a dependency such as 'aspnetcore-runtime-M.N >= M.N.P'. Here M.N is part of the id and M.N.P is the PackageVersion -->
<PackageId>$(RuntimeInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<!-- PackageVersion does not match the ASP.NET Core runtime verison. -->
<PackageVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</PackageVersion>
<!-- Deb installers are versioned as M.N.P~PreReleaseLabel-Build following the core-setup convention -->
<PackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(PackageVersion)~$(VersionSuffix)</PackageVersion>
<PackageRevision>1</PackageRevision>
<!-- Needed some creativity to convert the PackageVersion M.N.P-PreReleaseLabel-Build to the installer version M.N.P~PreReleaseLabel-Build, The conditional handles stabilized builds -->
<DotnetRuntimeDependencyVersion>$(MicrosoftNETCoreAppPackageVersion)</DotnetRuntimeDependencyVersion>
<DotnetRuntimeDependencyVersion Condition="$(DotnetRuntimeDependencyVersion.Contains('-'))">$(DotnetRuntimeDependencyVersion.Substring(0, $(DotnetRuntimeDependencyVersion.IndexOf('-'))))~$(DotnetRuntimeDependencyVersion.Substring($([MSBuild]::Add($(DotnetRuntimeDependencyVersion.IndexOf('-')), 1))))</DotnetRuntimeDependencyVersion>
<PackageSummary>$(SharedFxProductName)</PackageSummary>
<PackageDescription>$(SharedFxDescription)</PackageDescription>
<DebianConfigProperties>
DotnetRuntimeDependencyVersion=$(DotnetRuntimeDependencyVersion);
</DebianConfigProperties>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<PropertyGroup>
<DebBuildDependsOn>$(DebBuildDependsOn);LayoutSharedFramework</DebBuildDependsOn>
</PropertyGroup>
<Target Name="LayoutSharedFramework" DependsOnTargets="PrepareForBuild;ResolveProjectReferences">
<!-- Layout files in package_root/ for the build.sh script. -->
<ItemGroup>
<SharedFxAssetFolder Include="%(_ResolvedFxProjects.InstallerAssetPaths)" SharedFxName="%(_ResolvedFxProjects.SharedFxName)" />
<PackageFiles Include="%(SharedFxAssetFolder.Identity)\**\*" Condition="'%(SharedFxAssetFolder.Identity)' != ''">
<DestinationDir>$(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\</DestinationDir>
</PackageFiles>
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)"
DestinationFiles="@(PackageFiles->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
</Target>
</Project>

View File

@ -5,8 +5,8 @@
"package_name": "${PackageId}",
"install_root": "${DebianPackageInstallRoot}",
"short_description": "${SharedFxProductName}",
"long_description": "${SharedFxDescription}",
"short_description": "${PackageSummary}",
"long_description": "${PackageDescription}",
"homepage": "${PackageProjectUrl}",
"release":{

View File

@ -0,0 +1,47 @@
<!--
This project produces a debian installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion).deb</TargetFileName>
<!-- CLI would take a dependency such as 'aspnetcore-targeting-pack-M.N >= M.N.P'. Here M.N is part of the id and M.N.P is the PackageVersion -->
<PackageId>$(TargetingPackInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<PackageVersion>$(TargetingPackVersionPrefix)</PackageVersion>
<!-- Deb installers are versioned as M.N.P~PreReleaseLabel-Build following the core-setup convention -->
<PackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(PackageVersion)~$(VersionSuffix)</PackageVersion>
<PackageRevision>1</PackageRevision>
<PackageSummary>ASP.NET Core Targeting Pack</PackageSummary>
<PackageDescription>Provides a default set of APIs for building an ASP.NET Core $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) application. Contains reference assemblies, documentation, and other design-time assets.</PackageDescription>
</PropertyGroup>
<ItemGroup>
<!-- This is here to enforce build order. -->
<ProjectReference Include="..\..\..\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<PropertyGroup>
<DebBuildDependsOn>$(DebBuildDependsOn);LayoutTargetingPack</DebBuildDependsOn>
<!-- Suppresses building this project completely during servicing builds. -->
<DebBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
</PropertyGroup>
<Target Name="LayoutTargetingPack" DependsOnTargets="PrepareForBuild;ResolveProjectReferences">
<!-- Layout files in package_root/ for the build.sh script. -->
<ItemGroup>
<PackageFiles Include="$(TargetingPackLayoutRoot)**\*" />
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)"
DestinationFolder="$(IntermediatePackageRoot)"
UseHardlinksIfPossible="true" />
</Target>
</Project>

View File

@ -0,0 +1,30 @@
{
"maintainer_name": "${Authors}",
"maintainer_email": "${MaintainerEmail}",
"package_name": "${PackageId}",
"install_root": "${DebianPackageInstallRoot}",
"short_description": "${PackageSummary}",
"long_description": "${PackageDescription}",
"homepage": "${PackageProjectUrl}",
"release":{
"package_version":"${PackageVersion}",
"package_revision":"${PackageRevision}",
"urgency" : "low",
"changelog_message" : ""
},
"control": {
"priority":"standard",
"section":"devel",
"architecture":"any"
},
"copyright": "Microsoft",
"license": {
"type": "${PackageLicenseType}",
"full_text": "Copyright (c) .NET Foundation. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthese files except in compliance with the License. You may obtain a copy of the\nLicense at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License."
}
}

View File

@ -4,6 +4,7 @@
<PropertyGroup>
<RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName>
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>
<!-- Name = aspnet-runtime-internal for files are only produced so we can hand them off to the dotnet/cli repo. -->
<InternalInstallerBaseName>$(RuntimeInstallerBaseName)-internal</InternalInstallerBaseName>

View File

@ -0,0 +1,18 @@
<!--
Common properties for building RPM installers.
-->
<Project>
<PropertyGroup>
<OutputInRepoRoot>true</OutputInRepoRoot>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
<!-- Output paths -->
<PropertyGroup>
<IntermediateOutputPath>$(IntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
<OutputPath>$(InstallersOutputPath)</OutputPath>
</PropertyGroup>
</Project>

View File

@ -2,17 +2,17 @@
Common targets for building RPM.
-->
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />
<UsingTask Condition=" '$(BuildToolsTaskAssembly)' != '' AND Exists('$(BuildToolsTaskAssembly)') " TaskName="Microsoft.AspNetCore.BuildTools.GenerateFileFromTemplate" AssemblyFile="$(BuildToolsTaskAssembly)" />
<UsingTask Condition=" '$(BuildToolsTaskAssembly)' != '' AND Exists('$(BuildToolsTaskAssembly)') " TaskName="Microsoft.AspNetCore.BuildTools.Run" AssemblyFile="$(BuildToolsTaskAssembly)" />
<!-- Output paths -->
<PropertyGroup>
<RpmPackageInstallRoot Condition="'$(RpmPackageInstallRoot)' != '' AND !HasTrailingSlash('$(RpmPackageInstallRoot)')">$(RpmPackageInstallRoot)/</RpmPackageInstallRoot>
<TargetPath>$(InstallersOutputPath)$(OutputFileName)</TargetPath>
<TargetPath>$(InstallersOutputPath)$(TargetFileName)</TargetPath>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Target Name="GetTargetPath" Returns="$(TargetPath)" />
<Target Name="PrepareForBuild">
@ -21,19 +21,21 @@
<Error Text="Currently only linux-x64 is supported by Rpm installers." Condition=" '$(TargetRuntimeIdentifier)' != 'linux-x64' " />
<Error Text="Missing required property: RpmPackageInstallRoot" Condition=" '$(RpmPackageInstallRoot)' == '' " />
<Error Text="Missing required property: IntermediatePackageRoot" Condition=" '$(IntermediatePackageRoot)' == '' " />
</Target>
<Target Name="Build" DependsOnTargets="PrepareForBuild;ResolveProjectReferences;GetTargetPath">
<!-- Layout files in package_root/ for the build.sh script. -->
<ItemGroup>
<SharedFxAssetFolder Include="%(_ResolvedFxProjects.InstallerAssetPaths)" SharedFxName="%(_ResolvedFxProjects.SharedFxName)" />
<PackageFiles Include="%(SharedFxAssetFolder.Identity)\**\*">
<DestinationDir>$(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\</DestinationDir>
</PackageFiles>
</ItemGroup>
<PropertyGroup>
<RpmBuildDependsOn>
$(RpmBuildDependsOn);
PrepareForBuild;
ResolveProjectReferences;
GetTargetPath;
</RpmBuildDependsOn>
</PropertyGroup>
<Copy SourceFiles="@(PackageFiles)" DestinationFiles="@(PackageFiles->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')" />
<Target Name="Build" DependsOnTargets="RpmBuild" />
<Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)">
<!-- Create layout: Create changelog -->
<PropertyGroup>
<ChangeLogProps>DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))</ChangeLogProps>
@ -63,10 +65,10 @@
<FpmArgs Include="--architecture;$(RpmArch)" />
<FpmArgs Include="--depends;%(RpmDependency.Identity) &gt;= %(RpmDependency.Version)" Condition=" '%(RpmDependency.Identity)' != '' " />
<FpmArgs Include="--rpm-changelog;$(GeneratedChangeLog)" />
<FpmArgs Include="--rpm-summary;$(SharedFxProductName)" />
<FpmArgs Include="--description;$(SharedFxDescription)" />
<FpmArgs Include="--rpm-summary;$(PackageSummary)" />
<FpmArgs Include="--description;$(PackageDescription)" />
<FpmArgs Include="--maintainer;$(Authors) &lt;$(MaintainerEmail)&gt;" />
<FpmArgs Include="--vendor;$(RpmPackageVendor)" />
<FpmArgs Include="--vendor;$(Company)" />
<FpmArgs Include="--license;$(PackageLicenseType)" />
<FpmArgs Include="--url;$(PackageProjectUrl)" />
<FpmArgs Include="--directories;%(InstallerOwnedDirectory.Identity)" Condition=" '%(InstallerOwnedDirectory.Identity)' != '' " />

View File

@ -0,0 +1,47 @@
<!-- This file is for properties shared by the generic aspnetcore-runtime rpm and RHEL rpm. -->
<Project>
<PropertyGroup>
<!-- installer versions -->
<!-- CLI would take a dependency such as 'aspnetcore-runtime-M.N >= M.N.P'. Here M.N is the part of the id and M.N.P is the package version -->
<PackageId>$(RuntimeInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<PackageVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</PackageVersion>
<!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases -->
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' != 'true' ">1</PackageRevision>
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">0.1.$(VersionSuffix.Replace('-', '_'))</PackageRevision>
<PackageSummary>$(SharedFxProductName)</PackageSummary>
<PackageDescription>$(SharedFxDescription)</PackageDescription>
<IntermediatePackageRoot>$(IntermediateOutputPath)content\</IntermediatePackageRoot>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference>
<InstallerOwnedDirectory Include="$(RpmPackageInstallRoot)shared/Microsoft.AspNetCore.App" />
<RpmDependency Include="dotnet-runtime-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)" Version="$(MicrosoftNETCoreAppPackageVersion.Split('-')[0])" />
</ItemGroup>
<PropertyGroup>
<RpmBuildDependsOn>$(RpmBuildDependsOn);LayoutSharedFramework;</RpmBuildDependsOn>
</PropertyGroup>
<Target Name="LayoutSharedFramework" DependsOnTargets="PrepareForBuild;ResolveProjectReferences">
<ItemGroup>
<SharedFxAssetFolder Include="%(_ResolvedFxProjects.InstallerAssetPaths)" SharedFxName="%(_ResolvedFxProjects.SharedFxName)" />
<PackageFiles Include="%(SharedFxAssetFolder.Identity)\**\*">
<DestinationDir>$(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\</DestinationDir>
</PackageFiles>
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)"
DestinationFiles="@(PackageFiles->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
</Target>
</Project>

View File

@ -1,37 +0,0 @@
<!--
Common properties for building RPM installers.
-->
<Project>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<!-- Output paths -->
<PropertyGroup>
<BaseIntermediateOutputPath>$(ArtifactsObjDir)Rpm\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
<IntermediatePackageRoot>$([MSBuild]::NormalizeDirectory('$(IntermediateOutputPath)content/'))</IntermediatePackageRoot>
<OutputPath>$(InstallersOutputPath)</OutputPath>
</PropertyGroup>
<PropertyGroup>
<!-- installer versions -->
<!-- CLI would take a dependency such as 'aspnetcore-runtime-M.N >= M.N.P'. Here M.N is the part of the id and M.N.P is the package version -->
<PackageId>$(RuntimeInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<PackageVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</PackageVersion>
<!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases -->
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' != 'true' ">1</PackageRevision>
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">0.1.$(PreReleaseLabel)_$(BuildNumber.Replace('-', '_'))</PackageRevision>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference>
<InstallerOwnedDirectory Include="$(RpmPackageInstallRoot)shared/Microsoft.AspNetCore.App" />
<RpmDependency Include="dotnet-runtime-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)" Version="$(MicrosoftNETCoreAppPackageVersion.Split('-')[0])" />
</ItemGroup>
</Project>

View File

@ -1,13 +0,0 @@
<!--
This project produces a generic RPM installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="Rpm.props" />
<PropertyGroup>
<RpmPackageInstallRoot>/usr/share/dotnet/</RpmPackageInstallRoot>
<OutputFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.rpm</OutputFileName>
</PropertyGroup>
<Import Project="Rpm.targets" />
</Project>

View File

@ -1,13 +0,0 @@
<!--
This project produces a RPM RHEL.7 installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="Rpm.props" />
<PropertyGroup>
<RpmPackageInstallRoot>/opt/rh/rh-dotnet20/root/usr/lib64/dotnet/</RpmPackageInstallRoot>
<OutputFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-rh.rhel.7-x64.rpm</OutputFileName>
</PropertyGroup>
<Import Project="Rpm.targets" />
</Project>

View File

@ -0,0 +1,15 @@
<!--
This project produces a RPM RHEL.7 installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<RpmPackageInstallRoot>/opt/rh/rh-dotnet20/root/usr/lib64/dotnet/</RpmPackageInstallRoot>
<TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-rh.rhel.7-x64.rpm</TargetFileName>
</PropertyGroup>
<Import Project="..\Rpm.Runtime.Common.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project>

View File

@ -0,0 +1,15 @@
<!--
This project produces a generic RPM installer for Linux x64 platforms only.
-->
<Project DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<RpmPackageInstallRoot>/usr/share/dotnet/</RpmPackageInstallRoot>
<TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.rpm</TargetFileName>
</PropertyGroup>
<Import Project="..\Rpm.Runtime.Common.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project>

View File

@ -0,0 +1,38 @@
<Project DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<RpmPackageInstallRoot>/usr/share/dotnet/</RpmPackageInstallRoot>
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-x64.rpm</TargetFileName>
<IntermediatePackageRoot>$(TargetingPackLayoutRoot)</IntermediatePackageRoot>
<!-- installer versions -->
<!-- CLI would take a dependency such as 'aspnetcore-targeting-pack-M.N >= M.N.P'. Here M.N is the part of the id and M.N.P is the package version -->
<PackageId>$(TargetingPackInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
<PackageVersion>$(TargetingPackVersionPrefix)</PackageVersion>
<!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases -->
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' != 'true' ">1</PackageRevision>
<PackageRevision Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">0.1.$(VersionSuffix.Replace('-', '_'))</PackageRevision>
<PackageSummary>ASP.NET Core Targeting Pack</PackageSummary>
<PackageDescription>Provides a default set of APIs for building an ASP.NET Core $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) application. Contains reference assemblies, documentation, and other design-time assets.</PackageDescription>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
</ProjectReference>
<InstallerOwnedDirectory Include="$(RpmPackageInstallRoot)packs/$(TargetingPackName)/" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<PropertyGroup>
<!-- Suppresses building this project completely during servicing builds. -->
<RpmBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
</PropertyGroup>
</Project>

View File

@ -6,7 +6,7 @@
<PropertyGroup>
<Name>AspNetCoreTargetingPack</Name>
<OutputName>aspnetcore-targeting-pack-$(PackageVersion)-win-$(Platform)</OutputName>
<OutputName>$(TargetingPackInstallerBaseName)-$(PackageVersion)-win-$(Platform)</OutputName>
<OutputType>Package</OutputType>
<IsProductInstaller>true</IsProductInstaller>
<ProjectGuid>0AC34F1B-8056-4FFB-A398-E6BB7D67B48D</ProjectGuid>
@ -64,4 +64,9 @@
</Target>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
<PropertyGroup>
<!-- Suppresses building this project completely during servicing builds. -->
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
</PropertyGroup>
</Project>

View File

@ -65,8 +65,19 @@
<PackageVersion>$(VersionPrefix)</PackageVersion>
<PackageVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<SharedFxName>Microsoft.AspNetCore.App</SharedFxName>
<SharedFxVersion>$(PackageVersion)</SharedFxVersion>
<TargetingPackName>Microsoft.AspNetCore.App.Ref</TargetingPackName>
<!-- TargetingPackVersionPrefix is used by projects, like .deb and .rpm, which use slightly different version formats. -->
<TargetingPackVersionPrefix>$(VersionPrefix)</TargetingPackVersionPrefix>
<!-- Targeting packs do not produce patch versions in servicing builds. No API changes are allowed in patches. -->
<TargetingPackVersionPrefix Condition="'$(IsServicingBuild)' == 'true'">$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0</TargetingPackVersionPrefix>
<TargetingPackVersion>$(TargetingPackVersionPrefix)</TargetingPackVersion>
<TargetingPackVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(TargetingPackVersionPrefix)-$(VersionSuffix)</TargetingPackVersion>
<!-- Used to only produce targeting pack installers/packages once per major.minor. -->
<IsTargetingPackBuilding Condition="'$(IsServicingBuild)' == 'true' AND '$(DotNetBuildFromSource)' != 'true'">false</IsTargetingPackBuilding>
<!-- Experimental packages which are not truly supported yet. -->
<ExperimentalPackageVersion>$(ExperimentalVersionPrefix)</ExperimentalPackageVersion>
<ExperimentalPackageVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(ExperimentalVersionPrefix)-$(VersionSuffix)</ExperimentalPackageVersion>