-
-
Notifications
You must be signed in to change notification settings - Fork 474
/
Harmony.csproj
192 lines (174 loc) · 9.25 KB
/
Harmony.csproj
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net35;net452;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Product>Harmony</Product>
<Company>Andreas Pardeike</Company>
<Copyright>Copyright © 2016</Copyright>
<Description>A general non-destructive patch library for .NET and Mono modules</Description>
<PackageId>Lib.Harmony</PackageId>
<PackageId Condition="'$(Configuration)'=='DebugThin' Or '$(Configuration)'=='ReleaseThin'">Lib.Harmony.Thin</PackageId>
<Authors>Andreas Pardeike</Authors>
<AssemblyName>0Harmony</AssemblyName>
<SignAssembly>true</SignAssembly>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/pardeike/Harmony</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>Harmony,Mono,Patch,Patching,Runtime,Detour,Detours,Aspect,Aspects</PackageTags>
<PackageIcon>HarmonyLogo.png</PackageIcon>
<PackageIconUrl>https://raw.githubusercontent.com/pardeike/Harmony/master/HarmonyLogo.png</PackageIconUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LogFile>obj/docfx-$(TargetFramework).log</LogFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>preview</LangVersion>
<DefaultItemExcludes>$(DefaultItemExcludes);Documentation/**</DefaultItemExcludes>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<Version>$(HarmonyVersion)</Version>
<AssemblyVersion>$(HarmonyVersion)</AssemblyVersion>
<FileVersion>$(HarmonyVersion)</FileVersion>
<PackageVersion>$(HarmonyVersion)$(HarmonyPrerelease)</PackageVersion>
<InformationalVersion>$(HarmonyVersion)$(HarmonyPrerelease)</InformationalVersion>
<NoWarn>$(NoWarn);SYSLIB0011;NU5131</NoWarn>
<Configurations>DebugThin;DebugFat;ReleaseThin;ReleaseFat;ReleaseRef</Configurations>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ILRepackTargetsFile>$(SolutionDir)ILRepack.targets</ILRepackTargetsFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<ClearOutputDirectory>True</ClearOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0' Or '$(TargetFramework)'=='net6.0' Or '$(TargetFramework)'=='net7.0' Or '$(TargetFramework)'=='net8.0'">
<IsNET5OrGreater>true</IsNET5OrGreater>
</PropertyGroup>
<PropertyGroup Condition="'$(IsNET5OrGreater)' != 'true'">
<IsNET5OrGreater>false</IsNET5OrGreater>
</PropertyGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\LICENSE" Pack="true" PackagePath="" />
<None Include="..\HarmonyLogo.png" Pack="true" Visible="false" PackagePath="" />
<None Include="..\_._" Pack="true" Visible="false" PackagePath="lib/netstandard2.0" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)'=='DebugThin' Or '$(Configuration)'=='DebugFat'">
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='ReleaseThin'">
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='ReleaseFat'">
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
</PropertyGroup>
<ItemGroup Condition="'$(Configuration)'=='DebugThin' Or '$(Configuration)'=='ReleaseThin'">
<PackageReference Include="MonoMod.Core" Version="$(MonoModCoreVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='DebugFat' Or '$(Configuration)'=='ReleaseFat' Or '$(Configuration)'=='ReleaseRef'">
<PackageReference Include="MonoMod.Core" Version="$(MonoModCoreVersion)" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.26" PrivateAssets="all" />
<!-- Reference assemblies are needed for non-Windows .NET Framework targeting builds. -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
<!-- netstandard2.0 reference assemblies -->
<PropertyGroup Condition="$(Configuration)!='ReleaseRef' AND $(TargetFramework)=='netstandard2.0'">
<!-- Remove from /lib in NuGet -->
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
<ItemGroup Condition="$(Configuration)!='ReleaseRef' AND $(TargetFramework)=='netstandard2.0'">
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" PrivateAssets="all" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="$(Configuration)!='ReleaseRef' AND $(TargetFramework)=='netstandard2.0'">
<PackageReference Include="Lib.Harmony.Ref" Version="$(HarmonyVersion)" IncludeAssets="contentFiles" />
</ItemGroup>
<!-- netstandard2.0 reference assemblies -->
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="System.Text.Json" Version="7.0.4" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>
<ItemGroup Condition="!$(IsNET5OrGreater)">
<Compile Remove="**\*.net5.cs" />
<Compile Remove="**\*.net6.cs" />
<Compile Remove="**\*.net7.cs" />
<Compile Remove="**\*.net8.cs" />
</ItemGroup>
<Target Name="RemoveOldNuGetPackages" BeforeTargets="PreBuildEvent">
<PropertyGroup>
<WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)</WorkingDirectory>
</PropertyGroup>
<ItemGroup>
<OldNugetPackages Include="$(WorkingDirectory)\$(PackageId).*.nupkg" Exclude="$(WorkingDirectory)\$(PackageId).$(Version).nupkg" />
</ItemGroup>
<Delete Files="@(OldNugetPackages)" />
</Target>
<Target Name="RemoveFaultyPdb" BeforeTargets="Build">
<ItemGroup>
<FilesToDelete Include="$(ProjectDir)\$(OutDir)\MonoMod.ILHelpers.pdb"/>
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
</Target>
<Target Name="CleanZip" AfterTargets="Clean">
<ItemGroup>
<OldZipFiles Include="$(MSBuildThisFileDirectory)bin\Harmony-Thin.*.zip" Condition="'$(Configuration)'=='ReleaseThin'"/>
<OldZipFiles Include="$(MSBuildThisFileDirectory)bin\Harmony-Fat.*.zip" Condition="'$(Configuration)'=='ReleaseFat'"/>
</ItemGroup>
<Delete Files="@(OldZipFiles)" />
</Target>
<Target Name="RemoveExtraDlls" AfterTargets="Pack">
<ItemGroup>
<ExtraDlls Include="$(MSBuildThisFileDirectory)bin\**\MonoMod.*.*" />
<ExtraDlls Include="$(MSBuildThisFileDirectory)bin\**\Mono.*.*" />
<ExtraDlls Include="$(MSBuildThisFileDirectory)bin\**\System.*.*" />
</ItemGroup>
<Delete Files="@(ExtraDlls)" />
</Target>
<Target Name="Zip" AfterTargets="RemoveExtraDlls" DependsOnTargets="CleanZip">
<ZipDirectory SourceDirectory="$(MSBuildThisFileDirectory)bin\$(Configuration)" DestinationFile="$(MSBuildThisFileDirectory)bin\Harmony-Thin.$(Version).zip" Overwrite="true" Condition="'$(Configuration)'=='ReleaseThin'"/>
<ZipDirectory SourceDirectory="$(MSBuildThisFileDirectory)bin\$(Configuration)" DestinationFile="$(MSBuildThisFileDirectory)bin\Harmony-Fat.$(Version).zip" Overwrite="true" Condition="'$(Configuration)'=='ReleaseFat'"/>
</Target>
<!-- ReleaseRef -->
<PropertyGroup Condition="$(Configuration)=='ReleaseRef'">
<TargetFrameworks>netstandard2.0;</TargetFrameworks>
<PackageId>Lib.Harmony.Ref</PackageId>
<!-- Remove from /lib in NuGet -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- Create reference Assemblies instead of a full assembly -->
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
<!-- Add our target for packing -->
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRefAssemblyToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<ItemGroup Condition="$(Configuration)=='ReleaseRef'">
<!-- Adding System.Reflection.Emit.* because there are public types exposed from its's package -->
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" IncludeAssets="compile" />
<None Remove="_._" />
</ItemGroup>
<Target Name="AddRefAssemblyToPackage" Condition="$(Configuration)=='ReleaseRef'">
<ItemGroup>
<!-- Adding the Reference Assembly and the xml documentation to /ref of NuGet -->
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).dll">
<PackagePath>ref/netstandard2.0</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).xml">
<PackagePath>ref/netstandard2.0</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<!-- ReleaseRef -->
</Project>