Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
110 lines (96 loc) · 4.99 KB
/
Copy pathDirectory.Build.props
File metadata and controls
110 lines (96 loc) · 4.99 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
108
109
110
<Project>
<PropertyGroup>
<!-- This is the master version, only change this one -->
<Version>5.1.1</Version>
<!-- Sets the 'Company' field on the dll file -->
<Authors>https://github.com/IllusionMods/BetterPenetration</Authors>
<!-- Sets the 'Copyright' field on the dll file -->
<Copyright>Copyright GPL-3.0 © 2020</Copyright>
<!-- Sets the 'Product name' field on the dll file -->
<Product>BetterPenetration</Product>
<!-- Sets the 'File description' field on the dll file -->
<AssemblyTitle>Make penetration look a bit more realistic and overall improve the HScene experience</AssemblyTitle>
<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>
<!--Copy readme and license to output dir so they are included in releases-->
<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>
<None Include="..\Better Penetration Frequently Asked Questions.pdf" Link="Better Penetration Frequently Asked Questions.pdf" Visible="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Better Penetration Studio Instructions.pdf" Link="Better Penetration Studio Instructions.pdf" Visible="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup Condition="'$(MSBuildProjectName.IndexOf(_))' != '-1'">
<!--Add constants based on the project name e.g. KK-KKS_Fix_DynamicBones -> KK;KKS;Fix;DynamicBones-->
<DefineConstants>$(MSBuildProjectName.Replace('-',';').Replace('_',';'))</DefineConstants>
<!--Group assemblies for the same game into the same folder so they are later zipped together as one-->
<OutputPath>..\bin\$(MSBuildProjectName.Substring(0, $(MSBuildProjectName.IndexOf('_'))))\</OutputPath>
</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-->
<Target Name="SkipAllRefs" AfterTargets="ResolveReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
</ItemGroup>
</Target>
<!-- Create a release zip file (after successful Release build). Main game project depends on studio project so only make relases of non-studio projects -->
<Target Name="CreateReleaseZip" AfterTargets="Build" Condition="'$(Configuration)' == 'Release' AND '$(MSBuildProjectName.IndexOf(_Studio_))' == '-1'">
<PropertyGroup>
<CopyDir>$(OutputPath)\..\TEMP_COPY_$(AssemblyName)</CopyDir>
</PropertyGroup>
<RemoveDir Directories="$(CopyDir)" />
<ItemGroup>
<BuildFiles Include="$(OutputPath)\*"/>
</ItemGroup>
<Copy DestinationFolder="$(CopyDir)\BepInEx\plugins\$(Product)" SourceFiles="@(BuildFiles)" />
<ItemGroup>
<ZipmodFiles Include="..\mods\$(MSBuildProjectName.Substring(0, $(MSBuildProjectName.IndexOf('_'))))\*"/>
</ItemGroup>
<Copy SourceFiles="@(ZipmodFiles)" DestinationFolder="$(CopyDir)\mods\BetterPenetration" />
<!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/zipdirectory-task?view=vs-2022 -->
<ZipDirectory SourceDirectory="$(CopyDir)" DestinationFile="$(OutputPath)\..\$(AssemblyName)_v$(Version).zip" Overwrite="true" />
<RemoveDir Directories="$(CopyDir)" />
</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 $(RootNamespace) {
internal static 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>