forked from Rollocraft/CS2MultiplayerMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCS2MPMod.csproj
More file actions
180 lines (165 loc) · 8.46 KB
/
Copy pathCS2MPMod.csproj
File metadata and controls
180 lines (165 loc) · 8.46 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Release</Configurations>
<AssemblyName>CS2MPMod</AssemblyName>
<!-- Prefer the user-installed CS2 toolchain, but allow the setup script or CI
to provide an explicit path without editing this project file. -->
<Cs2ToolPath Condition="'$(Cs2ToolPath)' == ''">$(CSII_TOOLPATH)</Cs2ToolPath>
<Cs2ToolPath Condition="'$(Cs2ToolPath)' == ''">$([System.Environment]::GetEnvironmentVariable('CSII_TOOLPATH', 'EnvironmentVariableTarget.User'))</Cs2ToolPath>
<ManagedPath Condition="'$(ManagedPath)' == ''">$(CSII_MANAGEDPATH)</ManagedPath>
<!--The file where mod information which is required for publishing mod on PDX mods are stored-->
<PublishConfigurationPath>Properties\PublishConfiguration.xml</PublishConfigurationPath>
</PropertyGroup>
<!--The .pdb ships with the mod (it is what gives players' crash reports file and line
numbers), so the paths inside it are public. PathMap rewrites them to a repo-relative
prefix, and SourceLink is off because its JSON records the absolute build root.-->
<PropertyGroup>
<PathMap>$(MSBuildProjectDirectory)\=CS2MPMod\</PathMap>
<EnableSourceLink>false</EnableSourceLink>
<DebugType>portable</DebugType>
</PropertyGroup>
<!--The per-entity occupancy/household trace lines (see Game/Diagnostics/DevTrace.cs).
Off in a shipped build; turn them on with: dotnet build -p:MpDevTrace=true-->
<PropertyGroup Condition="'$(MpDevTrace)' == 'true'">
<DefineConstants>$(DefineConstants);MP_DEV_TRACE</DefineConstants>
</PropertyGroup>
<!--The mod's real version lives in PublishConfiguration.xml - it is what the store shows and
what a player quotes in a report. Stamp it into the assembly so the log and the handshake can
report it: the assembly version stays 1.0.0.0 across releases, so while that was the source
every build introduced itself as the same version to its peer.-->
<Target Name="StampModVersion" BeforeTargets="GetAssemblyAttributes;GenerateAssemblyInfo">
<XmlPeek XmlInputPath="$(PublishConfigurationPath)" Query="/Publish/ModVersion/@Value">
<Output TaskParameter="Result" PropertyName="PublishedModVersion"/>
</XmlPeek>
<PropertyGroup Condition="'$(PublishedModVersion)' != ''">
<InformationalVersion>$(PublishedModVersion)</InformationalVersion>
</PropertyGroup>
</Target>
<!--Imports must be after PropertyGroup block-->
<Import Project="$(Cs2ToolPath)\Mod.props" />
<Import Project="$(Cs2ToolPath)\Mod.targets" />
<ItemGroup>
<Reference Include="Game">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.Core">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.Collections">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.Logging">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.IO.AssetDatabase">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.AssetPipeline">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.UI">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.UI.Binding">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.Localization">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.Mathematics">
<Private>false</Private>
</Reference>
<Reference Include="Colossal.PSI.Common">
<Private>false</Private>
</Reference>
<!--No reference to Steamworks here, deliberately: the game refuses to load a mod
whose declared references it cannot resolve, and only the Steam build of the game
ships that assembly. The relay lives in CS2MPMod.Steam.dll instead, which
nothing links at build time - see Game/SteamRelayBootstrap.cs.-->
<Reference Include="Unity.InputSystem">
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<Private>false</Private>
</Reference>
<Reference Include="Unity.Burst">
<Private>false</Private>
</Reference>
<Reference Include="Unity.Collections">
<Private>false</Private>
</Reference>
<Reference Include="Unity.Entities">
<Private>false</Private>
</Reference>
<Reference Include="Unity.Mathematics">
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Update="System">
<Private>false</Private>
</Reference>
<Reference Update="System.Core">
<Private>false</Private>
</Reference>
<Reference Update="System.Data">
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="$(ModPropsFile)" Link="Properties\Mod.props"/>
<None Include="$(ModTargetsFile)" Link="Properties\Mod.targets"/>
</ItemGroup>
<!-- Locale files are the single source of truth per language; embed them so the
PropertiesLocaleSource can read them at runtime. -->
<ItemGroup>
<EmbeddedResource Include="Localization\locales\*.properties"/>
</ItemGroup>
<!--The Steam relay backend builds against this assembly, so it can only be built once
this one is done - and DeployWIP has wiped and refilled the mod folder by then, hence
the copy into both the output and the deployed folder.-->
<Target Name="BuildSteamBackend" AfterTargets="DeployWIP" Condition="'$(NeedBuild)'=='true'">
<PropertyGroup>
<SteamBackendDir>$(MSBuildProjectDirectory)\..\CS2MPMod.Steam</SteamBackendDir>
</PropertyGroup>
<MSBuild Projects="$(SteamBackendDir)\CS2MPMod.Steam.csproj"
Targets="Build" Properties="Configuration=$(Configuration)"/>
<ItemGroup>
<SteamBackendFiles Include="$(SteamBackendDir)\bin\$(Configuration)\net48\CS2MPMod.Steam.dll"/>
<SteamBackendFiles Include="$(SteamBackendDir)\bin\$(Configuration)\net48\CS2MPMod.Steam.pdb"/>
</ItemGroup>
<Copy SourceFiles="@(SteamBackendFiles)" DestinationFolder="$(OutDir)"/>
<Copy SourceFiles="@(SteamBackendFiles)" DestinationFolder="$(DeployDir)" Condition="Exists('$(DeployDir)')"/>
</Target>
<!--Build the UI module after the C# build. Must run after Mod.targets' DeployWIP
(which wipes and refills the local mods folder) because webpack writes the compiled
UI straight into that folder; same-event targets run in definition order, and this
file imports Mod.targets above, so the ordering holds.-->
<Target Name="BuildUI" AfterTargets="DeployWIP" Condition="'$(NeedBuild)'=='true'">
<Exec Command="npm run build" WorkingDirectory="$(ProjectDir)UI"/>
</Target>
<!--The Burst stubs are compiled through the toolchain's cache directory and keep its
absolute path inside them; their symbol files carry it too. Both are published as-is,
so strip them from the deployed copy (and from bin, which is zipped by hand).-->
<Target Name="ScrubBuildPaths" AfterTargets="BuildUI" Condition="'$(NeedBuild)'=='true'">
<PropertyGroup>
<ScrubScript>$(MSBuildProjectDirectory)\..\build\scrub-build-paths.ps1</ScrubScript>
</PropertyGroup>
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ScrubScript)" -Directory "$(DeployDir)""
Condition="Exists('$(DeployDir)')"/>
<!--OutDir keeps its trailing slash, which would escape the closing quote.-->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ScrubScript)" -Directory "$(MSBuildProjectDirectory)\$(OutDir.TrimEnd('\'))""/>
</Target>
</Project>