<?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>
    <parent>
        <artifactId>gephi-parent</artifactId>
        <groupId>org.gephi</groupId>
        <version>0.11.1</version>
        <relativePath>../..</relativePath>
    </parent>

    <groupId>org.gephi</groupId>
    <artifactId>visualization-engine</artifactId>
    <version>0.11.1</version>
    <packaging>nbm</packaging>

    <name>VisualizationEngine</name>

    <!-- Properties -->
    <properties>
        <jogl.version>2.6.0</jogl.version>
        <joml.version>1.10.8</joml.version>
    </properties>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>graph-api</artifactId>
        </dependency>

        <!-- JOML -->
        <dependency>
            <groupId>org.joml</groupId>
            <artifactId>joml</artifactId>
            <version>${joml.version}</version>
        </dependency>

        <!-- JOGL -->
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all</artifactId>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all</artifactId>
            <classifier>natives-linux-amd64</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all</artifactId>
            <classifier>natives-linux-aarch64</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all</artifactId>
            <classifier>natives-macosx-universal</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all</artifactId>
            <classifier>natives-windows-amd64</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt</artifactId>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt</artifactId>
            <classifier>natives-linux-amd64</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt</artifactId>
            <classifier>natives-linux-aarch64</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt</artifactId>
            <classifier>natives-macosx-universal</classifier>
            <version>${jogl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt</artifactId>
            <classifier>natives-windows-amd64</classifier>
            <version>${jogl.version}</version>
        </dependency>

        <!-- Test only -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>graph-api</artifactId>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>project-api</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>io-importer-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>io-importer-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>io-importer-api</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>layout-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>layout-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-filesystems</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-modules-masterfs</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.build.directory}/generated-resources</directory>
            </resource>
        </resources>
        <plugins>

            <!-- Preprocess GLSL shader sources -->
            <plugin>
                <groupId>com.igormaznitsa</groupId>
                <artifactId>jcp</artifactId>
                <configuration>
                    <allowWhitespaces>true</allowWhitespaces>
                    <eol>\r\n</eol>
                    <extensions>
                        <extension>vert</extension>
                        <extension>frag</extension>
                    </extensions>
                    <keepAttributes>true</keepAttributes>
                    <keepComments>false</keepComments>
                    <keepLines>false</keepLines>
                    <sources>src/main/resources</sources>
                    <target>target/generated-resources</target>
                    <sourceEncoding>UTF-8</sourceEncoding>
                    <targetEncoding>UTF-8</targetEncoding>
                    <ignoreMissingSources>false</ignoreMissingSources>
                    <unknownVarAsFalse>false</unknownVarAsFalse>
                    <verbose>true</verbose>
                    <clearTarget>false</clearTarget>
                    <careForLastEol>true</careForLastEol>
                    <preserveIndents>true</preserveIndents>
                    <dontOverwriteSameContent>false</dontOverwriteSameContent>
                </configuration>
                <executions>
                    <execution>
                        <id>preprocess-shaders-without-selection</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>preprocess</goal>
                        </goals>
                        <configuration>
                            <vars>
                                <with_selection>false</with_selection>
                            </vars>
                        </configuration>
                    </execution>
                    <execution>
                        <id>preprocess-shaders-with-selection-unselected</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>preprocess</goal>
                        </goals>
                        <configuration>
                            <vars>
                                <with_selection>true</with_selection>
                                <selected>false</selected>
                            </vars>
                        </configuration>
                    </execution>
                    <execution>
                        <id>preprocess-shaders-with-selection-selected</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>preprocess</goal>
                        </goals>
                        <configuration>
                            <vars>
                                <with_selection>true</with_selection>
                                <selected>true</selected>
                            </vars>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.netbeans.utilities</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <configuration>
                    <publicPackages>
                        <publicPackage>org.gephi.viz.engine.*</publicPackage>
                        <publicPackage>com.jogamp.*</publicPackage>
                        <publicPackage>org.joml.*</publicPackage>
                    </publicPackages>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
