Skip to content

Commit

Permalink
Merge pull request #1768 from unoplatform/mergify/bp/legacy/2x/pr-1762
Browse files Browse the repository at this point in the history
build: Adjust generator packaging to not require double build (backport #1762)
  • Loading branch information
nickrandolph authored Aug 14, 2023
2 parents b226d8c + 589bd4f commit de0154a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
17 changes: 0 additions & 17 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,6 @@
<WriteLinesToFile File="$(_AndroidResourceDesignerFile)" Lines="// Empty Content from uno.ui Directory.Build.targets." />
</Target>

<!-- NOTE: This is due to a Race Condition with MSBuild where the dll may not yet exist on a clean build -->
<Target Name="PackageGeneratorBuild"
AfterTargets="Build">
<PropertyGroup>
<GeneratorOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)\PackGenerators\</GeneratorOutputPath>
</PropertyGroup>
<MSBuild Projects="@(GeneratorProjectReference)"
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" Exclude="@(None)" Visible="false" />
</ItemGroup>
</Target>

<Import Project="winappsdk-workaround.targets" Condition="exists('winappsdk-workaround.targets')" />
<Import Project="xamarinmac-workaround.targets" Condition="exists('xamarinmac-workaround.targets') and $(TargetFramework.ToLower().StartsWith('xamarin')) and $(TargetFramework.ToLower().Contains('mac'))" />
<Import Project="Directory.UnoMetadata.targets" />
Expand Down
3 changes: 2 additions & 1 deletion src/Uno.Extensions.Core/Uno.Extensions.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
</ItemGroup>

<ItemGroup>
<GeneratorProjectReference Include="..\Uno.Extensions.Core.Generators\Uno.Extensions.Core.Generators.csproj" />
<ProjectReference Include="..\Uno.Extensions.Core.Generators\Uno.Extensions.Core.Generators.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<None Include="..\Uno.Extensions.Core.Generators\buildTransitive\Uno.Extensions.Core.props" Pack="true" PackagePath="buildTransitive" />
<None Include="..\Uno.Extensions.Core.Generators\bin\Uno.Extensions.Core.Generators\$(Configuration)\netstandard2.0\Uno.Extensions.Core.Generators.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
</ItemGroup>

<ItemGroup>
<GeneratorProjectReference Include="..\Uno.Extensions.Navigation.Generators\Uno.Extensions.Navigation.Generators.csproj" />
<ProjectReference Include="..\Uno.Extensions.Navigation.Generators\Uno.Extensions.Navigation.Generators.csproj" ReferenceOutputAssembly="false" />
<None Include="..\Uno.Extensions.Navigation.Generators\bin\Uno.Extensions.Navigation.Generators\$(Configuration)\netstandard2.0\Uno.Extensions.Navigation.Generators.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Uno.Extensions.Reactive/Uno.Extensions.Reactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
</ItemGroup>

<ItemGroup>
<GeneratorProjectReference Include="..\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.csproj" />
<ProjectReference Include="..\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.csproj" ReferenceOutputAssembly="false" />
<None Include="..\Uno.Extensions.Reactive.Generator\bin\Uno.Extensions.Reactive.Generator\$(Configuration)\netstandard2.0\Uno.Extensions.Reactive.Generator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit de0154a

Please sign in to comment.