Skip to content

Commit

Permalink
chore: Correct packaging of generators and fixing Nuget overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrandolph committed May 19, 2023
1 parent 216f456 commit f873b84
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@
<GeneratorOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)\PackGenerators\</GeneratorOutputPath>
</PropertyGroup>
<MSBuild Projects="@(GeneratorProjectReference)"
Properties="Configuration=$(Configuration);OutputPath=$(GeneratorOutputPath)" />
Properties="Configuration=$(Configuration);OutputPath=$(GeneratorOutputPath);TargetFramework=netstandard2.0" />
</Target>

<Target Name="GeneratorPack"
AfterTargets="PackageGeneratorBuild">
<ItemGroup>
<None Include="$(GeneratorOutputPath)**\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(GeneratorOutputPath)**\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Exclude="@(None)" Visible="false" />
</ItemGroup>
</Target>

Expand Down
6 changes: 3 additions & 3 deletions src/Uno.CrossTargeting.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<Message Text="Building target framework: $(TargetFramework)" Importance="high" Condition="'$(TargetFramework)'!=''" />
</Target>

<Target Name="_UnoOverrideNuget" AfterTargets="AfterBuild" DependsOnTargets="BuiltProjectOutputGroup" Condition="'$(UnoNugetOverrideVersion)'!=''">
<Target Name="_UnoOverrideNuget" AfterTargets="AfterBuild" DependsOnTargets="BuiltProjectOutputGroup" Condition="'$(NugetOverrideVersion)'!=''">

<PropertyGroup>
<_TargetNugetPackageId Condition="'$(PackageId)'!=''">$(PackageId)</_TargetNugetPackageId>
<_TargetNugetPackageId Condition="'$(PackageId)'==''">$(AssemblyName)</_TargetNugetPackageId>
<_TargetNugetFolder Condition="'$(ToolOfPackage)'!=''">$(USERPROFILE)\.nuget\packages\$(ToolOfPackage)\$(UnoNugetOverrideVersion)\analyzers\dotnet\cs</_TargetNugetFolder>
<_TargetNugetFolder Condition="'$(ToolOfPackage)'==''">$(USERPROFILE)\.nuget\packages\$(_TargetNugetPackageId)\$(UnoNugetOverrideVersion)\lib\$(TargetFramework)</_TargetNugetFolder>
<_TargetNugetFolder Condition="'$(ToolOfPackage)'!=''">$(USERPROFILE)\.nuget\packages\$(ToolOfPackage)\$(NugetOverrideVersion)\analyzers\dotnet\cs</_TargetNugetFolder>
<_TargetNugetFolder Condition="'$(ToolOfPackage)'==''">$(USERPROFILE)\.nuget\packages\$(_TargetNugetPackageId)\$(NugetOverrideVersion)\lib\$(TargetFramework)</_TargetNugetFolder>
</PropertyGroup>

<ItemGroup>
Expand Down
15 changes: 13 additions & 2 deletions src/crosstargeting_override.props.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@

The UnoTargetFrameworkMobileOverride property is use only in Mobile (i.e. the single-project used by net6-ios/android/mac/catalyst)
-->
<UnoTargetFrameworkMobileOverride>net6.0-ios</UnoTargetFrameworkMobileOverride>
<UnoTargetFrameworkOverride>$(UnoTargetFrameworkMobileOverride);netstandard2.0</UnoTargetFrameworkOverride>
<!-- <UnoTargetFrameworkMobileOverride>net6.0-ios</UnoTargetFrameworkMobileOverride>-->
<!-- <UnoTargetFrameworkOverride>$(UnoTargetFrameworkMobileOverride);netstandard2.0</UnoTargetFrameworkOverride>-->

<!--

### NugetOverrideVersion ###

Allows the override of the nuget local cache.
Set it to the version you want to override, used in another app.
You will see the override path in the build output.
The packages are located under this directory: "%USERPROFILE%\.nuget\packages". -->

<!-- <NugetOverrideVersion>2.3.0</NugetOverrideVersion> -->
</PropertyGroup>
</Project>

0 comments on commit f873b84

Please sign in to comment.