Workaround quirks in NuGet

* Disable package analysis because it incorrectly issues NU5109 on macOS, but not windows
* Normalize file paths because if you mix slashes, NuGet will just skip the entire folder
* Normalize the project path given to restore. If it not normalized, restore skips the project and issues a warning
This commit is contained in:
Nate McMaster 2018-10-25 14:27:46 -07:00
parent dbc28c523e
commit 77a3089c8d
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
5 changed files with 15 additions and 9 deletions

View File

@ -2,7 +2,8 @@
<Import Project="SharedFx.props" /> <Import Project="SharedFx.props" />
<PropertyGroup> <PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)\src\Framework\Framework.UnitTests\Framework.UnitTests.csproj</UnitTestFxProject> <UnitTestFxProject>$(RepositoryRoot)src\Framework\Framework.UnitTests\Framework.UnitTests.csproj</UnitTestFxProject>
<UnitTestFxProject>$([MSBuild]::NormalizePath($(UnitTestFxProject)))</UnitTestFxProject>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -75,6 +75,9 @@ This targets file should only be imported by .shfxproj files.
<PublishDir Condition=" '$(CrossGenOutput)' != 'true' ">$(OutputPath)</PublishDir> <PublishDir Condition=" '$(CrossGenOutput)' != 'true' ">$(OutputPath)</PublishDir>
<PublishDir Condition=" '$(CrossGenOutput)' == 'true' ">$(IntermediateOutputPath)u\</PublishDir> <PublishDir Condition=" '$(CrossGenOutput)' == 'true' ">$(IntermediateOutputPath)u\</PublishDir>
<!-- If symbols generation is disabled, there is no use in producing a symbols.nupkg files. -->
<IncludeSymbols Condition="'$(CrossgenSymbolsOutput)' == 'false'">false</IncludeSymbols>
<MetadataOutputPath Condition="'$(MetadataOutputPath)' == ''">$(OutputPath)files\</MetadataOutputPath> <MetadataOutputPath Condition="'$(MetadataOutputPath)' == ''">$(OutputPath)files\</MetadataOutputPath>
<SymbolsOutputPath Condition="'$(SymbolsOutputPath)' == ''">$(OutputPath)symbols\</SymbolsOutputPath> <SymbolsOutputPath Condition="'$(SymbolsOutputPath)' == ''">$(OutputPath)symbols\</SymbolsOutputPath>
<NativeAssetsOutputPath Condition="'$(NativeAssetsOutputPath)' == ''">$(OutputPath)native\</NativeAssetsOutputPath> <NativeAssetsOutputPath Condition="'$(NativeAssetsOutputPath)' == ''">$(OutputPath)native\</NativeAssetsOutputPath>

View File

@ -19,11 +19,13 @@
<BaseIntermediateOutputPath>$(RepositoryRoot)obj\fx\$(MSBuildProjectName)\</BaseIntermediateOutputPath> <BaseIntermediateOutputPath>$(RepositoryRoot)obj\fx\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<CrossgenOutput Condition="'$(SharedFxRid)' == 'linux-arm'">false</CrossgenOutput> <CrossgenOutput Condition="'$(SharedFxRid)' == 'linux-arm'">false</CrossgenOutput>
<CrossgenSymbolOutput Condition=" '$(CrossgenOutput)' == 'false' OR '$(SharedFxRid)' == 'osx-x64'">false</CrossgenSymbolOutput> <CrossgenSymbolsOutput Condition=" '$(CrossgenOutput)' == 'false' OR '$(SharedFxRid)' == 'osx-x64'">false</CrossgenSymbolsOutput>
<IncludeSymbols>true</IncludeSymbols> <IncludeSymbols>true</IncludeSymbols>
<NuspecFile>$(MSBuildThisFileDirectory)runtime.fx.nuspec</NuspecFile> <NuspecFile>$(MSBuildThisFileDirectory)runtime.fx.nuspec</NuspecFile>
<PackageTags>aspnetcore;shared-framework</PackageTags> <PackageTags>aspnetcore;shared-framework</PackageTags>
<!-- Workaround for invalid NU5109 error when packing on macOS. -->
<NoPackageAnalysis>true</NoPackageAnalysis>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -19,9 +19,9 @@
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(RepositoryCommit);
copyright=$(Copyright); copyright=$(Copyright);
targetFramework=$(TargetFramework); targetFramework=$(TargetFramework);
symbolsAssets=$(SymbolsOutputPath); symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));
nativeAssets=$(NativeAssetsOutputPath); nativeAssets=$([MSBuild]::NormalizeDirectory($(NativeAssetsOutputPath)));
runtimeAssets=$(RuntimeAssetsOutputPath); runtimeAssets=$([MSBuild]::NormalizeDirectory($(RuntimeAssetsOutputPath)));
</NuspecProperties> </NuspecProperties>
</PropertyGroup> </PropertyGroup>
</Target> </Target>

View File

@ -15,10 +15,10 @@
<serviceable>true</serviceable> <serviceable>true</serviceable>
</metadata> </metadata>
<files> <files>
<file src="$symbolsAssets$" target="runtimes\$rid$\lib\$targetFramework$\" /> <file src="$symbolsAssets$" target="runtimes/$rid$/lib/$targetFramework$/" />
<file src="$runtimeAssets$" target="runtimes\$rid$\lib\$targetFramework$\" /> <file src="$runtimeAssets$" target="runtimes/$rid$/lib/$targetFramework$/" />
<file src="$nativeAssets$" target="runtimes\$rid$\native\" /> <file src="$nativeAssets$" target="runtimes/$rid$/native/" />
<!-- This is a dummy reference which prevents NuGet from adding any compilation references when this package is imported. --> <!-- This is a dummy reference which prevents NuGet from adding any compilation references when this package is imported. -->
<file src="_._" target="ref\netstandard\" /> <file src="_._" target="ref/netstandard/" />
</files> </files>
</package> </package>