Skip to content

Commit

Permalink
Merge pull request #220 from unoplatform/dev/ds/packaging-cleanup
Browse files Browse the repository at this point in the history
Fixing NuGet generation as Development Dependency
  • Loading branch information
dansiegel authored Mar 23, 2024
2 parents f47b65f + ee48548 commit 4930260
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Validate sample app
run: |
$msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msbuild /r /bl:.\logs\samples.binlog samples\NewTemplate\Resizetizer.Extensions.Sample.sln /p:AotAssemblies=false /p:WasmShellILLinkerEnabled=false
& $msbuild /r /bl:.\logs\samples.binlog samples\NewTemplate\build.slnf /p:AotAssemblies=false /p:WasmShellILLinkerEnabled=false
- name: Upload Artifacts
uses: actions/upload-artifact@v2
Expand Down
6 changes: 6 additions & 0 deletions samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<_ResizetizerTargetsDirectory>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', 'src', '.nuspec'))</_ResizetizerTargetsDirectory>
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(_ResizetizerTargetsDirectory)\Uno.Resizetizer.targets</AfterMicrosoftNETSdkTargets>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions samples/Legacy/Directory.build.targets

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)..\..\..\..\src\.nuspec\Uno.Resizetizer.targets</AfterMicrosoftNETSdkTargets>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
Expand Down
4 changes: 0 additions & 4 deletions samples/NewTemplate/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,4 @@
</PropertyGroup>
</When>
</Choose>

<PropertyGroup>
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)..\..\src\.nuspec\Uno.Resizetizer.targets</AfterMicrosoftNETSdkTargets>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions samples/NewTemplate/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Import Project="..\Directory.Build.targets" />
<ItemGroup>
<!-- Removes native usings to avoid Ambiguous reference -->
<Using Remove="@(Using->HasMetadata('Platform'))" />
Expand Down
14 changes: 14 additions & 0 deletions samples/NewTemplate/build.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"solution": {
"path": "Resizetizer.Extensions.Sample.sln",
"projects": [
"Resizetizer.Extensions.Sample.Mobile\\Resizetizer.Extensions.Sample.Mobile.csproj",
"Resizetizer.Extensions.Sample.Skia.Gtk\\Resizetizer.Extensions.Sample.Skia.Gtk.csproj",
"Resizetizer.Extensions.Sample.Skia.Linux.FrameBuffer\\Resizetizer.Extensions.Sample.Skia.Linux.FrameBuffer.csproj",
"Resizetizer.Extensions.Sample.Skia.WPF\\Resizetizer.Extensions.Sample.Skia.WPF.csproj",
"Resizetizer.Extensions.Sample.Wasm\\Resizetizer.Extensions.Sample.Wasm.csproj",
"Resizetizer.Extensions.Sample.Windows\\Resizetizer.Extensions.Sample.Windows.csproj",
"Resizetizer.Extensions.Sample\\Resizetizer.Extensions.Sample.csproj"
]
}
}
10 changes: 5 additions & 5 deletions src/.nuspec/Uno.Resizetizer.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<AvailableItemName Include="UnoAsset"/>
<AvailableItemName Include="UnoImage"/>
<AvailableItemName Include="UnoIcon"/>
<AvailableItemName Include="UnoSplashScreen"/>
<AvailableItemName Include="UnoAsset" Exclude="@(AvailableItemName)" />
<AvailableItemName Include="UnoImage" Exclude="@(AvailableItemName)"/>
<AvailableItemName Include="UnoIcon" Exclude="@(AvailableItemName)"/>
<AvailableItemName Include="UnoSplashScreen" Exclude="@(AvailableItemName)"/>
</ItemGroup>

<PropertyGroup>
<_UnoResizetizerTaskAssemblyName>$(MSBuildThisFileDirectory)Uno.Resizetizer_v0.dll</_UnoResizetizerTaskAssemblyName>
<_UnoResizetizerTaskAssemblyName>$(MSBuildThisFileDirectory)netstandard2.0\Uno.Resizetizer_v0.dll</_UnoResizetizerTaskAssemblyName>
</PropertyGroup>

<UsingTask
Expand Down
2 changes: 1 addition & 1 deletion src/.nuspec/Uno.Resizetizer.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Name="GenerateUnoSplashWasm"
AfterTargets="GenerateUnoSplashScreens"
DependsOnTargets="GenerateUnoSplashScreens"
Condition="'$(DesignTimeBuild)' != 'true'">
Condition="'$(DesignTimeBuild)' != 'true' AND $(OutputType) == 'Exe'">

<!--Wasm-->
<GenerateWasmSplashAssets_v0
Expand Down
Empty file removed src/.nuspec/_._
Empty file.
Binary file removed src/.nuspec/logo.png
Binary file not shown.
92 changes: 63 additions & 29 deletions src/Resizetizer/src/Resizetizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Uno.Resizetizer</RootNamespace>
<IsTool>true</IsTool>
<DevelopmentDependency>true</DevelopmentDependency>
<LangVersion>latest</LangVersion>
<Configurations>Debug;Release;DEBUG_RESIZETIZER</Configurations>
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

<!-- Version management is now done through NuGet, this avoids issues related version mismatch -->
<Version>255.255.255.255</Version>

