forked from BrokenRegistry/Rotp-Fusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
397 lines (387 loc) · 18.8 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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- Project Declaration -->
<groupId>com.rayfowler</groupId>
<artifactId>rotp</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>
<!-- Variables Declaration -->
<properties>
<!-- Personal -->
<maven.build.timestamp.format>yyyy.M.d.H</maven.build.timestamp.format>
<revision>${maven.build.timestamp}</revision>
<RepoId>Rotp-Fusion</RepoId>
<AuthorId>Xilmi</AuthorId>
<BaseFileName>rotp-${project.version}</BaseFileName>
<!-- Maven Standard -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
<junit.jupiter.version>5.9.0</junit.jupiter.version>
<junit.platform.version>1.9.0</junit.platform.version>
<GITHUB_TOKEN></GITHUB_TOKEN>
</properties>
<!-- GitHub Declaration -->
<scm>
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>https://github.com/${AuthorId}/${RepoId}.git</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>github</id>
<name>${AuthorId}</name>
<url>https://maven.pkg.github.com/${AuthorId}/${RepoId}</url>
</repository>
</distributionManagement>
<!-- All the dependencies Declaration -->
<dependencies>
<!-- JUNIT dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- Base and modders ROTP dependencies -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>tritonus-share</artifactId>
<version>0.3.7.4</version>
</dependency>
<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>vorbisspi</artifactId>
<version>1.0.3.3</version>
</dependency>
<dependency>
<groupId>org.sejda.imageio</groupId>
<artifactId>webp-imageio</artifactId>
<version>0.1.6</version>
</dependency>
<!-- Needed to play video -->
<!-- Remove ffmpeg dependency, too big jar size -->
<!-- JavaFX doesn't do WebM, don't use JavaFX -->
<!-- Try LibGDX next -->
<!-- My attempt to convert save game files to JSON, incomplete -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.2.2</version>
</dependency>
<!-- My attempt to produce GraalVM native executables, unfinished -->
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<version>21.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- Files generation -->
<build>
<!-- Ressources non-conventionnal location Declaration-->
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>rotp-version.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src</directory>
<includes>
<include>rotp-version.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>README.md</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<!-- Building tools -->
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- images & sound compression, using antrun which is standard -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version> <!-- Must be high version or echo doesn't work -->
<executions>
<execution>
<id>ogg</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target xmlns:mvn="http://maven.apache.org/ANTRUN">
<parallel threadCount="4">
<!-- convert wav to ogg. Needs vorbis-tools package, oggenc executable -->
<apply executable="oggenc" dest="${project.build.outputDirectory}" verbose="true" parallel="false">
<srcfile/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${project.build.sourceDirectory}">
<patternset>
<include name="**/*.wav"/>
</patternset>
</fileset>
<mapper type="glob" from="*.wav" to="*.ogg"/>
</apply>
<!-- convert png/jpg to webp. Needs webp package, cwebp executable -->
<!-- quality 90 is visually indistinguishable from original jpeg -->
<!-- but given that people using minified version want a small jar, let's use quality 80 -->
<apply executable="cwebp" dest="${project.build.outputDirectory}" verbose="true" parallel="false">
<arg value="-short"/>
<arg value="-mt"/>
<arg value="-q"/>
<arg value="75"/>
<srcfile/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${project.build.sourceDirectory}">
<patternset>
<include name="**/*.png"/>
<include name="**/*.jpg"/>
</patternset>
</fileset>
<firstmatchmapper>
<globmapper from="*.png" to="*.webp"/>
<globmapper from="*.jpg" to="*.webp"/>
</firstmatchmapper>
</apply>
</parallel>
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- plugin for Mini Jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<!-- Run shade goal on package phase -->
<!-- package minified jar. This needs to run first as it's attached, doesn't replace main jar -->
<execution>
<id>shade-mini</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>mini</shadedClassifierName>
<transformers>
<!-- add Main-Class to manifest file -->
<!-- When launching full version, run Rotp directly, no need to go via RotpGovernor main -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>rotp.Rotp</mainClass>
<manifestEntries>
<Built-By>${AuthorId}</Built-By>
<Mini>true</Mini>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>com.rayfowler:rotp</artifact>
<excludes>
<exclude>**/*.wav</exclude>
<exclude>**/*.jpg</exclude>
<exclude>**/*.png</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
<execution>
<id>shade-original</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<!-- add Main-Class to manifest file -->
<!-- When launching full version, run Rotp directly, no need to go via RotpGovernor main -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>rotp.RotpGovernor</mainClass>
<manifestEntries>
<Built-By>${AuthorId}</Built-By>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>com.rayfowler:rotp</artifact>
<excludes>
<exclude>**/*.ogg</exclude>
<exclude>**/*.webp</exclude>
<exclude>**/rotp-mini.properties</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<!-- Download Eclipse OpenJDK to package in windows binary zip -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.3</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>wget</goal>
</goals>
</execution>
</executions>
<configuration>
<url>
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jre_x64_windows_hotspot_17.0.7_7.zip
</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}/jre-win</outputDirectory>
<sha256>62e82c1afa7509424813e9cb22d8becfec4346d7505e6d2fc8770af4dcd5b9a0</sha256>
</configuration>
</plugin>
<!-- Windows executable creation -->
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<!-- <version>2.1.2</version> -->
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<icon>launch4j/rotp.ico</icon>
<splash>
<file>launch4j/rotp_splash.bmp</file>
<waitForWindow>false</waitForWindow>
<timeout>15</timeout>
<timeoutErr>false</timeoutErr>
</splash>
<headerType>gui</headerType>
<outfile>target/${BaseFileName}.exe</outfile>
<jar>target/${BaseFileName}-mini.jar</jar>
<errTitle>ROTP</errTitle>
<classPath>
<mainClass>rotp.RotpGovernor</mainClass>
<addDependencies>false</addDependencies>
<preCp>anything</preCp>
</classPath>
<jre>
<path>jre</path>
<minVersion>11</minVersion>
<bundledJre64Bit>true</bundledJre64Bit>
<runtimeBits>64</runtimeBits>
<jdkPreference>preferJre</jdkPreference>
<initialHeapSize>2000</initialHeapSize>
<maxHeapSize>3500</maxHeapSize>
</jre>
<versionInfo>
<fileVersion>${project.version}</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>Remnants of the Precursors</fileDescription>
<copyright>Copyright Ray Fowler</copyright>
<productVersion>${project.version}</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<productName>Remnants of the Precursors</productName>
<internalName>rotp</internalName>
<originalFilename>${BaseFileName}.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
<!-- package a zip for windows -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/windows.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<!-- runs with github-release:github-release -->
<plugin>
<groupId>com.ragedunicorn.tools.maven</groupId>
<artifactId>github-release-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<owner>${AuthorId}</owner>
<repository>${RepoId}</repository>
<authToken>${GITHUB_TOKEN}</authToken>
<tagName>${project.version}</tagName>
<name>${BaseFileName}</name>
<targetCommitish>main</targetCommitish>
<releaseNotes>target/classes/README.md</releaseNotes>
<assets>
<asset>target/${BaseFileName}.jar</asset>
<asset>target/${BaseFileName}-mini.jar</asset>
<asset>target/${BaseFileName}-windows.zip</asset>
<!-- <asset>Profiles.pdf</asset> -->
</assets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>