<?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>org.badvision</groupId>
    <artifactId>jace</artifactId>
    <version>3.1</version>
    <packaging>jar</packaging>

    <name>Jace</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mainClass>jace.JaceApplication</mainClass>
        <netbeans.hint.license>apache20</netbeans.hint.license>
        <lwjgl.version>3.3.4</lwjgl.version>
    </properties>

    <organization>
        <!-- Used as the 'Vendor' for JNLP generation -->
        <name>org.badvision</name>
    </organization>

    <build>
        <finalName>Jace</finalName>
        <plugins>
            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <version>1.0.23</version>
                <configuration>
                    <mainClass>jace.JaceApplication</mainClass>
                    <resourcesList>ceAppl
                        <resource>.*</resource>
                    </resourcesList>
                    <releaseConfiguration>
                        <vendor>org.badvision</vendor>
                        <skipSigning>true</skipSigning>
                    </releaseConfiguration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <configuration>
                    <mainClass>jace/jace.JaceApplication</mainClass>
                    <executions>
                        <execution>
                            <!-- Default configuration for running -->
                            <!-- Usage: mvn clean javafx:run -->
                            <id>default-cli</id>
                        </execution>
                        <execution>
                            <!-- Configuration for manual attach debugging -->
                            <!-- Usage: mvn clean javafx:run@debug -->
                            <id>debug</id>
                            <configuration>
                                <options>
                                    <option>
                                        -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8000</option>
                                </options>
                            </configuration>
                        </execution>
                        <execution>
                            <!-- Configuration for automatic IDE debugging -->
                            <id>ide-debug</id>
                            <configuration>
                                <options>
                                    <option>
                                        -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8000</option>
                                </options>
                            </configuration>
                        </execution>
                        <execution>
                            <!-- Configuration for automatic IDE profiling -->
                            <id>ide-profile</id>
                            <configuration>
                                <options>
                                    <option>${profiler.jvmargs.arg1}</option>
                                    <option>${profiler.jvmargs.arg2}</option>
                                    <option>${profiler.jvmargs.arg3}</option>
                                    <option>${profiler.jvmargs.arg4}</option>
                                    <option>${profiler.jvmargs.arg5}</option>
                                </options>
                            </configuration>
                        </execution>
                    </executions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <version>1.2.2.Final</version>
                <executions>
                    <execution>
                        <?m2e execute onConfiguration,onIncremental?>
                        <id>add-module-infos</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <configuration>
                            <modules>
                                <module>
                                    <artifact>
                                        <groupId>org.xerial.thirdparty</groupId>
                                        <artifactId>nestedvm</artifactId>
                                        <version>1.0</version>
                                    </artifact>
                                    <moduleInfoSource>
                                        module nestedvm {
                                        exports org.ibex.nestedvm;
                                        exports org.ibex.nestedvm.util;
                                        }
                                    </moduleInfoSource>
                                </module>
                            </modules>
                            <overwriteExistingFiles>true</overwriteExistingFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.11</version>
                <configuration>
                    <excludes>
                        <exclude>jace/assembly/AcmeCrossAssembler.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.60</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin> -->
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.lwjgl</groupId>
                <artifactId>lwjgl-bom</artifactId>
                <version>${lwjgl.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xerial.thirdparty</groupId>
            <artifactId>nestedvm</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-base</artifactId>
            <version>21.0.4</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>21.0.4</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>21.0.4</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-graphics</artifactId>
            <version>21.0.4</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-swing</artifactId>
            <version>21.0.4</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-openal</artifactId>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-stb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-glfw</artifactId>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl</artifactId>
            <classifier>${lwjgl.natives}</classifier>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-openal</artifactId>
            <classifier>${lwjgl.natives}</classifier>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-stb</artifactId>
            <classifier>${lwjgl.natives}</classifier>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-glfw</artifactId>
            <classifier>${lwjgl.natives}</classifier>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <file>
                    <exists>target/classes</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>17</source>
                            <target>17</target>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>org.badvision</groupId>
                                    <artifactId>jace</artifactId>
                                    <version>3.1</version>
                                </path>
                            </annotationProcessorPaths>
                            <annotationProcessors>jace.config.InvokableActionAnnotationProcessor</annotationProcessors>
                        </configuration>
                        <version>3.11.0</version>
                    </plugin>        
                </plugins>
            </build>
        </profile>
        <profile>
            <id>firstRun</id>
            <activation>
                <file>
                    <missing>target/classes</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>17</source>
                            <target>17</target>
                        </configuration>
                        <version>3.13.0</version>
                    </plugin>        
                </plugins>
            </build>
        </profile>
        <profile>
            <id>lwjgl-natives-linux-amd64</id>
            <activation>
                <os>
                    <family>unix</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-linux</lwjgl.natives>
            </properties>
        </profile>
        <profile>
            <id>lwjgl-natives-macos-x86_64</id>
            <activation>
                <os>
                    <family>mac</family>
                    <arch>x86_64</arch>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-macos</lwjgl.natives>
            </properties>
        </profile>
        <profile>
            <id>lwjgl-natives-macos-arm64</id>
            <activation>
                <os>
                    <family>mac</family>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-macos-arm64</lwjgl.natives>
            </properties>
        </profile>
        <profile>
            <id>lwjgl-natives-windows-amd64</id>
            <activation>
                <os>
                    <family>windows</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-windows</lwjgl.natives>
            </properties>
        </profile>
    </profiles>
</project>
