-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
70 lines (63 loc) · 4.08 KB
/
Directory.Build.targets
File metadata and controls
70 lines (63 loc) · 4.08 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
<Project>
<PropertyGroup Condition="'$(CI)' != 'true'">
<RestoreAdditionalProjectSources>
https://nuget.bepinex.dev/v3/index.json;
https://nuget.windows10ce.com/nuget/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true'">
<RestoreAdditionalProjectSources>
https://nuget.bepinex.dev/v3/index.json;
https://nuget.windows10ce.com/nuget/v3/index.json;
https://nuget.pkg.github.com/adeithe/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
<!-- Modding dependencies -->
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<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.0.*" PrivateAssets="all" />
</ItemGroup>
<!-- NuGet fallback stripped game references -->
<ItemGroup Condition="!Exists('$(ManagedDir)') And '$(CI)' != 'true'">
<PackageReference Include="UnityEngine.Modules" Version="6000.0.36" PrivateAssets="all" />
</ItemGroup>
<!-- NuGet game references for CI/CD -->
<ItemGroup Condition="!Exists('$(ManagedDir)') And '$(CI)' == 'true'">
<PackageReference Include="Adeithe.GameModding.PEAKRef" Version="*" Private="true" PrivateAssets="all" />
</ItemGroup>
<!-- Local game references -->
<ItemGroup Condition="Exists('$(ManagedDir)') And '$(CI)' != 'true'">
<LocalReferences
Include="$(ManagedDir)*.dll"
Exclude="$(ManagedDir)Mono*.dll;$(ManagedDir)netstandard.dll;$(ManagedDir)System*.dll;$(ManagedDir)mscorlib.dll" />
<Reference Include="@(LocalReferences)" Private="false" />
<!-- <Reference Include="$(ManagedDir)Assembly-CSharp.dll" Private="false" Publicize="true" /> -->
</ItemGroup>
<!-- Packages the project for use by Thunderstore -->
<Target Name="PackageTS" AfterTargets="Build" Condition="'$(PublishTS)' != 'true' And '$(ThunderstorePackable)' != 'false'">
<Error Text="PublishTS may not call PackageTS" Condition="'$(PublishTS)' == 'true'" />
<PropertyGroup>
<ThunderstoreCLIEnvironment Condition="'$(BuildingInsideVisualStudio)' == 'true'">NO_COLOR=1</ThunderstoreCLIEnvironment>
<ThunderstoreArchiveDir>$(SolutionRoot)artifacts/thunderstore/$(AssemblyTitle)/</ThunderstoreArchiveDir>
<ThunderstoreConfigPath Condition="'$(Configuration)' == 'Debug'">thunderstore.debug.toml</ThunderstoreConfigPath>
<ThunderstoreConfigPath Condition="'$(Configuration)' == 'Release'">thunderstore.toml</ThunderstoreConfigPath>
<ThunderstorePackageDir Condition="'$(Configuration)' == 'Debug'">$(ThunderstoreArchiveDir)debug/</ThunderstorePackageDir>
<ThunderstorePackageDir Condition="'$(Configuration)' == 'Release'">$(ThunderstoreArchiveDir)release/</ThunderstorePackageDir>
<ThunderstorePackagePath>$(ThunderstorePackageDir)$(Company)-$(AssemblyTitle)-$(Version).zip</ThunderstorePackagePath>
</PropertyGroup>
<Exec Command="dotnet tool restore" EnvironmentVariables="$(ThunderstoreCLIEnvironment)" StandardOutputImportance="low" />
<Exec Command="dotnet tcli build --config-path $(ThunderstoreConfigPath) --package-version $(Version)" EnvironmentVariables="$(ThunderstoreCLIEnvironment)" />
</Target>
<!-- Publish Package by calling `dotnet build -c Release -target:PublishTS -v d` -->
<Target Name="PublishTS" Condition="'$(ThunderstorePackable)' != 'false'">
<Error Text="PublishTS must be called with Release configuration." Condition="'$(Configuration)' != 'Release'" />
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Build" Properties="PublishTS=true;Configuration=$(Configuration)" />
<Exec Command="dotnet tool restore" StandardOutputImportance="low" />
<PropertyGroup>
<TCLIAuthToken Condition="'$(TCLIAuthToken)' == ''">$(TCLI_AUTH_TOKEN)</TCLIAuthToken>
</PropertyGroup>
<Exec Command="dotnet tcli publish --package-version $(Version)" EnvironmentVariables="TCLI_AUTH_TOKEN=$(TCLIAuthToken)" />
</Target>
</Project>