-
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 all 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ StyleCop.Cache | |
node_modules/ | ||
*.snk | ||
.nuget | ||
.packages/ | ||
.r | ||
.w | ||
.deps | ||
|
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.
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.