-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOneMaxHpModifier.csproj
More file actions
128 lines (110 loc) · 6.35 KB
/
Copy pathOneMaxHpModifier.csproj
File metadata and controls
128 lines (110 loc) · 6.35 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
<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.-->
<Publicize>False</Publicize> <!--Allows access to originally private/protected members but may (unlikely to) cause errors.-->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
<PathMap>$(AppOutputBase)=.\</PathMap>
<GodotDisabledSourceGenerators>GodotPluginsInitializer</GodotDisabledSourceGenerators>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<Optimize>false</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize>true</Optimize>
<PathMap>$(AppOutputBase)=.\</PathMap>
</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="$(Publicize)">
<PackageReference Include="Krafs.Publicizer" Version="2.3.0" PrivateAssets="All"/>
<Publicize Include="sts2" IncludeVirtualMembers="false" IncludeCompilerGeneratedMembers="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Alchyr.Sts2.BaseLib" Version="*" PrivateAssets="All"/>
<PackageReference Include="Alchyr.Sts2.ModAnalyzers" Version="*" />
<!-- 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="OneMaxHpModifier/localization/**/*.json"/> <!-- Used by analyzer -->
</ItemGroup>
<ItemGroup>
<Compile Remove="OneMaxHpModifier/**" />
<Compile Remove="materials/**" />
<Compile Remove="shaders/**" />
<Compile Remove="images/**" />
<EmbeddedResource Remove="OneMaxHpModifier/**" />
<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="OneMaxHpModifier.json" />
<None Include="project.godot"/>
<None Include="OneMaxHpModifier/**" />
</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="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"
ContinueOnError="WarnAndContinue"/>
</Target>
</Project>