Skip to content

Add option for only packing runtime-specific packages #11116

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

Merged
merged 7 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 24 additions & 48 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
-NoRestore
-BuildNative
/t:BuildSharedFx
/p:OnlyPackPlatformSpecificPackages=true
/p:DisableCodeSigning=true
/bl:artifacts/log/build.x86.binlog
$(_BuildArgs)
Expand Down Expand Up @@ -151,15 +152,12 @@ jobs:
buildArgs: -arch arm
-NoBuildNodeJS
-NoBuildJava
/p:OnlyPackPlatformSpecificPackages=true
/p:SignType=$(_SignType)
/bl:artifacts/log/build.win-arm.binlog
$(_BuildArgs)
installNodeJs: false
installJdk: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so builds only produce runtime packages
- powershell: gci artifacts/packages/ -recurse -exclude 'runtime.*', 'Microsoft.AspNetCore.App.Runtime.*' -file | rm -ea ignore
artifacts:
- name: Windows_arm_Packages
path: artifacts/packages/
Expand All @@ -180,14 +178,10 @@ jobs:
buildScript: ./eng/scripts/cibuild.sh
buildArgs: --no-build-nodejs
--no-build-java
/bl:artifacts/log/build.macos.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.macos.binlog
$(_BuildArgs)
installNodeJs: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: MacOS_x64_Packages
path: artifacts/packages/
Expand All @@ -214,7 +208,8 @@ jobs:
--arch x64
--no-build-nodejs
--no-build-java
/bl:artifacts/log/build.linux-x64.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.linux-x64.binlog
$(_BuildArgs)
displayName: Run cibuild.sh
- script: |
Expand All @@ -226,10 +221,11 @@ jobs:
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
--no-restore \
--no-build-deps \
/t:BuildSharedFx \
/p:BuildRuntimeArchive=false \
/p:LinuxInstallerType=deb \
/bl:artifacts/log/build.deb.binlog \
-t:BuildSharedFx \
-p:OnlyPackPlatformSpecificPackages=true \
-p:BuildRuntimeArchive=false \
-p:LinuxInstallerType=deb \
-bl:artifacts/log/build.deb.binlog \
$(_BuildArgs)
displayName: Build Debian installers
- script: |
Expand All @@ -241,17 +237,13 @@ jobs:
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
--no-restore \
--no-build-deps \
/t:BuildSharedFx \
/p:BuildRuntimeArchive=false \
/p:LinuxInstallerType=rpm \
/bl:artifacts/log/build.rpm.binlog \
-t:BuildSharedFx \
-p:OnlyPackPlatformSpecificPackages=true \
-p:BuildRuntimeArchive=false \
-p:LinuxInstallerType=rpm \
-bl:artifacts/log/build.rpm.binlog \
$(_BuildArgs)
displayName: Build RPM installers
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: Linux_x64_Packages
path: artifacts/packages/
Expand All @@ -276,14 +268,10 @@ jobs:
buildArgs: --arch arm
--no-build-nodejs
--no-build-java
/bl:artifacts/log/build.linux-arm.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.linux-arm.binlog
$(_BuildArgs)
installNodeJs: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: Linux_arm_Packages
path: artifacts/packages/
Expand All @@ -308,14 +296,10 @@ jobs:
buildArgs: --arch arm64
--no-build-nodejs
--no-build-java
/bl:artifacts/log/build.arm64.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.arm64.binlog
$(_BuildArgs)
installNodeJs: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: Linux_arm64_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -345,14 +329,10 @@ jobs:
--os-name linux-musl
--no-build-nodejs
--no-build-java
/bl:artifacts/log/build.musl.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.musl.binlog
$(_BuildArgs)
installNodeJs: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: Linux_musl_x64_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -382,14 +362,10 @@ jobs:
--os-name linux-musl
--no-build-nodejs
--no-build-java
/bl:artifacts/log/build.musl.binlog
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.musl.binlog
$(_BuildArgs)
installNodeJs: false
afterBuild:
# Remove packages that are not rid-specific.
# TODO add a flag so macOS/Linux builds only produce runtime packages
- script: if [ -d 'artifacts/packages' ]; then find artifacts/packages/ -type f -not -name 'runtime.*' -not -name 'Microsoft.AspNetCore.App.Runtime.*' -delete; fi
condition: always()
artifacts:
- name: Linux_musl_arm64_Packages
path: artifacts/packages/
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<Project>

<PropertyGroup>
<!-- When OnlyPackPlatformSpecificPackages is set, only produce packages for projects which set RuntimeIdentifier. -->
<IsPackable Condition=" '$(OnlyPackPlatformSpecificPackages)' == 'true' AND '$(IsPackable)' != 'false' AND '$(RuntimeIdentifier)' == '' ">false</IsPackable>

