-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpom.xml
312 lines (286 loc) · 15.6 KB
/
pom.xml
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--Hello! You'll basically should only need to change these names and the steam path (just below)-->
<!--The author name(s) as they appear in MTS and any other comments are in your ModTheSpire.json-->
<groupId>piratemod</groupId>
<artifactId>PirateMod</artifactId> <!--Keep a note of this one: this is the ID used in the "auto add cards" method-->
<name>The Abyssal</name>
<version>1.17.0</version>
<description>Adds The Abyssal as a new playable character.</description>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>pirate</id>
<name>Pirate Repository</name>
<url>file://C:/repo/maven2</url>
<layout>default</layout>
</repository>
</distributionManagement>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<SlayTheSpire.version>12-18-2022</SlayTheSpire.version>
<ModTheSpire.version>3.8.0</ModTheSpire.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.dependency.ant-contrib.ant-contrib.jar.path>${settings.localRepository}/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar</maven.dependency.ant-contrib.ant-contrib.jar.path>
<Steam.path>C:\Program Files (x86)\Steam\steamapps</Steam.path>
<mod.dir>C:\Program Files (x86)\Steam\steamapps\common\SlayTheSpire\TheAbyssal</mod.dir>
<git.dir>C:\Users\jparr\Documents\STS Mods\ThePirate\ThePirate\thePirate</git.dir>
<last.commit.hash>ed30015551730988cb8791cc32ce1c3eae8c5d3a</last.commit.hash>
</properties>
<dependencies>
<dependency>
<groupId>com.megacrit.cardcrawl</groupId>
<artifactId>slaythespire</artifactId>
<version>${SlayTheSpire.version}</version>
<scope>system</scope>
<systemPath>${Steam.path}/common/SlayTheSpire/desktop-1.0.jar</systemPath>
<!--<systemPath>${basedir}/../lib/desktop-1.0.jar</systemPath>-->
</dependency>
<dependency>
<groupId>com.evacipated.cardcrawl</groupId>
<artifactId>modthespire</artifactId>
<version>${ModTheSpire.version}</version>
<scope>system</scope>
<systemPath>${Steam.path}/workshop/content/646570/1605060445/ModTheSpire.jar</systemPath>
<!--<systemPath>${basedir}/../lib/ModTheSpire.jar</systemPath>-->
</dependency>
<dependency>
<groupId>basemod</groupId>
<artifactId>basemod</artifactId>
<version>5.0.0</version>
<scope>system</scope>
<systemPath>${Steam.path}/workshop/content/646570/1605833019/BaseMod.jar</systemPath>
<!--<systemPath>${basedir}/../lib/BaseMod.jar</systemPath>-->
</dependency>
<dependency>
<groupId>spireTogether</groupId>
<artifactId>spireTogether</artifactId>
<version>6.4.15</version>
<scope>system</scope>
<systemPath>${Steam.path}/workshop/content/646570/2384072973/TogetherInSpire.jar</systemPath>
<!--<systemPath>${basedir}/../lib/BaseMod.jar</systemPath>-->
</dependency>
<dependency>
<groupId>com.evacipated.cardcrawl.mod</groupId>
<artifactId>StSLib</artifactId>
<version>1.3.2</version>
<scope>system</scope>
<systemPath>${Steam.path}/workshop/content/646570/1609158507/StSLib.jar</systemPath>
<!--<systemPath>${basedir}/../lib/StSLib.jar</systemPath>-->
</dependency>
<!-- Add ant-contrib as a dependency -->
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version> <!-- Use the appropriate version -->
</dependency>
</dependencies>
<!-- This is how your code is packaged into the jar file-->
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<excludes>
<exclude>**/*.psd</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<!-- This moves your mod into a common folder where all mods you make can go. -->
<copy file="target/${project.artifactId}.jar" tofile="${Steam.path}/common/SlayTheSpire/mods/${project.artifactId}.jar"/>
<copy file="target/${project.artifactId}.jar" tofile="${mod.dir}/content/${project.artifactId}.jar"/>
<!-- Generate Git log to a text file -->
<exec executable="cmd">
<arg value="/c"/>
<arg value="cd "${git.dir}" && git log > "${mod.dir}\gitlog.txt""/>
</exec>
<!-- Find and Replace all instances of " " in gitlog.txt -->
<exec executable="powershell">
<arg value="-Command"/>
<arg value="(Get-Content '${mod.dir}\gitlog.txt') -replace ' ', '' | Set-Content '${mod.dir}\gitlog.txt'"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>my-execution</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmd</executable>
<workingDirectory>${mod.dir}</workingDirectory>
<arguments>
<argument>/c</argument>
<argument>${git.dir}\extract_bug_lines.bat</argument>
<argument>${last.commit.hash}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${mod.dir}/bug_lines.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version> <!-- use an appropriate version -->
<executions>
<execution>
<phase>deploy</phase> <!-- choose an appropriate phase -->
<configuration>
<target name="updateConfigJson" >
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${maven.dependency.ant-contrib.ant-contrib.jar.path}" />
</classpath>
</taskdef>
<echo>Starting updateConfigJson</echo>
<!-- Pass Maven properties to Ant properties -->
<property name="version" value="${project.version}" />
<property name="bug_lines" value="${bugLines}" />
<property name="balance_lines" value="${balanceLines}" />
<property name="localization_lines" value="${localizationLines}" />
<property name="uiqol_lines" value="${uiqolLines}" />
<loadfile property="configJsonContent" srcFile="${git.dir}/config.json"/>
<!-- Add major/minor/patch info -->
<script language="javascript"> <![CDATA[
var versionChange = true; // Initialize the variable
var data = project.getProperty("configJsonContent");
var version = project.getProperty("version");
var regexPattern = new RegExp("\"changeNote\": \"\\[h1\\]\\w+( \\w+)* v" + version);
// Check if the content matches the regex pattern
if (regexPattern.test(data)) {
versionChange = false; // Set the boolean variable to false if the content matches
}
project.setProperty("versionChange", versionChange);
if ( versionChange ){
var version = project.getProperty("version");
var note = "";
if (/^\d+\.0\.0$/.test(version)) {
note = "[h1]Major Release " + "v" + version + "[/h1]";
} else if (/^\d+\.\d+\.0$/.test(version)) {
note = "[h1]Minor Release " + "v" + version + "[/h1]";
} else if (/^\d+\.\d+\.\d+$/.test(version)) {
note = "[h1]Patch " + "v" + version + "[/h1]";
}
note = note + "\n\n";
project.setProperty("change.note", note);
//<!-- Add bug_lines if they exist -->
var lines = project.getProperty("bug_lines");
var header = "Bug Fixes";
var note = project.getProperty("change.note");
if (lines != null && lines != "") {
note += "[h2]" + header + ":[/h2]\n" + lines + "\n";
}
project.setProperty("change.note", note);
//<!-- Add Balance_lines if they exist -->
var lines = project.getProperty("balance_lines");
var header = "Balance Changes";
var note = project.getProperty("change.note");
if (lines != null && lines != "") {
note += "[h2]" + header + ":[/h2]\n" + lines + "\n";
}
project.setProperty("change.note", note);
//<!-- Add localization_lines if they exist -->
var lines = project.getProperty("localization_lines");
var header = "Localization";
var note = project.getProperty("change.note");
if (lines != null && lines != "") {
note += "[h2]" + header + ":[/h2]\n" + lines + "\n";
}
project.setProperty("change.note", note);
//<!-- Add uiqol_lines if they exist -->
var lines = project.getProperty("uiqol_lines");
var header = "UI/QoL Enhancements";
var note = project.getProperty("change.note");
if (lines != null && lines != "") {
note += "[h2]" + header + ":[/h2]\n" + lines + "\n";
}
project.setProperty("change.note", note);
}
]]></script>
<if>
<equals arg1="${versionChange}" arg2="true"/>
<then>
<replaceregexp file="${git.dir}/config.json"
match="("changeNote":\s*")((?:\\.|[^"\\])*)(")"
replace="\1${change.note}\3"
flags="g"/>
<copy file="${git.dir}/DeployToSteam.bat" tofile="${mod.dir}/DeployToSteam.bat"/>
<copy file="${git.dir}/config.json" tofile="${mod.dir}/config.json"/>
<!-- Open Abyssal mod folder in Windows Explorer -->
<exec executable="explorer">
<arg value="${mod.dir}"/>
</exec>
</then>
</if>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>ModTheSpire.json</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>ModTheSpire.json</include>
</includes>
</resource>
</resources>
</build>
</project>