Last active
August 3, 2020 02:49
-
-
Save teneko/30cc3adc0649b773b36617b2cf1c6caf to your computer and use it in GitHub Desktop.
MSBuild/NuGet Playground
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
<!-- | |
===================================================== | |
BuildEachTargetFramework | |
Builds project for each TargetFramework. It is called | |
from synthetic projects. | |
Target _GetTargetFrameworksOutput belongs to | |
https://github.com/NuGet/NuGet.Client/blob/c05f9afa9c2fcee7fbe10754521b3f6424bee128/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets#L98 | |
===================================================== | |
--> | |
<Target Name="BuildEachTargetFramework2" DependsOnTargets="_GetTargetFrameworksOutput;AssignProjectConfiguration;_SplitProjectReferencesByFileExistence" | |
Condition="$(ExecutableProjectFullPath) != ''"> | |
<MSBuild | |
Projects="%(ProjectReferenceWithConfiguration.Identity)" | |
Targets="_SetPackedExecutableProjectReferences" | |
ContinueOnError="true" | |
Properties="ProjectReferenceWithConfigurationIdentity=%(ProjectReferenceWithConfiguration.Identity)"> | |
<Output TaskParameter="TargetOutputs" ItemName="ProjectReferenceWithConfiguration" /> | |
</MSBuild> | |
<RemoveDuplicates Inputs="@(ProjectReferenceWithConfiguration)" /> | |
<ItemGroup> | |
<ProjectReferenceWithConfiguration Remove="@(ProjectReferenceWithConfiguration)" Condition="%(FullPath) == $(SyntheticProjectFullPath)" /> | |
</ItemGroup> | |
<ItemGroup> | |
<ProjectReferenceWithConfiguration Update="@(ProjectReferenceWithConfiguration)"> | |
<PackExecutableChosenTargetEntry Condition="'%(PackedAsExecutableProjectWontBuilding)' == 'true'">_BuildPackExecutableSpecificNonBuildingProjectReference</PackExecutableChosenTargetEntry> | |
<PackExecutableChosenTargetEntry Condition="'%(PackedAsExecutableProjectWontBuilding)' != 'true'">_BuildPackExecutableSpecificProjectReference</PackExecutableChosenTargetEntry> | |
</ProjectReferenceWithConfiguration> | |
</ItemGroup> | |
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="%(ProjectReferenceWithConfiguration.PackExecutableChosenTargetEntry)" | |
Properties="PackExecutableSpecificProjectReference=%(ProjectReferenceWithConfiguration.FullPath)" /> | |
</Target> |
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
<!-- | |
Uses _GetTargetFrameworksOutput of | |
https://github.com/NuGet/NuGet.Client/blob/c05f9afa9c2fcee7fbe10754521b3f6424bee128/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets#L98 | |
--> | |
<MSBuild Projects="$(PackExecutableSpecificProjectReference)" Targets="_GetTargetFrameworksOutput"> | |
<Output TaskParameter="TargetOutputs" ItemName="_TargetFrameworks" /> | |
</MSBuild> |
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
<Project InitialTargets="test"> | |
<ItemDefinitionGroup> | |
<Test> | |
<A>a</A> | |
</Test> | |
</ItemDefinitionGroup> | |
<ItemDefinitionGroup> | |
<Test> | |
<B>b</B> | |
</Test> | |
</ItemDefinitionGroup> | |
<ItemGroup> | |
<Test Include="One" /> | |
</ItemGroup> | |
<Target Name="test"> | |
<Message Text="ID: %(Test.Identity) A: %(Test.A) B: %(Test.B)" Importance="high" /> | |
<!-- Results in "ID: One A: a B: b". --> | |
</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
<Project> | |
<PropertyGroup> | |
<!--<TargetFramework>netstandard1.0</TargetFramework>--> | |
<IncludeBuildOutput>false</IncludeBuildOutput> | |
<NoPackageAnalysis>true</NoPackageAnalysis> | |
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | |
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> | |
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> | |
</PropertyGroup> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment