-
Notifications
You must be signed in to change notification settings - Fork 122
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
Use csproj as pack input instead of nuspec #1119
Open
ViktorHofer
wants to merge
7
commits into
dotnet:main
Choose a base branch
from
ViktorHofer:UsePackTaskInsteadOfNuspec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c056a87
Use csproj as pack input instead of nuspec
ViktorHofer 785b542
Update BuildTask.targets
ViktorHofer 4675c0d
Revert docs change
ViktorHofer a462a3a
Merge remote-tracking branch 'origin/main' into UsePackTaskInsteadOfN…
ViktorHofer e35d787
Fix package content for build task packages
ViktorHofer eb90b07
Merge branch 'main' into UsePackTaskInsteadOfNuspec
ViktorHofer 29e637e
PR feedback for M.SourceLink.Tools.Package
ViktorHofer 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 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 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,112 @@ | ||
<!-- Copied from arcade with small modifications. --> | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<IsPackable>true</IsPackable> | ||
<!-- Build Tasks should have this set per https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md#recommended-settings --> | ||
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion> | ||
<PackTasks Condition="'$(PackTasks)' == ''">true</PackTasks> | ||
<TargetsForTfmSpecificContentInPackage Condition="'$(PackTasks)' == 'true'">$(TargetsForTfmSpecificContentInPackage);_AddBuildOutputToPackageCore;_AddBuildOutputToPackageDesktop</TargetsForTfmSpecificContentInPackage> | ||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<!-- Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
Default to including all *.props and *.targets files | ||
from the project directory into the NuGet package root | ||
--> | ||
<ItemGroup Condition="'$(EnableDefaultItems)' != 'false'"> | ||
<None Condition="'$(EnableDefaultNoneItems)' != 'false'" | ||
Include="**/*.props;**/*.targets" | ||
Pack="true" | ||
PackagePath="%(RecursiveDir)%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="$(RepoRoot)License.txt" PackagePath="LICENSE.txt" Pack="true"/> | ||
</ItemGroup> | ||
|
||
<!-- Don't include assemblies that MSBuild ships with. --> | ||
<ItemGroup> | ||
<PackageReference Update="Microsoft.Build" Publish="false" /> | ||
<PackageReference Update="Microsoft.Build.Framework" Publish="false" /> | ||
<PackageReference Update="Microsoft.Build.Tasks.Core" Publish="false" /> | ||
<PackageReference Update="Microsoft.Build.Utilities.Core" Publish="false" /> | ||
<PackageReference Update="Microsoft.NET.StringTools" Publish="false" /> | ||
<PackageReference Update="System.Collections.Immutable" Publish="false" /> | ||
</ItemGroup> | ||
|
||
<!-- Don't include assemblies that are provided by the SDK, next to MSBuild. --> | ||
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(SkipSDKInboxPublishExcludes)' != 'true'"> | ||
<PackageReference Update="Newtonsoft.Json" Publish="false" /> | ||
<PackageReference Update="NuGet.Commands" Publish="false" /> | ||
<PackageReference Update="NuGet.Common" Publish="false" /> | ||
<PackageReference Update="NuGet.Configuration" Publish="false" /> | ||
<PackageReference Update="NuGet.Frameworks" Publish="false" /> | ||
<PackageReference Update="NuGet.Packaging" Publish="false" /> | ||
<PackageReference Update="NuGet.ProjectModel" Publish="false" /> | ||
<PackageReference Update="NuGet.Versioning" Publish="false" /> | ||
</ItemGroup> | ||
|
||
<!-- Don't include assemblies that are inbox in Desktop MSBuild --> | ||
ViktorHofer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> | ||
<PackageReference Update="System.Buffers" Publish="false" /> | ||
<PackageReference Update="System.Memory" Publish="false" /> | ||
<PackageReference Update="System.Numerics.Vectors" Publish="false" /> | ||
<PackageReference Update="System.Reflection.Metadata" Publish="false" /> | ||
<PackageReference Update="System.Reflection.MetadataLoadContext" Publish="false" /> | ||
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Publish="false" /> | ||
<PackageReference Update="System.Security.Cryptography.Xml" Publish="false" /> | ||
<PackageReference Update="System.Text.Encodings.Web" Publish="false" /> | ||
<PackageReference Update="System.Text.Json" Publish="false" /> | ||
<PackageReference Update="System.Threading.Tasks.Dataflow" Publish="false" /> | ||
<PackageReference Update="System.Threading.Tasks.Extensions" Publish="false" /> | ||
<PackageReference Update="System.ValueTuple" Publish="false" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- | ||
Update all PackageReference items to default Publish to true. | ||
This forces the publish output to contain the dlls. | ||
--> | ||
<PackageReference Update="@(PackageReference)"> | ||
<Publish Condition="'%(PackageReference.Publish)' == ''">true</Publish> | ||
<PrivateAssets Condition="'%(PackageReference.Publish)' == 'false'">all</PrivateAssets> | ||
<ExcludeAssets Condition="'%(PackageReference.Publish)' == 'false'">runtime</ExcludeAssets> | ||
</PackageReference> | ||
|
||
<!-- | ||
Update all Reference items to have Pack="false" | ||
This removes the frameworkDependency nodes from the generated nuspec | ||
--> | ||
<Reference Update="@(Reference)" | ||
Pack="false" /> | ||
</ItemGroup> | ||
|
||
<!-- Desktop MSBuild compatibilty --> | ||
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> | ||
<PackageReference Update="System.Text.Json" Version="7.0.1" /> | ||
<PackageReference Update="Microsoft.Extensions.Logging.Console" Version="7.0.0" /> | ||
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="7.0.0" /> | ||
<PackageReference Update="System.Collections.Immutable" Version="7.0.0" /> | ||
<PackageReference Update="System.Reflection.Metadata" Version="7.0.0" /> | ||
</ItemGroup> | ||
|
||
<!-- Publish .NET assets and include them in the package under tools/net directory. --> | ||
<Target Name="_AddBuildOutputToPackageCore" DependsOnTargets="Publish" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="$(PublishDir)**" | ||
PackagePath="tools/net/%(RecursiveDir)%(FileName)%(Extension)"/> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- Include .NET Framework build outputs in the package under tools/netframework directory. --> | ||
<Target Name="_AddBuildOutputToPackageDesktop" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'"> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="$(OutputPath)**" PackagePath="tools/netframework/%(RecursiveDir)%(FileName)%(Extension)"/> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains 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 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 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
10 changes: 0 additions & 10 deletions
10
src/Microsoft.Build.StandardCI/Microsoft.Build.StandardCI.nuspec
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
src/Microsoft.Build.StandardCI/buildTransitive/Microsoft.Build.StandardCI.props
This file contains 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,4 @@ | ||
<!-- 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.txt file in the project root for more information. --> | ||
<Project> | ||
<Import Project="..\build\$(MSBuildThisFileName).props"/> | ||
</Project> |
2 changes: 1 addition & 1 deletion
2
src/Microsoft.Build.Tasks.Git.UnitTests/Microsoft.Build.Tasks.Git.UnitTests.csproj
This file contains 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 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
15 changes: 0 additions & 15 deletions
15
src/Microsoft.Build.Tasks.Git/Microsoft.Build.Tasks.Git.nuspec
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/Microsoft.Build.Tasks.Git/build/Microsoft.Build.Tasks.Git.props
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!-- 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.txt file in the project root for more information. --> | ||
<Project> | ||
<PropertyGroup> | ||
<MicrosoftBuildTasksGitAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.Build.Tasks.Git.dll</MicrosoftBuildTasksGitAssemblyFile> | ||
<MicrosoftBuildTasksGitAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.Build.Tasks.Git.dll</MicrosoftBuildTasksGitAssemblyFile> | ||
<MicrosoftBuildTasksGitAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\netframework\Microsoft.Build.Tasks.Git.dll</MicrosoftBuildTasksGitAssemblyFile> | ||
<MicrosoftBuildTasksGitAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net\Microsoft.Build.Tasks.Git.dll</MicrosoftBuildTasksGitAssemblyFile> | ||
</PropertyGroup> | ||
</Project> |
4 changes: 4 additions & 0 deletions
4
src/Microsoft.Build.Tasks.Git/buildTransitive/Microsoft.Build.Tasks.Git.props
This file contains 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,4 @@ | ||
<!-- 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.txt file in the project root for more information. --> | ||
<Project> | ||
<Import Project="..\build\$(MSBuildThisFileName).props"/> | ||
ViktorHofer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Project> |
4 changes: 4 additions & 0 deletions
4
src/Microsoft.Build.Tasks.Git/buildTransitive/Microsoft.Build.Tasks.Git.targets
This file contains 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,4 @@ | ||
<!-- 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.txt file in the project root for more information. --> | ||
<Project> | ||
<Import Project="..\build\$(MSBuildThisFileName).targets"/> | ||
</Project> |
This file contains 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
21 changes: 0 additions & 21 deletions
21
src/Microsoft.Build.Tasks.Tfvc/Microsoft.Build.Tasks.Tfvc.nuspec
This file was deleted.
Oops, something went wrong.
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.
It'd be nice to share this rather than making a copy.
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.
The msbuild team is working on an epic to make msbuild plugin (task) development easier: dotnet/msbuild#10733
That will replace all this when it gets implemented (planned for .NET 10).