<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<!-- mvn deploy -DskipTests -Denv.MAVEN_REPO_URL=ftp://ftp.cluster013.ovh.net/ -->

	<modelVersion>4.0.0</modelVersion>
	<groupId>org.jzy3d</groupId>
	<artifactId>panama-gl-bindings</artifactId>
	<version>1.3.0</version>
	<name>Panama GL Bindings</name>
	<packaging>pom</packaging>

	<scm>
		<connection>scm:git:https://gitlab.org/jzy3d/panama-gl-bindings</connection>
		<tag>panama-gl-bindings-1.2.0</tag>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jdk.version>22</jdk.version>
	</properties>

	<modules>
		<module>panama-gl-bindings-linux</module>
		<module>panama-gl-bindings-macos</module>
		<module>panama-gl-bindings-windows</module>
	</modules>

	<dependencies>
		<!-- OTHER MODULES -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>2.0.17</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.5.18</version>
		</dependency>
		
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-collections4</artifactId>
			<version>4.5.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>33.4.8-jre</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<type>jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>4.11.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<!-- Defines compiler flags and source/byte code version  -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<encoding>UTF-8</encoding>
					<compilerArgs>
						<!--<arg>enable-preview</arg>-->
					</compilerArgs>
				</configuration>
			</plugin>
			<!-- Add generated folder to build path -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/generated/java</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- SOURCE JAR -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Defines tests to include -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>
				<configuration>
					<includes>
						<include>**/Test*.java</include>
						<include>**/*Test.java</include>
						<include>**/ITTest*.java</include>
					</includes>
				</configuration>
			</plugin>

			<!-- RELEASE PLUGIN TO HELP CREATE RELEASE BRANCHES -->
			<plugin>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.8.1</version>
			</plugin>
		</plugins>
		<!-- DEPLOY TO FTP -->
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ftp</artifactId>
				<version>3.5.3</version>
			</extension>
		</extensions>
	</build>
	<!-- ============================================================== -->
	<!-- This section defines the path to natives. Debug how the OS and CPU
		names are detected by maven with mvn enforcer:display-info -->
	<profiles>
		<!-- Unix related settings -->
		<profile>
			<id>Unix</id>
			<activation>
				<os>
					<family>unix</family>
				</os>
			</activation>
			<properties>
				<vtk.platform>Linux-x86_64</vtk.platform>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M5</version>
						<configuration>
							<!-- Ensure stack trace get displayed -->
							<trimStackTrace>false</trimStackTrace>
							<!-- Configure Panama -->
							<argLine>
								--enable-native-access=ALL-UNNAMED -Djava.library.path=.:/usr/lib/x86_64-linux-gnu/
							</argLine>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- Mac Intel related settings -->
		<profile>
			<id>MacOS x86_64</id>
			<activation>
				<os>
					<family>mac</family>
					<arch>x86_64</arch>
				</os>
			</activation>
			<properties>
				<vtk.platform>Darwin-x86_64</vtk.platform>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M5</version>
						<configuration>
							<!-- Ensure stack trace get displayed -->
							<trimStackTrace>false</trimStackTrace>
							<!-- Configure Panama -->
							<argLine>
								-XstartOnFirstThread --enable-native-access=ALL-UNNAMED -Djava.library.path=.:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries/
							</argLine>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- Mac M1 related settings -->
		<profile>
			<id>MacOS Aarch64</id>
			<activation>
				<os>
					<family>mac</family>
					<arch>aarch64</arch>
				</os>
			</activation>
			<properties>
				<vtk.platform>Darwin-arm64</vtk.platform>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M5</version>
						<configuration>
							<!-- Ensure stack trace get displayed -->
							<trimStackTrace>false</trimStackTrace>
							<!-- Configure Panama -->
							<argLine>
								-XstartOnFirstThread --enable-native-access=ALL-UNNAMED -Djava.library.path=.:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries/
							</argLine>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- Windows related settings -->
		<profile>
			<id>Windows</id>
			<activation>
				<os>
					<family>Windows</family>
				</os>
			</activation>
			<properties>
				<vtk.platform>Windows-x86_64</vtk.platform>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M5</version>
						<configuration>
							<!-- Ensure stack trace get displayed -->
							<trimStackTrace>false</trimStackTrace>
							<!-- Configure Panama -->
							<argLine>
								-XstartOnFirstThread --enable-native-access=ALL-UNNAMED -Djava.library.path=.:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries/
							</argLine>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- JDK related activations -->
		<profile>
			<id>disable-java8-doclint</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<properties>
				<additionalparam>-Xdoclint:none</additionalparam>
			</properties>
		</profile>
	</profiles>
	<!-- Extra Maven Repositories to fetch artifacts from -->
	<repositories>
		<repository>
			<id>jzy3d-snapshots</id>
			<name>Jzy3d Snapshots</name>
			<url>https://maven.jzy3d.org/snapshots/</url>
		</repository>
		<repository>
			<id>jzy3d-releases</id>
			<name>Jzy3d Releases</name>
			<url>https://maven.jzy3d.org/releases/</url>
		</repository>
	</repositories>
	<!-- Used to deploy to Jzy3d repository -->
	<distributionManagement>
		<repository>
			<id>panama-ftp</id>
			<name>Jzy3d Maven Folder</name>
			<url>${env.MAVEN_REPO_URL}/maven/releases</url>
		</repository>
		<snapshotRepository>
			<id>panama-ftp</id>
			<name>Jzy3d Maven Folder SNAPSHOTS</name>
			<url>${env.MAVEN_REPO_URL}/maven/snapshots</url>
		</snapshotRepository>
	</distributionManagement>
</project>
