-
Notifications
You must be signed in to change notification settings - Fork 1
/
pom.xml
468 lines (440 loc) · 20.4 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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<?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>
<groupId>com.comp541</groupId>
<artifactId>mips-emulator</artifactId>
<version>1.0.3-SNAPSHOT</version>
<!-- This description text is included in the Windows installer by default, see windows-jpackage.txt -->
<description>MIPS Emulator for COMP 541 at UNC</description>
<properties>
<!-- Set this to the class with the main method for your application -->
<main-class>com.comp541.Main</main-class>
<!-- Change your app's name to something interesting... but you might want to avoid spaces
just to safe for compatibility across operating systems. -->
<app.name>MIPS_Emulator</app.name>
<!-- This converts the build timestamp to a Windows-installer friendly version number (minute level resolution).
Note that Maven generated timestamp is in UTC, not local time. For more information see:
https://docs.microsoft.com/en-us/windows/win32/msi/productversion
https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/text/SimpleDateFormat.html
-->
<app.version>1.0.3</app.version>
<!-- This property is used to specify the modules included in the (custom) JVM image. -->
<!-- Reminder: javafx.web (the embedded browser component) is not included in this project by default due
to GitHub template size restrictions. You can download the full SDK from https://openjfx.io -->
<jvm.modules>javafx.media,javafx.controls,javafx.fxml,java.logging</jvm.modules>
<!-- Set the project to UTF-8, avoiding warnings in the build logs -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!-- Replace this UUID with a custom one for your project. This ID is used by the Windows installer system
to know that an installer is intended to replace/upgrade an earlier version. The easiest thing to do is
grab a unique UUID via https://www.uuidgenerator.net -->
<windows.upgrade.uuid>e708d9e9-3f3a-47c4-8f82-eb4b5960daa8</windows.upgrade.uuid>
<!-- This is used to set many user-visible fields in the Windows Installer. See windows-jpackage.txt -->
<windows.vendor>Sample</windows.vendor>
<!-- Empty properties to skip signing by default. Set with the macos-sign Maven profile -->
<macos.sign></macos.sign>
<macos.sign.identity></macos.sign.identity>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<scope>compile</scope>
</dependency>
<!-- These dependencies may or may not be necessary -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>18-ea+6</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>19</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>19</version>
<classifier>mac</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>19</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>18-ea+6</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.0</version>
</dependency>
<dependency>
<groupId>org.kordamp.bootstrapfx</groupId>
<artifactId>bootstrapfx-core</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>19</version>
<scope>compile</scope>
</dependency>
<!-- This dependency is a normal Maven dependency, here mainly as an example. It brings in other transitive
dependencies as well. You can remove it from your project (unless you happen to need to generate test data. -->
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>1.0.2</version>
</dependency>
<!-- Modern JavaFX Look and Feel -->
<!-- https://github.com/mkpaz/atlantafx -->
<dependency>
<groupId>io.github.mkpaz</groupId>
<artifactId>atlantafx-base</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</dependency>
</dependencies>
<build>
<extensions>
<!-- Used to inject the OS and architecture values in a consistent manner -->
<!-- https://github.com/trustin/os-maven-plugin -->
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
</extension>
</extensions>
<resources>
<resource>
<!-- Here we are processing the platform-specific jpackage command files, adding in Maven
properties for configuration. -->
<directory>${project.basedir}/src/packaging</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/packaging</targetPath>
</resource>
<!-- Add the default resource path back in - by overriding above it disables the default -->
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources/build-info/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- This is necessary or the JAR won't work!!! -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
${main-class}
</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<!-- This is an app, so we don't want to install it in the local Maven repository -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<!-- This copies the jar files declared by the Maven build into a single directory.
This makes it easy to assemble the final installer package -->
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- Include only compile stage dependencies (no test dependencies) -->
<includeScope>compile</includeScope>
<!-- The JavaFX libraries are bundled into the custom JVM, so we don't want to duplicate
them in the bundled app and installer. This command skips all of the JavaFX by groupId. -->
<excludeGroupIds>org.openjfx</excludeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Put the application jar generated by the project into the dependency folder - the default folder
for the maven-dependency-plugin output. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>${main-class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<!-- Plugin to make working with JavaFX nicer. See https://github.com/openjfx/javafx-maven-plugin -->
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>${main-class}</mainClass>
</configuration>
</plugin>
<plugin>
<!-- https://github.com/wiverson/jtoolprovider-plugin -->
<groupId>io.github.wiverson</groupId>
<artifactId>jtoolprovider-plugin</artifactId>
<version>1.0.34</version>
<executions>
<!-- This command runs jlink, generating a custom JVM by combining the JavaFX modules bundled in
this project with the JDK modules. -->
<execution>
<id>jlink</id>
<phase>package</phase>
<goals>
<goal>java-tool</goal>
</goals>
<configuration>
<toolName>jlink</toolName>
<removeDirectories>${project.build.directory}/jvm-image/</removeDirectories>
<addModules>${jvm.modules}</addModules>
<output>${project.build.directory}/jvm-image</output>
<args>
<arg>--strip-native-commands</arg>
<arg>--no-header-files</arg>
<arg>--strip-debug</arg>
<arg>--no-man-pages</arg>
<arg>--compress=2</arg>
</args>
</configuration>
</execution>
<!-- The command that actually generates the installer. The options for each platform
are found the /src/packaging directory. These files are copied into the target directory by
the Maven resources plugin, which does the filtering to replace the original values with
the actual Maven properties.
https://github.com/wiverson/jtoolprovider-plugin/blob/main/java-tool-doc.md
-->
<execution>
<id>jpackage</id>
<phase>install</phase>
<goals>
<goal>java-tool</goal>
</goals>
<configuration>
<toolName>jpackage</toolName>
<writeOutputToLog>true</writeOutputToLog>
<writeErrorsToLog>true</writeErrorsToLog>
<failOnError>true</failOnError>
<removeDirectories>${project.build.directory}/installer-work</removeDirectories>
<args>@${project.build.directory}/packaging/${os.detected.name}-jpackage.txt</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>4.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<!-- Basic report generation. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.5</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>GitHub Run</id>
<activation>
<property>
<name>env.GITHUB_ACTIONS</name>
</property>
</activation>
<properties>
<!--suppress UnresolvedMavenProperty -->
<app.version>1.1.${env.GITHUB_RUN_NUMBER}</app.version>
</properties>
</profile>
<profile>
<id>Local Development Run</id>
<activation>
<property>
<name>!env.GITHUB_ACTIONS</name>
</property>
</activation>
<properties>
<app.version>1.1.0</app.version>
</properties>
</profile>
<!-- We use the built-in Maven profile activation system to set the platform property.
These properties are then use to build the directory paths to the platform specific resources.
It would be great if Maven automatically added the os family as a property by default
-->
<profile>
<id>macos-sign</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<macos.sign>--mac-sign</macos.sign>
<!-- You will have to replace this with your own dev information from your Apple identity -->
<macos.sign.identity>--mac-signing-key-user-name "Company Name, Inc. (BXPXTXC35S)"</macos.sign.identity>
</properties>
</profile>
<profile>
<id>windows-active</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<!-- This adds a "launch on finish" to the Windows msi installer. This just tweaks the Windows
installer package to run the executable after the installer runs, simplifying the user experience.
If you don't want this behavior, just delete this plug execution. -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>install</phase>
<id>add-launch-to-msi</id>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>cscript</executable>
<outputFile>${project.build.directory}/msi-result.log</outputFile>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>${project.build.directory}/packaging/add-launch-to-msi.js</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>