<!--
By default, all projects which produce packages are not intended to ship to NuGet.org as a product package.
Packages which are intended to ship to NuGet.org must opt-in by setting this to true in the project file.
Expand Down
1 change: 0 additions & 1 deletion eng/ProjectReferences.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Identity.UI" ProjectPath="$(RepoRoot)src\Identity\UI\src\Microsoft.AspNetCore.Identity.UI.csproj" RefProjectPath="$(RepoRoot)src\Identity\UI\ref\Microsoft.AspNetCore.Identity.UI.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Connections.Abstractions" ProjectPath="$(RepoRoot)src\Servers\Connections.Abstractions\src\Microsoft.AspNetCore.Connections.Abstractions.csproj" RefProjectPath="$(RepoRoot)src\Servers\Connections.Abstractions\ref\Microsoft.AspNetCore.Connections.Abstractions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Server.HttpSys" ProjectPath="$(RepoRoot)src\Servers\HttpSys\src\Microsoft.AspNetCore.Server.HttpSys.csproj" RefProjectPath="$(RepoRoot)src\Servers\HttpSys\ref\Microsoft.AspNetCore.Server.HttpSys.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ANCMSymbols" ProjectPath="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\Symbols\Microsoft.AspNetCore.ANCMSymbols.csproj" RefProjectPath="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\ref\Microsoft.AspNetCore.ANCMSymbols.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Server.IISIntegration" ProjectPath="$(RepoRoot)src\Servers\IIS\IISIntegration\src\Microsoft.AspNetCore.Server.IISIntegration.csproj" RefProjectPath="$(RepoRoot)src\Servers\IIS\IISIntegration\ref\Microsoft.AspNetCore.Server.IISIntegration.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Server.IIS" ProjectPath="$(RepoRoot)src\Servers\IIS\IIS\src\Microsoft.AspNetCore.Server.IIS.csproj" RefProjectPath="$(RepoRoot)src\Servers\IIS\IIS\ref\Microsoft.AspNetCore.Server.IIS.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Server.Kestrel.Core" ProjectPath="$(RepoRoot)src\Servers\Kestrel\Core\src\Microsoft.AspNetCore.Server.Kestrel.Core.csproj" RefProjectPath="$(RepoRoot)src\Servers\Kestrel\Core\ref\Microsoft.AspNetCore.Server.Kestrel.Core.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions eng/targets/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<Target Name="_GetPackageVersionInfo" DependsOnTargets="$(GetPackageVersionDependsOn)"
Returns="@(_ProjectPathWithVersion)">
<ItemGroup>
<_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)" Condition="'$(IsPackable)' == 'true'">
<_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)">
<PackageId>$(PackageId)</PackageId>
<PackageVersion Condition="'$(PackageVersion)' != ''">$(PackageVersion)</PackageVersion>
<PackageVersion>$(PackageVersion)</PackageVersion>
<VersionVariableName>$(PackageId.Replace('.',''))PackageVersion</VersionVariableName>
</_ProjectPathWithVersion>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>

<Target Name="PreCreateVsixContainer" BeforeTargets="GetVsixSourceItems">
<Target Name="PreCreateVsixContainer" BeforeTargets="GetVsixSourceItems" Condition="'$(IsPackable)' == 'true'">
<ItemGroup>
<_TemplatePackage Include="$(ArtifactsShippingPackagesDir)Microsoft.AspNetCore.Blazor.Templates.*.nupkg" />
</ItemGroup>
Expand Down Expand Up @@ -97,7 +97,8 @@
<ProjectReference
Include="..\..\Templates\src\Microsoft.AspNetCore.Blazor.Templates.csproj"
ReferenceOutputAssembly="false"
Targets="Pack" />
Private="false"
Targets="Build;Pack" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile>
<IsShippingPackage>true</IsShippingPackage>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IncludeBuildOutput>False</IncludeBuildOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<DebugType>none</DebugType>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<NoWarn>$(NoWarn);2008</NoWarn>
<Description>Templates for ASP.NET Core Blazor projects.</Description>
<PackageTags>aspnet;templates;blazor;spa</PackageTags>
Expand Down Expand Up @@ -45,4 +49,8 @@
<Output TaskParameter="OutputPath" ItemName="Content" />
</GenerateFileFromTemplate>
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<!-- Override SDK targets. This project does not produce a .dll. -->
<Target Name="CoreCompile" />
<Target Name="GetTargetPath" />
</Project>
2 changes: 1 addition & 1 deletion src/Components/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
<PropertyGroup Condition="'$(IsUnitTestProject)' != 'true'">
<GenerateDocumentationFile Condition="'$(GenerateDocumentationFile)' == ''">true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down
5 changes: 3 additions & 2 deletions src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant

<PropertyGroup>
<!-- If this project won't produce a package, don't bother building anything. -->
<BuildDependsOn Condition="'$(IsPackable)' != 'false'">
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
$(BuildDependsOn);
GeneratePackageConflictManifest;
_ResolveTargetingPackContent;
Expand Down Expand Up @@ -161,7 +161,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant

