-
Notifications
You must be signed in to change notification settings - Fork 375
Create a new Microsoft.DotNet.SharedFramework.Sdk for creating shared frameworks #5714
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
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
72181d3
Version 5.0.0-dev.20326.3
jkoritzinsky 444612d
Merge branch 'master' of https://github.com/dotnet/arcade into unifie…
jkoritzinsky 6399975
Port #5688 to the new SDK.
jkoritzinsky 452628d
Update readme with documentation of the shared framework generation. …
jkoritzinsky 564617d
Add back feature that was somehow lost in the rebase.
jkoritzinsky 97dd8ab
Add basic docs for the installer builds.
jkoritzinsky 4f6c956
Finish documentation.
jkoritzinsky a20bef3
Update host file names to be overridable to support the crossgen2 pack.
jkoritzinsky 346b896
Fix GeneratedBuildFile check in GenerateSharedFrameworkDepsFile
jkoritzinsky 18ab7fd
Split out the archive targets from the sharedfx targets so installer-…
jkoritzinsky 30bd1c8
Fix error condition.
jkoritzinsky 8ace30a
Version 5.0.0-dev.20365.8
jkoritzinsky 81bd869
Only include runtime files in the deps file (not tool files or crosst…
jkoritzinsky 4be0523
Exclude PackOnly=true files from the deps file. They won't be availab…
jkoritzinsky 45610c5
Fix NuGet package type.
jkoritzinsky 93361f5
Remove important parameter from error tasks.
jkoritzinsky c5565a9
Allow files to be individually opted-out of being added to the deps f…
jkoritzinsky 3bfd295
Reduce copying and enable empty installers for linux.
jkoritzinsky 81becff
Better handle GenerateInstallers=false when building linux packages.
jkoritzinsky 1dd49a1
Enable overriding the package id for shared framework packages.
jkoritzinsky fe5e51d
Merge branch 'master' of https://github.com/dotnet/arcade into unifie…
jkoritzinsky f39a4fc
Add OverridePackageId property to avoid colliding with built-in NuGet…
jkoritzinsky 3f1708b
Fix bad condition for PackageId.
jkoritzinsky 1bd7315
Merge branch 'master' of https://github.com/dotnet/arcade into unifie…
jkoritzinsky 5017235
First pass moving the installer and bundle infrastructure out of Micr…
jkoritzinsky c1042d3
Factor out the archive creation targets to a Microsoft.DotNet.Build.T…
jkoritzinsky 61cd716
Fix installer package layout
jkoritzinsky cecd7d7
Fix RemoveProperties
jkoritzinsky 5145540
Fix various bugs that crept in during the refactoring.
jkoritzinsky 51caf02
Fix SkipBuild calculation
jkoritzinsky 1c1f463
Fix including symbols in the symbols package.
jkoritzinsky afcb0de
Invoke Pack target as an inner build instead of hooking in via a wrap…
jkoritzinsky f4ac87f
Clean up the skip build calculations and make them actually work.
jkoritzinsky fe7640c
Ensure we respect the SkipBuild property in the archives and installe…
jkoritzinsky 82acfe3
Don't reference desktop-only files on the .NET Core build.
jkoritzinsky 8b63d86
Update READMEs of the three packages to reflect the updated organizat…
jkoritzinsky 2da6aec
Enable overriding host json file location in the package (for crossge…
jkoritzinsky bf6c57b
Implement closure, type, and file version validation.
jkoritzinsky bd6a7e3
PR feedback.
jkoritzinsky 304f667
Comments and var clarification.
jkoritzinsky 840626f
Automatically calculate ignored references for closure validation bas…
jkoritzinsky 80aee3c
Set SelfContained to true when processing framework references.
jkoritzinsky a5c17c4
Don't set BuildDependsOn to empty. It breaks packages that hook into …
jkoritzinsky 4165ccc
Merge branch 'master' into unified-sharedfx-sdk
jkoritzinsky 93e0577
Use System.Reflection.Metadata to get the assembly name to ensure .NE…
jkoritzinsky b31c01f
Merge branch 'unified-sharedfx-sdk' of github.com:jkoritzinsky/arcade…
jkoritzinsky 47b10a6
Rename folder to avoid warning
jkoritzinsky a46fcaf
Remove unneeded NoWarn
jkoritzinsky 4543285
Merge branch 'master' of https://github.com/dotnet/arcade into pr/jko…
jkoritzinsky 6ece972
React to changes in PrepareForReadyToRunCompilation.
jkoritzinsky 9701071
Fix packaging non RuntimePack shared framework packs in msi installers.
jkoritzinsky 70819f2
Enable overriding the targets and tasks for the installer and archive…
jkoritzinsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Microsoft.DotNet.Build.Tasks.Archives/Microsoft.DotNet.Build.Tasks.Archives.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>netcoreapp2.1</TargetFrameworks> | ||
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild> | ||
|
||
<IsPackable>true</IsPackable> | ||
<PackTasks>false</PackTasks> | ||
|
||
<Description>Targets for producing an archive of file outputs.</Description> | ||
<PackageType>MSBuildSdk</PackageType> | ||
|
||
<EnableGeneratedPackageContent>false</EnableGeneratedPackageContent> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(RepoRoot)eng\BuildTask.targets" /> | ||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Microsoft.DotNet.Build.Tasks.Archives | ||
|
||
Targets package for producing zip and tar archives. | ||
|
||
This package generates an archive that can be extracted on top of an existing .NET SDK or Runtime layout. The name of this file is derived from the `ArchiveName` property and the RID. The `ArchiveName` property defaults to the project file name without the extension. This package calls the `PublishToDisk` target on the project to generate the project layout. | ||
|
||
## Build Skip Support for Unsupported Platforms and Servicing | ||
|
||
This SDK also supports automatically skipping builds on unsupported platforms or in servicing releases. If a project with a list of provided RIDs in `RuntimeIdentifiers` is built with the `RuntimeIdentifier` property set to a RID that is not in the `RuntimeIdentifiers` list, the build will be skipped. This enables cleanly skipping optional packs, installers, or bundles that only exist on specific platforms. | ||
|
||
Additionally, if a `ProjectServicingConfiguration` item is provided with the identity of the project name and the `PatchVersion` metadata on the item is not equal to the current `PatchVersion`, the build will be skipped. This support enables a repository to disable building targeting packs in servicing releases if that is desired. | ||
|
7 changes: 7 additions & 0 deletions
7
...Microsoft.DotNet.Build.Tasks.Archives/build/Microsoft.DotNet.Build.Tasks.Archives.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<MicrosoftDotNetBuildTasksArchivesMSBuildDir Condition="'$(MicrosoftDotNetBuildTasksArchivesMSBuildDir)' == ''">$(MSBuildThisFileDirectory)</MicrosoftDotNetBuildTasksArchivesMSBuildDir> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(MicrosoftDotNetBuildTasksArchivesMSBuildDir)archives.targets" /> | ||
</Project> |
121 changes: 121 additions & 0 deletions
121
src/Microsoft.DotNet.Build.Tasks.Archives/build/archives.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<Project> | ||
<Target Name="_GetCurrentProjectServicingConfiguration"> | ||
<ItemGroup> | ||
<CurrentProjectServicingConfiguration | ||
Include="@(ProjectServicingConfiguration)" | ||
Condition="'%(Identity)' == '$(MSBuildProjectName)'" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- | ||
The Microsoft build's per-package servicing policy conflicts with the source-build restrictions. | ||
Targeting packs, for example, are only built/published when there's a known change to release. | ||
This is in contrast to runtime packs and the shared framework, which are always built and | ||
published. This means it's common in the Microsoft build for downstream repos to depend on two | ||
builds' outputs: the current build's runtime assets, and some old build's targeting pack. | ||
|
||
The Microsoft build can simply download the old targeting pack from NuGet.org. Source-build | ||
can't do this because the bits on NuGet.org are not built locally. Instead, source-build assumes | ||
it's possible to use current sources to build a package with the old version. This target | ||
applies the old build's patch version to make that happen. | ||
|
||
This solution has pitfalls. More info at https://github.com/dotnet/core-setup/issues/8735. The | ||
target supports SkipSetLastReleasedVersionForSourceBuild (unused as of writing) to allow | ||
disabling this workaround if a better way forward is implemented. | ||
--> | ||
<Target Name="SetLastReleasedVersionForSourceBuild" | ||
Condition=" | ||
'$(DotNetBuildFromSource)' == 'true' and | ||
'$(SkipSetLastReleasedVersionForSourceBuild)' != 'true'" | ||
BeforeTargets="GetProductVersions" | ||
DependsOnTargets="_GetCurrentProjectServicingConfiguration"> | ||
<PropertyGroup> | ||
<MostRecentProducedServicingPatchVersion>%(CurrentProjectServicingConfiguration.PatchVersion)</MostRecentProducedServicingPatchVersion> | ||
<PatchVersion Condition="'$(MostRecentProducedServicingPatchVersion)' != ''">$(MostRecentProducedServicingPatchVersion)</PatchVersion> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<Target Name="_GetSkipArchivesBuildProps" | ||
DependsOnTargets=" | ||
_GetCurrentProjectServicingConfiguration; | ||
SetLastReleasedVersionForSourceBuild"> | ||
<!-- | ||
Skip the build if there is an applicable servicing configuration, and the servicing | ||
configuration indicates this project shouldn't build for this patch version. | ||
--> | ||
<PropertyGroup Condition="'@(CurrentProjectServicingConfiguration)' != ''"> | ||
<SkipArchivesBuild Condition="'%(CurrentProjectServicingConfiguration.PatchVersion)' != '$(PatchVersion)'">true</SkipArchivesBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<_TargetRuntimeIdentifiers Include="$(RuntimeIdentifiers)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition="'$(RuntimeIdentifiers)' != '' and '$(RuntimeIdentifier)' != ''"> | ||
<!-- Avoid building a project when none of the possible RuntimeIdentifiers is the current RuntimeIdentifier. --> | ||
<_RidInRidList Condition="'%(_TargetRuntimeIdentifiers.Identity)' == '$(RuntimeIdentifier)'">true</_RidInRidList> | ||
<SkipArchivesBuild Condition="'$(_RidInRidList)' != 'true'">true</SkipArchivesBuild> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(SkipBuild)' == 'true'"> | ||
<SkipArchivesBuild>true</SkipArchivesBuild> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<PropertyGroup> | ||
<ArchiveName Condition="'$(ArchiveName)' == ''">$([System.IO.Path]::GetFileNameWithoutExtension($(MSBuildProjectFile)))</ArchiveName> | ||
<SymbolsArchiveName Condition="'$(SymbolsArchiveName)' == ''">$(ArchiveName)-symbols</SymbolsArchiveName> | ||
</PropertyGroup> | ||
|
||
<Target Name="_CreateArchive" | ||
Condition="'$(SkipArchivesBuild)' != 'true'"> | ||
<PropertyGroup> | ||
<_OutputPathRoot>$(IntermediateOutputPath)output/</_OutputPathRoot> | ||
<_ArchiveFileName>$(ArchiveName)-$(Version)</_ArchiveFileName> | ||
<_ArchiveFileName Condition="'$(RuntimeIdentifier)' != ''">$(ArchiveName)-$(RuntimeIdentifier)-$(Version)</_ArchiveFileName> | ||
</PropertyGroup> | ||
<MSBuild Projects="$(MSBuildProjectFullPath)" | ||
Targets="PublishToDisk" | ||
Properties="OutputPath=$(_OutputPathRoot)" /> | ||
|
||
<MakeDir Directories="$(PackageOutputPath)" /> | ||
<ZipDirectory SourceDirectory="$(_OutputPathRoot)" | ||
Overwrite="true" | ||
DestinationFile="$(PackageOutputPath)/$(_ArchiveFileName).zip" | ||
Condition="$([MSBuild]::IsOSPlatform(Windows))"/> | ||
<Exec Command="tar -C '$(_OutputPathRoot)' -czf $(PackageOutputPath)/$(_ArchiveFileName).tar.gz ." | ||
IgnoreExitCode="true" | ||
IgnoreStandardErrorWarningFormat="true" | ||
Condition="!$([MSBuild]::IsOSPlatform(Windows))"/> | ||
</Target> | ||
|
||
<Target Name="_CreateSymbolsArchive" | ||
Condition="'$(CreateSymbolsArchive)' == 'true' and '$(SkipArchivesBuild)' != 'true'"> | ||
<PropertyGroup> | ||
<_SymbolsOutputPathRoot>$(IntermediateOutputPath)symbols/</_SymbolsOutputPathRoot> | ||
<_ArchiveFileName>$(SymbolsArchiveName)-$(Version)</_ArchiveFileName> | ||
<_ArchiveFileName Condition="'$(RuntimeIdentifier)' != ''">$(SymbolsArchiveName)-$(RuntimeIdentifier)-$(Version)</_ArchiveFileName> | ||
</PropertyGroup> | ||
<MSBuild Projects="$(MSBuildProjectFullPath)" | ||
Targets="PublishSymbolsToDisk" | ||
Properties="SymbolsOutputPath=$(_SymbolsOutputPathRoot)" /> | ||
|
||
<MakeDir Directories="$(PackageOutputPath)" /> | ||
<ZipDirectory SourceDirectory="$(_SymbolsOutputPathRoot)" | ||
Overwrite="true" | ||
DestinationFile="$(PackageOutputPath)/$(_ArchiveFileName).zip" | ||
Condition="$([MSBuild]::IsOSPlatform(Windows))"/> | ||
<Exec Command="tar -C '$(_SymbolsOutputPathRoot)' -czf $(PackageOutputPath)/$(_ArchiveFileName).tar.gz ." | ||
IgnoreExitCode="true" | ||
IgnoreStandardErrorWarningFormat="true" | ||
Condition="!$([MSBuild]::IsOSPlatform(Windows))"/> | ||
</Target> | ||
|
||
<PropertyGroup> | ||
<BuildDependsOn> | ||
$(BuildDependsOn); | ||
_GetSkipArchivesBuildProps; | ||
_CreateArchive; | ||
_CreateSymbolsArchive | ||
</BuildDependsOn> | ||
</PropertyGroup> | ||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If aspnetcore was going to use this, the "or in servicing releases" bit must be something we could override. We Zip both our shared Fx contributions and our targeting packs. The shared Fx Zips are produced unconditionally. And, we've had multiple 3.1.x releases that had to include updated targeting pack content.
Uh oh!
There was an error while loading. Please reload this page.
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.
It is implemented this way--that targeting pack vs. sharedfx behavior is universal. I think what I landed with in dotnet/runtime etc. is pretty nice if I may say so myself 😄:
https://github.com/dotnet/runtime/blob/e535e10f7ff66960ef3552794fdfb81e028e8b5e/eng/Versions.props#L34-L51