Repository navigation
Expand file tree
/
Copy pathBoxerMod.csproj
More file actions
146 lines (127 loc) · 7.14 KB
/
Copy pathBoxerMod.csproj
File metadata and controls
146 lines (127 loc) · 7.14 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
<Project Sdk="Godot.NET.Sdk/4.5.1" InitialTargets="CheckDependencyPaths">
<Import Project=".\Sts2PathDiscovery.props"/>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable> <!--Makes code analysis regarding null values stricter.-->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
<PathMap>$(AppOutputBase)=.\</PathMap>
<GodotDisabledSourceGenerators>GodotPluginsInitializer</GodotDisabledSourceGenerators>
</PropertyGroup>
<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="Exists('$(Sts2DataDir)')">
<Reference Include="0Harmony">
<HintPath>$(Sts2DataDir)/0Harmony.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="sts2">
<HintPath>$(Sts2DataDir)/sts2.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition="False"> <!--Allows access to originally private/protected members but may (unlikely to) cause errors.-->
<Publicize Include="sts2" IncludeVirtualMembers="false" IncludeCompilerGeneratedMembers="false"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Alchyr.Sts2.BaseLib" Version="[3.3.2]" PrivateAssets="All"/>
<PackageReference Include="Krafs.Publicizer" Version="[2.3.0]" PrivateAssets="All"/>
<PackageReference Include="Alchyr.Sts2.ModAnalyzers" Version="[0.1.9]"/>
<!-- Generates a .pck file when building if only using simple assets. May not work on all setups. Uncomment to test. -->
<PackageReference Include="BSchneppe.StS2.PckPacker" Version="[0.1.1]" PrivateAssets="All" />
<AdditionalFiles Include="BoxerMod/localization/**/*.json"/> <!-- Used by analyzer -->
</ItemGroup>
<ItemGroup>
<Compile Remove="BoxerMod/**"/>
<Compile Remove="materials/**"/>
<Compile Remove="shaders/**"/>
<Compile Remove="images/**"/>
<EmbeddedResource Remove="BoxerMod/**"/>
<EmbeddedResource Remove="materials/**"/>
<EmbeddedResource Remove="shaders/**"/>
<EmbeddedResource Remove="images/**"/>
</ItemGroup>
<ItemGroup>
<None Condition="Exists('Directory.Build.props')" Include="Directory.Build.props"/>
<None Include=".gitignore"/>
<None Include="BoxerMod.json"/>
<None Include="project.godot"/>
<None Include="BoxerMod/**"/>
</ItemGroup>
<ItemGroup>
<Folder Include="BoxerMod\images\cards\" />
<Folder Include="BoxerMod\images\card_portraits\big\"/>
<Folder Include="BoxerMod\images\powers\big\"/>
<Folder Include="BoxerMod\images\relics\big\"/>
</ItemGroup>
<ItemGroup>
<None Include="Events.txt" />
<None Include="Karty Boxer.xlsx" />
<None Include="mechaniki.txt" />
<None Include="Relics.xlsx" />
</ItemGroup>
<Target Name="CheckDependencyPaths">
<Error
Text=" Slay the Spire 2 data not found at path '$(Sts2DataDir)'"
Condition="'$(Sts2DataDir)' == '' or !Exists('$(Sts2DataDir)')"/>
</Target>
<Target Name="UpdateDependencyVersions" BeforeTargets="BeforeBuild" Condition="Exists('.godot/mono/temp/obj/project.assets.json')">
<PropertyGroup>
<ManifestPath>$(MSBuildProjectName).json</ManifestPath>
</PropertyGroup>
<PropertyGroup>
<NuGetData>$([System.IO.File]::ReadAllText(".godot/mono/temp/obj/project.assets.json"))</NuGetData>
<ActiveBaseLibVersion>$([System.Text.RegularExpressions.Regex]::Match($(NuGetData), '"Alchyr.Sts2.BaseLib\/([^"]*)').Result('$1'))</ActiveBaseLibVersion>
<OldContent>$([System.IO.File]::ReadAllText($(ManifestPath)))</OldContent>
<NewContent>$([System.Text.RegularExpressions.Regex]::Replace($(OldContent), '("id":\s*"BaseLib",\s*"min_version":\s*")[^"]*', '${1}$(ActiveBaseLibVersion)'))</NewContent>
</PropertyGroup>
<WriteLinesToFile
Condition="'$(OldContent)' != '$(NewContent)'"
File="$(ManifestPath)"
Lines="$(NewContent)"
Overwrite="true"
Encoding="UTF-8"/>
<Message Condition="'$(OldContent)' != '$(NewContent)'"
Text="Updated BaseLib dependency version in mod manifest json to version $(BaseLibVersion)"
Importance="high"/>
</Target>
<Target Name="CopyToModsFolderOnBuild" AfterTargets="PostBuildEvent">
<Message Text="Copying .dll .pdb and .json to mods folder." Importance="high"/>
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ModsPath)$(MSBuildProjectName)/"/>
<Copy SourceFiles="$(AssemblyName).json" DestinationFolder="$(ModsPath)$(MSBuildProjectName)/"/>
<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="StageGodotExportDependencies"
AfterTargets="Publish"
BeforeTargets="GodotPublish"
Condition="'$(GodotPath)' != '' and Exists('$(GodotPath)') and '$(IsInnerGodotExport)' != 'true'">
<ItemGroup>
<GodotExportDependency Include="@(ReferencePath)"
Condition="'%(ReferencePath.Filename)' == 'sts2'
or '%(ReferencePath.Filename)' == '0Harmony'
or '%(ReferencePath.Filename)' == 'BaseLib'"/>
</ItemGroup>
<Copy SourceFiles="@(GodotExportDependency)"
DestinationFolder="$(TargetDir)"
SkipUnchangedFiles="true"/>
</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 --export-pack "BasicExport" "$(ModsPath)$(MSBuildProjectName)/$(MSBuildProjectName).pck""
EnvironmentVariables="IsInnerGodotExport=true;MSBUILDDISABLENODEREUSE=1"/>
</Target>
</Project>