<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.heronarts</groupId>
    <artifactId>glxstudio</artifactId>
    <version>1.2.0</version>
    <packaging>jar</packaging>

	<name>GLXStudio</name>
	<description>Chromatik lighting application, built on LX and GLX frameworks.</description>
	<url>https://chromatik.co/</url>
	
	<licenses>
		<license>
			<name>Chromatik / LX Software License and Distribution Agreement</name>
			<url>https://chromatik.co/license/</url>
		</license>
	</licenses>
	
	<developers>
		<developer>
			<name>Mark Slee</name>
			<email>mark@heronarts.com</email>
			<organization>Heron Arts</organization>
			<organizationUrl>https://github.com/heronarts/</organizationUrl>
		</developer>
	</developers>
	
	<scm>
		<connection>scm:git:git://github.com/heronarts/Chromatik.git</connection>
		<developerConnection>scm:git:git://github.com/heronarts/Chromatik.git</developerConnection>
		<url>https://github.com/heronarts/Chromatik/</url>
	</scm>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                        
        <maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
		<exec-maven-plugin.version>3.1.1</exec-maven-plugin.version>
		<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
		<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
		<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>

		<gson.version>2.13.1</gson.version>
        <lwjgl.version>3.3.6</lwjgl.version>
        <lx.vm.args></lx.vm.args>
        
    </properties>
    
    <profiles>
		<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>
				<lx.vm.args>-XstartOnFirstThread</lx.vm.args>
			</properties>
		</profile>
		<profile>
			<id>lwjgl-natives-macos-aarch64</id>
			<activation>
				<os>
					<family>mac</family>
					<arch>aarch64</arch>
				</os>
			</activation>
			<properties>
				<lwjgl.natives>natives-macos-arm64</lwjgl.natives>
				<lx.vm.args>-XstartOnFirstThread</lx.vm.args>
			</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>
		<profile>
			<id>lwjgl-natives-linux-aarch64</id>
			<activation>
				<os>
					<family>unix</family>
					<name>linux</name>
					<arch>aarch64</arch>
				</os>
			</activation>
			<properties>
				<lwjgl.natives>natives-linux-arm64</lwjgl.natives>
			</properties>
		</profile>
		<profile>
			<id>lwjgl-natives-linux-amd64</id>
			<activation>
				<os>
					<family>unix</family>
					<name>linux</name>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<lwjgl.natives>natives-linux</lwjgl.natives>
			</properties>
		</profile>
		<profile>
			<id>fat</id>
			<build>
				<plugins>
		        	<plugin>
			            <groupId>org.apache.maven.plugins</groupId>
			            <artifactId>maven-assembly-plugin</artifactId>
			            <version>${maven-assembly-plugin.version}</version>
			
			            <configuration>
			                <descriptorRefs>
			                    <descriptorRef>jar-with-dependencies</descriptorRef>
			                </descriptorRefs>
			                <archive>
						        <manifest>
						          	<mainClass>heronarts.lx.studio.Chromatik</mainClass>
						        </manifest>
					      	</archive>
			            </configuration>
			            
			            <executions>
			                <execution>
			                    <id>make-assembly</id>
			                    <phase>package</phase>
			                    <goals>
			                        <goal>single</goal>
			                    </goals>
			                </execution>
			            </executions>
		        	</plugin>
		        </plugins>
	        </build>
		</profile>
		<profile>
            <id>deploy</id>
            <build>
	            <plugins>
	            	<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>0.7.0</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
	            </plugins>
            </build>
        </profile>
	</profiles>
    
    <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>com.heronarts</groupId>
            <artifactId>lx</artifactId>
            <version>${project.version}</version>
        </dependency>
		<dependency>
            <groupId>com.heronarts</groupId>
            <artifactId>glx</artifactId>
            <version>${project.version}</version>
        </dependency>    
		<dependency>
			<groupId>org.lwjgl</groupId>
			<artifactId>lwjgl</artifactId>
			<classifier>${lwjgl.natives}</classifier>
		</dependency>
		<dependency>
			<groupId>org.lwjgl</groupId>
			<artifactId>lwjgl-bgfx</artifactId>
			<classifier>${lwjgl.natives}</classifier>
		</dependency>
		<dependency>
			<groupId>org.lwjgl</groupId>
			<artifactId>lwjgl-glfw</artifactId>
			<classifier>${lwjgl.natives}</classifier>
		</dependency>
		<dependency>
			<groupId>org.lwjgl</groupId>
			<artifactId>lwjgl-nanovg</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-tinyfd</artifactId>
			<classifier>${lwjgl.natives}</classifier>
		</dependency>
		<dependency>
			<groupId>org.lwjgl</groupId>
			<artifactId>lwjgl-assimp</artifactId>
			<classifier>${lwjgl.natives}</classifier>
		</dependency>
		<dependency>
		    <groupId>org.openjdk.nashorn</groupId>
		    <artifactId>nashorn-core</artifactId>
		    <version>15.4</version>
		</dependency>
		<dependency>
		    <!-- argh, this old version seems to be needed for the openjdk nashorn build! -->
		    <groupId>org.slf4j</groupId>
		    <artifactId>slf4j-simple</artifactId>
		    <version>1.7.36</version>
		</dependency>
  	</dependencies>
  	
  	 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:all,-this-escape</arg>
                        <arg>-Xpkginfo:always</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            
            <plugin>
	            <groupId>org.codehaus.mojo</groupId>
	            <artifactId>exec-maven-plugin</artifactId>
	            <version>${exec-maven-plugin.version}</version>
	            <configuration>
          			<executable>java</executable>
	          		<arguments>
						<argument>${lx.vm.args}</argument>
			            <argument>-classpath</argument>
		    	        <classpath/>
		        	    <argument>heronarts.lx.studio.Chromatik</argument>
          			</arguments>
        		</configuration>
	        </plugin>           
        	
        	<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                        <classifier>sources</classifier>
                            <includes>
                                <include>LICENSE</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
				<configuration>
					<release>21</release>
					<bottom>Chromatik / LX libraries by Mark C. Slee. &#169; 2012-2025</bottom>
	                <stylesheetfile>build/stylesheet.css</stylesheetfile>
	                <doctitle>Chromatik API Specification (${project.version})</doctitle>
	                <doclint>all,-missing</doclint>
	                <header>Chromatik (${project.version})</header>
	                <overview>${basedir}/src/main/java/overview.html</overview>
	                <windowtitle>Chromatik / LX API</windowtitle>
	                <includeDependencySources>true</includeDependencySources>
					<dependencySourceIncludes>
                		<!-- include ONLY dependencies I control -->
                		<dependencySourceInclude>com.heronarts:*</dependencySourceInclude>
              		</dependencySourceIncludes>
	                <offlineLinks>
            			<offlineLink>
                			<url>https://javadoc.io/doc/com.google.code.gson/gson/${gson.version}/com.google.gson/</url>
                			<location>../../build/gson</location>
            			</offlineLink>
        			</offlineLinks>
        			<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
				</configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
		</plugins>
	</build>
</project>