<Target Name="_CreateTargetingPackArchive"
Inputs="@(RefPackContent)"
Outputs="$(ArchiveOutputPath)">
Outputs="$(ArchiveOutputPath)"
Condition="'$(IsPackable)' == 'true'">
<ZipDirectory
SourceDirectory="$(TargetingPackLayoutRoot)"
DestinationFile="$(ArchiveOutputPath)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="..\..\build\assets.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>$(MSBuildProjectName).$(TargetRuntimeIdentifier)</PackageId>
<IncludeBuildOutput>true</IncludeBuildOutput>
<IsPackable>$(PackNativeAssets)</IsPackable>
<IsShippingPackage>false</IsShippingPackage>
<BuildOutputTargetFolder>runtimes/$(TargetRuntimeIdentifier)/native/</BuildOutputTargetFolder>
<RuntimeIdentifier>$(TargetRuntimeIdentifier)</RuntimeIdentifier>
<DebugType>none</DebugType>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<HasReferenceAssembly>false</HasReferenceAssembly>
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<TargetsForTfmSpecificBuildOutput>
$(TargetsForTfmSpecificBuildOutput);
AddPackNativeComponents
</TargetsForTfmSpecificBuildOutput>
<PackageId>$(MSBuildProjectName).$(TargetRuntimeIdentifier)</PackageId>
</PropertyGroup>

<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(VCTargetsPath)' != ''">
Expand All @@ -22,16 +29,17 @@
<Target Name="AddPackNativeComponents" AfterTargets="_CalculateInputsOutputsForPack" Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(PackNativeAssets)' == 'true'">
<ItemGroup>
<!-- RunShimComponents is based on the current runtime (NativePlatform) which should be the same as TargetRuntimeIdentifier -->
<BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
<DebugSymbolsProjectOutputGroupOutput Remove="@(DebugSymbolsProjectOutputGroupOutput)" />
<BuiltProjectOutputGroupOutput Include="%(RunShimComponents.DllLocation)" />
<BuiltProjectOutputGroupOutput Include="%(RunShimComponents.PdbLocation)" />

<NuGetPackInput Include="@(BuiltProjectOutputGroupOutput)" />
</ItemGroup>
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<!-- This project does not produce a binary. Disable the compiler. -->
<Target Name="Compile" />
<Target Name="CopyFilesToOutputDirectory" />
<Target Name="CoreCompile" />
<ItemGroup>
<BuiltProjectOutputGroupKeyOutput Remove="@(BuiltProjectOutputGroupKeyOutput)" />
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/SiteExtensions/LoggingBranch/LoggingBranch.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TrimmedVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.'))))</TrimmedVersion>
<title>ASP.NET Core Extensions</title>
<Description>This extension enables additional functionality for ASP.NET Core on Azure WebSites, such as enabling Azure logging.</Description>
<TargetFramework>net461</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<PackageTags>aspnet;logging;aspnetcore;AzureSiteExtension;keyvault;configuration;dataprotection</PackageTags>
<ContentTargetFolders>content</ContentTargetFolders>
<PackageId>Microsoft.AspNetCore.AzureAppServices.SiteExtension.$(TrimmedVersion).$(TargetArchitecture)</PackageId>
<PackageId>Microsoft.AspNetCore.AzureAppServices.SiteExtension.$(AspNetCoreMajorMinorVersion).$(TargetArchitecture)</PackageId>
<RuntimeIdentifier>$(TargetRuntimeIdentifier)</RuntimeIdentifier>
<HostingStartupRuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</HostingStartupRuntimeFrameworkVersion>

<TargetFramework>net461</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<PackageType>AzureSiteExtension</PackageType>
<ContentTargetFolders>content</ContentTargetFolders>

<TrimmedVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.'))))</TrimmedVersion>
<Title>ASP.NET Core $(TrimmedVersion) ($(TargetArchitecture)) Runtime </Title>
<Title>ASP.NET Core $(AspNetCoreMajorMinorVersion) ($(TargetArchitecture)) Runtime </Title>
<Description>This site extension installs Microsoft.AspNetCore.App and Microsoft.NetCore.App shared runtimes.</Description>
<PackageTags>aspnetcore;AzureSiteExtension</PackageTags>
<PackageId>AspNetCoreRuntime.$(TrimmedVersion).$(TargetArchitecture)</PackageId>
<PackageId>AspNetCoreRuntime.$(AspNetCoreMajorMinorVersion).$(TargetArchitecture)</PackageId>
<RuntimeIdentifier>$(TargetRuntimeIdentifier)</RuntimeIdentifier>
<NoPackageAnalysis>true</NoPackageAnalysis>
<DotNetUnpackFolder>$(RedistSharedFrameworkLayoutRoot)</DotNetUnpackFolder>
<IsShippingPackage>true</IsShippingPackage>
Expand Down