<_SkiaPackagePath>build\</_SkiaPackagePath>
<UnoNuSpecDirectory>$(MSBuildThisFileDirectory)..\..\.nuspec\</UnoNuSpecDirectory>
<UnoNuspecDirectory>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '..', '.nuspec'))</UnoNuspecDirectory>
<DefaultLanguage>en-US</DefaultLanguage>

<IsTool>true</IsTool>
</PropertyGroup>

<PropertyGroup>
<AssemblyName>Uno.Resizetizer_v0</AssemblyName>
<PackageProjectUrl>https://github.com/unoplatform/uno.resizetizer</PackageProjectUrl>
<RepositoryCommit>$(GITVERSION_SHA)</RepositoryCommit>
<PackageId>Uno.Resizetizer</PackageId>
<Description>Uno Platform package support for images.</Description>
Expand All @@ -34,37 +32,73 @@
<EmbeddedResource Include="Resources\UnoSplash.storyboard" LogicalName="UnoSplash.storyboard" />
</ItemGroup>

<Import Project="ResizetizerPackages.projitems" />

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../../.nuspec/logo.png" Pack="true" Visible="false" PackagePath="\"/>

<!-- Make the package reference-able, but without any reference-able assembly -->
<None Include="../../.nuspec/_._" Pack="true" PackagePath="lib/$(TargetFramework)" />
<PackageReference Include="HarfBuzzSharp" Version="$(_HarfBuzzSharpVersion)" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="$(_HarfBuzzSharpVersion)" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Win32" Version="$(_HarfBuzzSharpVersion)" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.macOS" Version="$(_HarfBuzzSharpVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.7.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.7.0" />
<PackageReference Include="SkiaSharp" Version="$(_SkiaSharpVersion)" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="$(_SkiaSharpVersion)" />
<PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="$(_SkiaSharpVersion)" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="$(_SkiaSharpVersion)" />
<PackageReference Include="SkiaSharp.HarfBuzz" Version="$(_SkiaSharpVersion)" />
<PackageReference Include="ExCSS" Version="4.2.3" />
<PackageReference Include="Svg.Skia" Version="$(SvgSkiaPackageVersion)" />
<PackageReference Include="Svg.Custom" Version="$(SvgSkiaPackageVersion)" />
<PackageReference Include="Svg.Model" Version="$(SvgSkiaPackageVersion)" />
<PackageReference Include="ShimSkiaSharp" Version="$(SvgSkiaPackageVersion)" />
<PackageReference Include="Fizzler" Version="$(FizzlerPackageVersion)" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="System.IO.UnmanagedMemoryStream" Version="4.3.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.ObjectModel" Version="4.3.0" />
<PackageReference Include="Mono.ApiTools.MSBuildTasks" Version="0.1.0" />
</ItemGroup>

<ItemGroup>
<None Include="../../../README.md" Pack="true" PackagePath="/" />

<None Include="@(_ResizetizerFiles)" Visible="false" Pack="true" PackagePath="build/%(Arch)" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(OutputPath)$(AssemblyName).dll" Visible="false" Pack="true" PackagePath="build" />
<None Include="$(OutputPath)$(AssemblyName).pdb" Visible="false" Pack="true" PackagePath="build" />
<None Include="../../.nuspec/Uno.Resizetizer.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../.nuspec/Uno.Resizetizer.android.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).android.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../.nuspec/Uno.Resizetizer.apple.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).apple.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../.nuspec/Uno.Resizetizer.wasm.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).wasm.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../.nuspec/Uno.Resizetizer.windows.skia.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).windows.skia.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(UnoNuspecDirectory)Uno.Resizetizer.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(UnoNuspecDirectory)Uno.Resizetizer.android.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).android.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(UnoNuspecDirectory)Uno.Resizetizer.apple.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).apple.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(UnoNuspecDirectory)Uno.Resizetizer.wasm.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).wasm.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(UnoNuspecDirectory)Uno.Resizetizer.windows.skia.targets" Visible="false" Pack="true" PackagePath="build/$(PackageId).windows.skia.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<Target Name="_CopyToNuspecDir" AfterTargets="Build">
<Import Project="../Directory.UnoMetadata.targets" />

<Target Name="PackNuGetLockFiles"
BeforeTargets="DownloadAndSetPackageIcon;Pack;GenerateNuspec">
<ItemGroup>
<_CopyItems Include="$(TargetDir)**\*.dll" Exclude="$(TargetDir)System.*.dll" />
<_CopyItems Include="$(TargetDir)**\*.so" />
<_CopyItems Include="$(TargetDir)**\*.pdb" />
<_CopyItems Include="$(TargetDir)**\*.dylib" />
<_CopyItems Include="$(TargetDir)**\*.pdb" />
<None Include="@(ReferenceCopyLocalPaths)" Pack="true" PackagePath="$(BuildOutputTargetFolder)/$(TargetFramework)" />
<None Include="@(RuntimeTargetsCopyLocalItems)" Pack="true" PackagePath="$(BuildOutputTargetFolder)/$(TargetFramework)/%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier)" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(UnoNuSpecDirectory)%(RecursiveDir)" ContinueOnError="true" Retries="0" />
</Target>

<Import Project="../Directory.UnoMetadata.targets" />
<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)')"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" />
</Target>

</Project>
Loading

0 comments on commit 4930260

Please sign in to comment.