forked from IllusionMods/BepisPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
83 lines (72 loc) · 3.59 KB
/
Directory.Build.props
File metadata and controls
83 lines (72 loc) · 3.59 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
<Project>
<PropertyGroup>
<!-- This is the master version, only change this one -->
<Version>21.1.2.1</Version>
<!-- Sets the 'Company' field on the dll file -->
<Authors>https://gitgoon.dev/IllusionMods/BepisPlugins</Authors>
<!-- Sets the 'Copyright' field on the dll file -->
<Copyright>Copyright GPL-3.0 © 2019</Copyright>
<!-- Sets the 'Product name' field on the dll file -->
<Product>$(MSBuildProjectName)</Product>
<!-- Sets the 'File description' field on the dll file -->
<AssemblyTitle>BepisPlugins.$(MSBuildProjectName)</AssemblyTitle>
<RootNamespace>BepisPlugins</RootNamespace>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputType>Library</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Deterministic>true</Deterministic>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>true</Optimize>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\LICENSE" Link="LICENSE" Visible="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\README.md" Link="README.md" Visible="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup Condition="'$(MSBuildProjectName.IndexOf(_))' != '-1'">
<OutputPath>..\..\bin\BepInEx\plugins\$(MSBuildProjectName.Substring(0, $(MSBuildProjectName.IndexOf('_'))))_BepisPlugins\</OutputPath>
<!--Add constants based on the first part of the project name e.g. KK-KKS_Fix_DynamicBones -> KK;KKS-->
<DefineConstants>$(MSBuildProjectName.Substring(0, $(MSBuildProjectName.IndexOf('_'))).Replace('-',';'))</DefineConstants>
</PropertyGroup>
<!--Delete unnecessary .deps.json file in build output since it's not used in plugins-->
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Delete Files="$(OutputPath)\$(MSBuildProjectName).deps.json" />
</Target>
<!--Do not copy any dlls other than the assembly itself to the build output-->
<!--The Sideloader condition is here because the a dll has to be copied from the zip package to the output and I didn't see any way of excluding just that file from this target-->
<Target Name="SkipAllRefs" AfterTargets="ResolveReferences" Condition="'$(MSBuildProjectName.IndexOf(Sideloader))' == '-1'">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
</ItemGroup>
</Target>
<!-- Allow using of the csproj properties defined above in the code itself -->
<Target Name="AddGeneratedConstantsFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedConstantsFile.cs">
<PropertyGroup>
<GeneratedText>
<![CDATA[namespace BepisPlugins {
internal static partial class Constants {
public const string Version = "$(Version)"%3B
public const string Name = "$(Product)"%3B
public const string Description = "$(AssemblyTitle)"%3B
public const string Website = "$(Authors)"%3B
public const string Copyright = "$(Copyright)"%3B
}
}]]>
</GeneratedText>
<GeneratedFilePath>$(IntermediateOutputPath)GeneratedConstantsFile.cs</GeneratedFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(GeneratedFilePath)" />
<FileWrites Include="$(GeneratedFilePath)" />
</ItemGroup>
<WriteLinesToFile Lines="$(GeneratedText)" File="$(GeneratedFilePath)" WriteOnlyWhenDifferent="true" Overwrite="true" />
</Target>
</Project>