Skip to content

Commit

Permalink
Move *OutputPath logic out of the target (Fixes #9234)
Browse files Browse the repository at this point in the history
This fixes a host of path related issues when doing a customized build with Pack targets.
It also obsoletes the `PackageOutputPath` in the SDK's `DefaultOutputPaths` targets.
It also ensures non-sdk style projects doesn't have to specify some default paths.
Hopefully it didn't break anything...
  • Loading branch information
Nirmal4G committed Feb 29, 2020
1 parent 64f2feb commit 2199237
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ Copyright (c) .NET Foundation. All rights reserved.
<IsInnerBuild Condition="'$(TargetFramework)' != '' AND '$(TargetFrameworks)' != ''">true</IsInnerBuild>
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">symbols.nupkg</SymbolPackageFormat>
<AddPriFileDependsOn Condition="'$(MicrosoftPortableCurrentVersionPropsHasBeenImported)' == 'true'">DeterminePortableBuildCapabilities</AddPriFileDependsOn>
<NuspecOutputPath Condition="'$(NuspecOutputPath)' == ''">$(BaseIntermediateOutputPath)$(Configuration)\</NuspecOutputPath>
<WarnOnPackingNonPackableProject Condition="'$(WarnOnPackingNonPackableProject)' == ''">false</WarnOnPackingNonPackableProject>
<ImportNuGetBuildTasksPackTargetsFromSdk Condition="'$(ImportNuGetBuildTasksPackTargetsFromSdk)' == ''">false</ImportNuGetBuildTasksPackTargetsFromSdk>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll; .exe; .winmd; .json; .pri; .xml; $(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder Condition="'$(SymbolPackageFormat)' != 'snupkg'">.pdb; .mdb; $(AllowedOutputExtensionsInPackageBuildOutputFolder); $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder Condition="'$(SymbolPackageFormat)' == 'snupkg'">.pdb</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<SuppressDependenciesWhenPacking Condition="'$(SuppressDependenciesWhenPacking)' == ''">false</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup>
<RestoreOutputPath Condition="'$(RestoreOutputPath)' == ''">$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(BaseOutputPath)$(Configuration)\</PackageOutputPath>
<NuspecOutputPath Condition="'$(NuspecOutputPath)' == ''">$(BaseIntermediateOutputPath)$(Configuration)\</NuspecOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(NoBuild)' == 'true' or '$(GeneratePackageOnBuild)' == 'true'">
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>
Expand Down Expand Up @@ -146,10 +152,6 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup Condition="$(ContinuePackingAfterGeneratingNuspec) == '' ">
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
</PropertyGroup>
<PropertyGroup>
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$(OutputPath)</PackageOutputPath>
<RestoreOutputPath Condition=" '$(RestoreOutputPath)' == '' " >$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
</PropertyGroup>

<ConvertToAbsolutePath Paths="$(NuspecOutputPath)">
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecOutputAbsolutePath" />
Expand Down Expand Up @@ -282,8 +284,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
</PropertyGroup>
</Target>
<Target Name="_GetProjectReferenceVersions"

<Target Name="_GetProjectReferenceVersions"
Condition="'$(NuspecFile)' == ''"
DependsOnTargets="_CalculateInputsOutputsForPack;$(GetPackageVersionDependsOn)">
<ConvertToAbsolutePath Paths="$(RestoreOutputPath)">
Expand Down Expand Up @@ -407,7 +409,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</TfmSpecificFrameworkAssemblyReferences>
</ItemGroup>
</Target>

<Target Name="_GetBuildOutputFilesWithTfm"
DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup;SatelliteDllsProjectOutputGroup;_AddPriFileToPackBuildOutput;$(TargetsForTfmSpecificBuildOutput)"
Returns="@(BuildOutputInPackage)">
Expand Down

0 comments on commit 2199237

Please sign in to comment.