Skip to content

Commit

Permalink
Merge pull request #223 from unoplatform/dev/ds/runtimes
Browse files Browse the repository at this point in the history
Fixing output directory for Runtime Assets
  • Loading branch information
dansiegel authored Mar 25, 2024
2 parents 4930260 + ea9cc0d commit 9e896ef
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Resizetizer/src/Resizetizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,29 +74,36 @@

<Import Project="../Directory.UnoMetadata.targets" />

<Target Name="GatherRuntimeAssets"
BeforeTargets="PackNuGetLockFiles;CopyAssetsForSampleProject">
<ItemGroup>
<_RuntimeAssets Include="@(RuntimeTargetsCopyLocalItems)"
OutputDirectory="$([System.Text.RegularExpressions.Regex]::Replace(%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier), '^(linux|win)-', ''))"
Condition="%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier) != 'win' AND %(RuntimeTargetsCopyLocalItems.RuntimeIdentifier) != 'unix'" />
</ItemGroup>
</Target>

<Target Name="PackNuGetLockFiles"
BeforeTargets="DownloadAndSetPackageIcon;Pack;GenerateNuspec">
<ItemGroup>
<None Include="@(ReferenceCopyLocalPaths)" Pack="true" PackagePath="$(BuildOutputTargetFolder)/$(TargetFramework)" />
<None Include="@(RuntimeTargetsCopyLocalItems)" Pack="true" PackagePath="$(BuildOutputTargetFolder)/$(TargetFramework)/%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier)" />
<None Include="@(_RuntimeAssets)" Pack="true" PackagePath="$(BuildOutputTargetFolder)/$(TargetFramework)/%(_RuntimeAssets.OutputDirectory)" />
</ItemGroup>
</Target>

<Target Name="CopyAssetsForSampleProject"
AfterTargets="Build">
<ItemGroup>
<_OutputFile Include="$(OutDir)\**\*.*" Exclude="$(OutDir)\**\*.targets"/>
<_RuntimeLibrary Include="@(RuntimeTargetsCopyLocalItems)"
OutputDirectory="$([MSBuild]::NormalizeDirectory('$(UnoNuspecDirectory)', '$(TargetFramework)\%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier)'))" />
</ItemGroup>

<Copy SourceFiles="@(_OutputFile)"
DestinationFiles="@(_OutputFile->'$(UnoNuspecDirectory)$(TargetFramework)\%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" />

<Copy SourceFiles="@(_RuntimeLibrary)"
DestinationFiles="@(_RuntimeLibrary->'%(OutputDirectory)\%(Filename)%(Extension)')"
<Copy SourceFiles="@(_RuntimeAssets)"
DestinationFiles="@(_RuntimeAssets->'$(UnoNuspecDirectory)$(TargetFramework)\%(OutputDirectory)\%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" />
</Target>
Expand Down

0 comments on commit 9e896ef

Please sign in to comment.