Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
58 lines (55 loc) · 4.5 KB
/
Copy pathDirectory.Build.props
File metadata and controls
58 lines (55 loc) · 4.5 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
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>disable</Nullable>
<LangVersion>latest</LangVersion>
<GameDir Condition="'$(GameDir)' == ''">H:\SteamLibrary\steamapps\common\Nivalis Nights</GameDir>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
</PropertyGroup>
<ItemGroup>
<Reference Include="BepInEx.Core"><HintPath>$(GameDir)\BepInEx\core\BepInEx.Core.dll</HintPath><Private>false</Private></Reference>
<Reference Include="BepInEx.Unity.IL2CPP"><HintPath>$(GameDir)\BepInEx\core\BepInEx.Unity.IL2CPP.dll</HintPath><Private>false</Private></Reference>
<Reference Include="0Harmony"><HintPath>$(GameDir)\BepInEx\core\0Harmony.dll</HintPath><Private>false</Private></Reference>
<Reference Include="Il2CppInterop.Runtime"><HintPath>$(GameDir)\BepInEx\core\Il2CppInterop.Runtime.dll</HintPath><Private>false</Private></Reference>
<Reference Include="Assembly-CSharp"><HintPath>$(GameDir)\BepInEx\interop\Assembly-CSharp.dll</HintPath><Private>false</Private></Reference>
<Reference Include="Il2Cppmscorlib"><HintPath>$(GameDir)\BepInEx\interop\Il2Cppmscorlib.dll</HintPath><Private>false</Private></Reference>
<Reference Include="UnityEngine.CoreModule"><HintPath>$(GameDir)\BepInEx\interop\UnityEngine.CoreModule.dll</HintPath><Private>false</Private></Reference>
</ItemGroup>
<!-- NoDeploy=true keeps a project out of the game folder (e.g. the Order Fix editions share a GUID).
DeployIfInstalled=true (test mods) only updates a copy already in plugins, so a build doesn't put test mods
back into a play setup; to start testing, copy the DLL in once (or move it back from plugins_hold). -->
<Target Name="CopyToPlugins" AfterTargets="Build"
Condition="'$(NoDeploy)' != 'true' And ('$(DeployIfInstalled)' != 'true' Or Exists('$(GameDir)\BepInEx\plugins\$(TargetFileName)'))">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(GameDir)\BepInEx\plugins" />
</Target>
<Target Name="Package" AfterTargets="Build" Condition="'$(Configuration)' == 'Release' And '$(NoRelease)' != 'true'">
<PropertyGroup>
<StageDir>$(RepoRoot)dist\$(AssemblyName)\</StageDir>
</PropertyGroup>
<RemoveDir Directories="$(StageDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(StageDir)BepInEx\plugins" />
<!-- XML docs, for projects that generate them (the kit), so modders get IntelliSense. -->
<Copy SourceFiles="$(TargetDir)$(AssemblyName).xml" DestinationFolder="$(StageDir)BepInEx\plugins"
Condition="'$(GenerateDocumentationFile)' == 'true' And Exists('$(TargetDir)$(AssemblyName).xml')" />
<!-- Thunderstore / LUZ metadata at the zip root: manifest.json, icon.png (256x256), README.md. A project sets
TsName (letters, digits, _), TsDescription (250 characters at most, no ; or "), TsWebsite and TsDependencies
(Team-Name-Version, separated by ;). No BepInEx dependency: Thunderstore's pack is an older build than the one
the mods are tested on, and launchers install BepInEx separately. -->
<PropertyGroup>
<TsName Condition="'$(TsName)' == ''">$(AssemblyName)</TsName>
</PropertyGroup>
<ItemGroup>
<_TsDependency Include="$(TsDependencies)" />
</ItemGroup>
<PropertyGroup>
<_TsDependencyJson>@(_TsDependency->'"%(Identity)"', ', ')</_TsDependencyJson>
</PropertyGroup>
<WriteLinesToFile File="$(StageDir)manifest.json" Overwrite="true" Lines="{; "name": "$(TsName)",; "version_number": "$(Version)",; "website_url": "$(TsWebsite)",; "description": "$(TsDescription)",; "dependencies": [$(_TsDependencyJson)];}" />
<Copy SourceFiles="$(MSBuildProjectDirectory)\icon.png" DestinationFolder="$(StageDir)" Condition="Exists('$(MSBuildProjectDirectory)\icon.png')" />
<Copy SourceFiles="$(MSBuildProjectDirectory)\README.md" DestinationFolder="$(StageDir)" Condition="Exists('$(MSBuildProjectDirectory)\README.md')" />
<Copy SourceFiles="$(RepoRoot)README.md" DestinationFolder="$(StageDir)" Condition="!Exists('$(MSBuildProjectDirectory)\README.md') And Exists('$(RepoRoot)README.md')" />
<Warning Text="$(AssemblyName): no icon.png for the release zip (Thunderstore needs a 256x256 PNG)" Condition="!Exists('$(MSBuildProjectDirectory)\icon.png')" />
<MakeDir Directories="$(RepoRoot)releases" />
<ZipDirectory SourceDirectory="$(StageDir)" DestinationFile="$(RepoRoot)releases\$(AssemblyName)-$(Version).zip" Overwrite="true" />
</Target>
</Project>