Repository navigation
Expand file tree
/
Copy pathHideDetailsMod.csproj
More file actions
159 lines (136 loc) · 8.2 KB
/
Copy pathHideDetailsMod.csproj
File metadata and controls
159 lines (136 loc) · 8.2 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
<Project Sdk="Godot.NET.Sdk/4.5.1" InitialTargets="CheckDependencyPaths">
<Import Project=".\Sts2PathDiscovery.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<!-- <TargetFramework>net10.0</TargetFramework> -->
<LangVersion>14.0</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable> <!--Makes
code analysis regarding null values stricter.-->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- <OutputPath>bin\$(Configuration)\</OutputPath> -->
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
<!-- <RootNamespace>HideDetailsMod</RootNamespace> -->
<GodotDisabledSourceGenerators>GodotPluginsInitializer</GodotDisabledSourceGenerators>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<Optimize>false</Optimize>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<OptimizeCode>false</OptimizeCode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize>true</Optimize>
<!-- TODO: see if i want this enabled or not. It removes the .pdb -->
<!-- <DebugType>none</DebugType> -->
<PathMap>$(AppOutputBase)=.\</PathMap>
</PropertyGroup>
<Import Project="build/mod.build.props" />
<Import Project="Directory.References.props" />
<PropertyGroup>
<!-- Diasble architecture mismatch warning; mods are ideally built for all platforms (MSIL)
while your local StS2 version will be for your specific platform. -->
<NoWarn>$(NoWarn);MSB3270</NoWarn>
</PropertyGroup>
<ItemGroup Condition="True"> <!--Allows
access to originally private/protected members but may (unlikely to) cause errors.-->
<Publicize Include="sts2" IncludeVirtualMembers="false" IncludeCompilerGeneratedMembers="false" />
</ItemGroup>
<ItemGroup>
<Compile Remove="HideDetailsMod/**" />
<Compile Remove="materials/**" />
<Compile Remove="shaders/**" />
<Compile Remove="images/**" />
<EmbeddedResource Remove="HideDetailsMod/**" />
<EmbeddedResource Remove="materials/**" />
<EmbeddedResource Remove="shaders/**" />
<EmbeddedResource Remove="images/**" />
</ItemGroup>
<!-- decomps -->
<ItemGroup>
<Compile Remove="src/**" />
<Compile Remove="themes/**" />
<Compile Remove="scenes/**" />
<Compile Remove="animations/**" />
<EmbeddedResource Remove="themes/**" />
<EmbeddedResource Remove="scenes/**" />
<EmbeddedResource Remove="animations/**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="HideDetailsMod.Beta/**" />
<Compile Remove="ImageGen/**" />
</ItemGroup>
<!-- Global file inclusions (Shared across all channels) -->
<ItemGroup>
<None Include="Directory.References.props" />
<None Condition="Exists('Directory.Build.props')" Include="Directory.Build.props" />
<None Include=".gitignore" />
<None Include="project.godot" />
<None Include="HideDetailsMod/**" />
</ItemGroup>
<!-- Conditional JSON configurations for IDE solution explorer visibility -->
<ItemGroup Condition="'$(WorkshopChannel)' != 'Canary'">
<None Include="HideDetailsMod.json" />
</ItemGroup>
<ItemGroup Condition="'$(WorkshopChannel)' == 'Canary'">
<None Include="HideDetailsMod.canary.json" />
</ItemGroup>
<Target Name="CheckDependencyPaths">
<Error Text=" Slay the Spire 2 data not found at path '$(Sts2DataDir)'" Condition="'$(Sts2DataDir)' == '' or !Exists('$(Sts2DataDir)')" />
</Target>
<Target Name="RunAtlasPacker" BeforeTargets="PackPck;GodotPublish">
<Message Text="Running Atlas Packer..." Importance="high" />
<Exec Command="dotnet run --project "$(MSBuildProjectDirectory)\ImageGen\AtlasPacker.csproj" -- -c "$(MSBuildProjectDirectory)\ImageGen\atlas_config.json"" Condition="Exists('$(MSBuildProjectDirectory)\ImageGen\AtlasPacker.csproj')" />
</Target>
<!-- FIXED TARGET: Now uses $(LocalJsonSource) to copy and rename the file properly -->
<Target Name="CopyToModsFolderOnBuild" AfterTargets="PostBuildEvent" Condition=" '$(BuildingForLiveReload)' != 'true' ">
<Message Text="Copying .dll .pdb and $(LocalJsonSource) to mods folder as $(AssemblyName).json." Importance="high" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ModsPath)$(MSBuildProjectName)/" />
<Copy SourceFiles="$(LocalJsonSource)" DestinationFiles="$(ModsPath)$(MSBuildProjectName)/$(AssemblyName).json" />
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(ModsPath)$(MSBuildProjectName)/" />
</Target>
<Target Name="CopyQuickPck" AfterTargets="PackPck" Condition="Exists('$(PckPackerOutputPath)') And '$(PckPackerSkipped)' != 'true'">
<Message Text="Copying quick .pck to mods folder." Importance="high" />
<Copy SourceFiles="$(PckPackerOutputPath)" DestinationFolder="$(ModsPath)/$(MSBuildProjectName)" />
</Target>
<Target Name="NeedGodotForPublish" BeforeTargets="Publish">
<Error Text=" Godot path must be set up before publishing; Godot not found at path '$(GodotPath)'. Check Directory.Build.props file." Condition="'$(GodotPath)' == '' or !Exists('$(GodotPath)')" />
</Target>
<Target Name="GodotPublish" AfterTargets="Publish" Condition="'$(GodotPath)' != '' and Exists('$(GodotPath)') and '$(IsInnerGodotExport)' != 'true'">
<Message Text="Exporting Godot .pck to mods folder" Importance="high" />
<Exec Command=""$(GodotPath)" --headless -s build/pack_mod.gd -- "$(ModsPath)$(MSBuildProjectName)/$(MSBuildProjectName).pck" "HideDetailsMod"" EnvironmentVariables="IsInnerGodotExport=true;MSBUILDDISABLENODEREUSE=1" ContinueOnError="WarnAndContinue" />
</Target>
<PropertyGroup Condition="'$(WorkshopChannel)' == 'Canary'">
<DefineConstants>$(DefineConstants);CANARY</DefineConstants>
</PropertyGroup>
<!-- Workshop & Local Channel Configurations -->
<PropertyGroup>
<WorkshopChannel Condition="'$(WorkshopChannel)' == ''">Production</WorkshopChannel>
<WorkshopRoot>$(MSBuildProjectDirectory)\workshop\$(WorkshopChannel)</WorkshopRoot>
<WorkshopContentRoot>$(WorkshopRoot)\content</WorkshopContentRoot>
<!-- Define Local and Workshop source handles uniformly -->
<LocalJsonSource Condition="'$(WorkshopChannel)' == 'Canary'">HideDetailsMod.canary.json</LocalJsonSource>
<LocalJsonSource Condition="'$(WorkshopChannel)' != 'Canary'">HideDetailsMod.json</LocalJsonSource>
<WorkshopJsonSource>$(LocalJsonSource)</WorkshopJsonSource>
</PropertyGroup>
<Target Name="CopyToWorkshopContent" AfterTargets="PostBuildEvent" Condition=" '$(BuildingForLiveReload)' != 'true' ">
<Message Text="Copying .dll .pdb and $(WorkshopJsonSource) to $(WorkshopChannel)/content." Importance="high" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(WorkshopContentRoot)" />
<Copy SourceFiles="$(WorkshopJsonSource)" DestinationFiles="$(WorkshopContentRoot)\$(AssemblyName).json" />
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(WorkshopContentRoot)" />
</Target>
<Target Name="CopyPckToWorkshopContent" AfterTargets="GodotPublish">
<Copy SourceFiles="$(ModsPath)$(MSBuildProjectName)/$(MSBuildProjectName).pck"
DestinationFolder="$(WorkshopContentRoot)"
Condition="Exists('$(ModsPath)$(MSBuildProjectName)/$(MSBuildProjectName).pck')" />
</Target>
<Target Name="SetupGameDir" AfterTargets="Build">
<!-- Create/refresh the junction -->
<Exec Command="rmdir "$(MSBuildProjectDirectory)\.game" 2>nul & mklink /J "$(MSBuildProjectDirectory)\.game" "$(Sts2Path)"" />
<!-- Write steam_appid.txt inside the game directory -->
<WriteLinesToFile File="$(Sts2Path)\steam_appid.txt"
Lines="2868840"
Overwrite="true"
WriteOnlyWhenDifferent="true" />
</Target>
</Project>