-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Linux installers for the aspnetcore targeting pack #7776
Changes from 8 commits
251eb7c
05336ea
a0a711e
0dd62be
3278888
8ce85c2
398e503
f99ee67
d2dc446
d1b7de3
3f4e99e
cda22b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why isn't this defined in some common location? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the Linux installer projects use these tasks directly. |
||
|
||
<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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is completely duplicated in between both installer projects. Worth to move to common targets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Figured it wasn't worth de-duplicating because it will be deleted in #7832 anyways. |
||
<!-- 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Fortunately, the command only writes to
stdout
when process lacks admin rights.