-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPdnV5EffectSamples.csproj
More file actions
107 lines (103 loc) · 5.43 KB
/
PdnV5EffectSamples.csproj
File metadata and controls
107 lines (103 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Set this to the location where you have Paint.NET installed. If you have the Microsoft
Store version, you should download the portable version and point this at that. -->
<PdnRoot>C:\Program Files\paint.net</PdnRoot>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net9.0-windows</TargetFramework>
<RootNamespace>PaintDotNet.Effects.Samples</RootNamespace>
<Nullable>enable</Nullable>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<!-- This is necessary so that the build copies the version of nuget packages we're referencing,
instead of copying the ones that Paint.NET is using (which may be trimmed and/or a different version) -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<Deterministic>False</Deterministic>
<AssemblyVersion>5.1.*</AssemblyVersion>
</PropertyGroup>
<PropertyGroup>
<!-- MSB3277 removes the harmless and unhelpful warning about assembly version "conflicts" (e.g. System.Runtime.Serialization.Formatters) -->
<NoWarn>1701;1702;CS7035;MSB3277</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoConstructor" Version="5.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ComputeSharp.D2D1" Version="3.0.1" />
<PackageReference Include="ILRepack" Version="2.0.35">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.ILLink.Tasks" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<!-- Be sure to set Private=False (aka CopyLocal=false) on the Paint.NET assemblies
so they are not copied to the output folder -->
<Reference Include="PaintDotNet.Base">
<HintPath>$(PdnRoot)\PaintDotNet.Base.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.ComponentModel">
<HintPath>$(PdnRoot)\PaintDotNet.ComponentModel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Core">
<HintPath>$(PdnRoot)\PaintDotNet.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Effects.Core">
<HintPath>$(PdnRoot)\PaintDotNet.Effects.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Effects.Gpu">
<HintPath>$(PdnRoot)\PaintDotNet.Effects.Gpu.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Fundamentals">
<HintPath>$(PdnRoot)\PaintDotNet.Fundamentals.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Framework">
<HintPath>$(PdnRoot)\PaintDotNet.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Primitives">
<HintPath>$(PdnRoot)\PaintDotNet.Primitives.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.PropertySystem">
<HintPath>$(PdnRoot)\PaintDotNet.PropertySystem.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Windows">
<HintPath>$(PdnRoot)\PaintDotNet.Windows.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Windows.Core">
<HintPath>$(PdnRoot)\PaintDotNet.Windows.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PaintDotNet.Windows.Framework">
<HintPath>$(PdnRoot)\PaintDotNet.Windows.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<Target Name="TrimAndMerge" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' == 'Release'">
<!-- Nuget documentation for $(PkgPackage_Name) properties: https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files -->
<!-- Trimming with ILLink -->
<Exec Command="dotnet exec "$(PkgMicrosoft_NET_ILLink_Tasks)\tools\net9.0\illink.dll" -a "$(TargetPath)" all --trim-mode copy --action copy -d $(TargetDir) --skip-unresolved --action link "ComputeSharp.Core" --action link "ComputeShare.D2D1" -out "$(TargetDir)output"" />
<!-- Merge with ILRepack. -->
<Exec Command=""$(PkgILRepack)\tools\ilrepack" /internalize /union "$(TargetDir)output\$(TargetName).dll" "$(TargetDir)output\ComputeSharp.Core.dll" "$(TargetDir)output\ComputeSharp.D2D1.dll" /lib:"$(PdnRoot)" /out:"$(TargetPath)"" />
<!-- Remove the output directory and its contents created by illink -->
<Delete Files="$(TargetDir)output" ContinueOnError="false" />
<RemoveDir Directories="$(TargetDir)output" ContinueOnError="false" />
<!-- Remove ComputeSharp DLLs that are now merged -->
<Delete Files="$(TargetDir)ComputeSharp.Core.dll" ContinueOnError="false" />
<Delete Files="$(TargetDir)ComputeSharp.D2D1.dll" ContinueOnError="false" />
</Target>
</Project>