-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
105 lines (96 loc) · 4.37 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
105 lines (96 loc) · 4.37 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
<Project>
<!--
This is a special file that contains shared configuration
for all project files in subdirectories.
-->
<Sdk Name="ThunderPipe.Sdk" Version="0.1.6" />
<PropertyGroup>
<!-- Set additional NuGet sources -->
<RestoreAdditionalProjectSources>
https://nuget.bepinex.dev/v3/index.json;
https://nuget.windows10ce.com/nuget/v3/index.json
</RestoreAdditionalProjectSources>
<!--
Conditions for ThunderPipe.Sdk to Pack, and Publish to Thunderstore
Learn more: https://github.com/WarperSan/ThunderPipe/blob/master/ThunderPipe.Sdk/README.md
-->
<RunThunderPipePackAfterBuild
Condition="'$(RunThunderPipePackAfterBuild)' != 'false' And '$(IsThunderstorePackable)' == 'true' And '$(Configuration)' == 'Release'"
>true</RunThunderPipePackAfterBuild
>
<RunThunderPipePublishAfterBuild
Condition="'$(RunThunderPipePublishAfterBuild)' != 'false' And '$(RunThunderPipePackAfterBuild)' == 'true' And '$(PublishTS)' == 'true'"
>true</RunThunderPipePublishAfterBuild
>
</PropertyGroup>
<!-- Build dependencies -->
<ItemGroup>
<!--
If you upload your project on NuGet, PrivateAssets="all"
prevents consumers of your package from referencing these
packages transitively. This is desired because these packages
are not required by anyone using your package as they are
code analyzers, source generators, or other build-only packages.
-->
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.3" PrivateAssets="all" />
<PackageReference Include="Hamunii.BepInEx.AutoPlugin" Version="2.1.*" PrivateAssets="all" />
<!-- Source-only polyfills for C# language features https://github.com/Sergio0694/PolySharp -->
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
</ItemGroup>
<!-- Modding dependencies -->
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<!-- In reality BepInEx 5.4.21 ships HarmonyX 2.9 but BepInEx.Core gives us 2.7 -->
<PackageReference Include="HarmonyX" Version="2.9.0" />
</ItemGroup>
<!-- NuGet fallback stripped game references -->
<ItemGroup Condition="!Exists('$(ManagedDir)')">
<PackageReference Include="UnityEngine.Modules" Version="6000.0.36" PrivateAssets="all" />
</ItemGroup>
<!-- Local game references -->
<ItemGroup Condition="Exists('$(ManagedDir)')">
<!--
Reference all assemblies except ones that come
with our target framework or would cause conflicts.
Private="false" prevents these from being copied to build output.
-->
<LocalReferences
Include="$(ManagedDir)*.dll"
Exclude="$(ManagedDir)Mono*.dll;$(ManagedDir)netstandard.dll;$(ManagedDir)System*.dll;$(ManagedDir)mscorlib.dll"
/>
<Reference Include="@(LocalReferences)" Private="false" />
<!--
Publicize these assemblies so we can access their internal members.
Learn more at: https://github.com/BepInEx/BepInEx.AssemblyPublicizer
-->
<Reference Include="$(ManagedDir)Assembly-CSharp.dll" Private="false" Publicize="true" />
</ItemGroup>
<!-- Copy mod files defined in projects to the target BepInEx directory -->
<Target Name="DeployFiles" AfterTargets="Build" Condition="'$(DeployModFiles)' == 'true'">
<PropertyGroup>
<_TargetDir>$([MSBuild]::NormalizeDirectory($(PEAKBepInExDir)))</_TargetDir>
</PropertyGroup>
<Message
Text="Deploy → @(ModFile -> '%(Destination)%(FileName)%(Extension)')"
Importance="High"
/>
<Error
Text="BepInEx directory '$(_TargetDir)' doesn't exist! Configure PEAKBepInExDir to point to a valid path in the Config.Build.user.props file."
Condition="!Exists('$(_TargetDir)')"
/>
<Copy SourceFiles="@(ModFile)" DestinationFolder="$(_TargetDir)%(Destination)" />
</Target>
<Target Name="MapModFilesForThunderPipe" AfterTargets="Build" BeforeTargets="ThunderPipePack">
<ItemGroup>
<ThunderstoreFile Include="@(ModFile)" />
</ItemGroup>
</Target>
<Target
Name="EnsureReleaseOnPublishTS"
BeforeTargets="ThunderPipePublish"
Condition="'$(RunThunderPipePublishAfterBuild)' == 'true' And '$(Configuration)' != 'Release'"
>
<Error Text="Release configuration must be used when publishing Thunderstore package." />
</Target>
</Project>