<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.scijava</groupId>
		<artifactId>pom-scijava</artifactId>
		<version>37.0.0</version>
		<relativePath />
	</parent>

	<artifactId>scijava-ops-flim</artifactId>
	<version>1.0.0</version>

	<name>SciJava Ops FLIM</name>
	<description>Fluorescence lifetime analysis in SciJava Ops.</description>
	<url>https://github.com/scijava/scijava</url>
	<inceptionYear>2024</inceptionYear>
	<organization>
		<name>SciJava</name>
		<url>https://scijava.org/</url>
	</organization>
	<licenses>
		<license>
			<name>Simplified BSD License</name>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>ctrueden</id>
			<name>Curtis Rueden</name>
			<roles>
				<role>founder</role>
				<role>debugger</role>
				<role>reviewer</role>
				<role>maintainer</role>
			</roles>
		</developer>
		<developer>
			<id>gselzer</id>
			<name>Gabriel Selzer</name>
			<roles>
				<role>founder</role>
				<role>debugger</role>
				<role>reviewer</role>
				<role>support</role>
			</roles>
		</developer>
		<developer>
			<id>hinerm</id>
			<name>Mark Hiner</name>
			<roles>
				<role>founder</role>
				<role>debugger</role>
				<role>reviewer</role>
				<role>support</role>
			</roles>
		</developer>
	</developers>
	<contributors>
		<contributor>
			<name>Dasong Gao</name>
			<roles><role>founder</role></roles>
			<properties><id>Xanthorapedia</id></properties>
		</contributor>
	</contributors>

	<mailingLists>
		<mailingList>
			<name>Image.sc Forum</name>
			<archive>https://forum.image.sc/tag/scijava</archive>
		</mailingList>
	</mailingLists>

	<scm>
		<connection>scm:git:https://github.com/scijava/scijava</connection>
		<developerConnection>scm:git:git@github.com:scijava/scijava</developerConnection>
		<tag>scijava-aggregator-1.0.0</tag>
		<url>https://github.com/scijava/scijava</url>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/scijava/scijava/issues</url>
	</issueManagement>
	<ciManagement>
		<system>GitHub Actions</system>
		<url>https://github.com/scijava/scijava/actions</url>
	</ciManagement>

	<properties>
		<package-name>org.scijava.ops.flim</package-name>

		<license.licenseName>bsd_2</license.licenseName>
		<license.copyrightOwners>SciJava developers.</license.copyrightOwners>

		<!--
		NB: Older versions of OpenJDK 11 have a bug in the javadoc tool,
		which causes errors like:

		[ERROR] javadoc: error - The code being documented uses packages
		in the unnamed module, but the packages defined in
		https://github.com/scijava/scijava/apidocs/ are in named modules.

		The most recent version of OpenJDK 11 known to have this problem
		is 11.0.8; the oldest version known to have fixed it is 11.0.17.
		Therefore, we set the minimum build JDK version to 11.0.17 here.
		-->
		<scijava.jvm.build.version>[11.0.17,)</scijava.jvm.build.version>
		<scijava.jvm.version>11</scijava.jvm.version>

    <scijava.ops.parse>true</scijava.ops.parse>

		<flimlib.version>2.1.1</flimlib.version>

		<!-- TEMP: Until pom-scijava 38.0.0 is released. -->
		<scijava-maven-plugin.version>3.0.0</scijava-maven-plugin.version>
	</properties>

	<dependencies>
		<!-- SciJava dependencies -->
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-concurrent</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-function</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-ops-spi</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-types</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- FLIMLib dependencies -->
		<dependency>
			<groupId>flimlib</groupId>
			<artifactId>flimlib</artifactId>
			<version>${flimlib.version}</version>
		</dependency>

		<!-- ImgLib2 dependencies -->
		<dependency>
			<groupId>net.imglib2</groupId>
			<artifactId>imglib2</artifactId>
		</dependency>
		<dependency>
			<groupId>net.imglib2</groupId>
			<artifactId>imglib2-roi</artifactId>
		</dependency>

		<!-- Third-party dependencies -->
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
		</dependency>

		<!-- Runtime dependencies -->
		<dependency>
			<groupId>flimlib</groupId>
			<artifactId>flimlib</artifactId>
			<version>${flimlib.version}</version>
			<classifier>${scijava.natives.classifier}</classifier>
			<scope>runtime</scope>
		</dependency>

		<!-- Test scope dependencies -->
		<dependency>
			<groupId>io.scif</groupId>
			<artifactId>scifio</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.scif</groupId>
			<artifactId>scifio-lifesci</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-ops-api</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-ops-engine</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-ops-image</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.scijava</groupId>
			<artifactId>scijava-common</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>scijava.public</id>
			<url>https://maven.scijava.org/content/groups/public</url>
		</repository>
	</repositories>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<annotationProcessorPaths>
						<path>
							<groupId>org.scijava</groupId>
							<artifactId>scijava-ops-indexer</artifactId>
							<version>${project.version}</version>
						</path>
					</annotationProcessorPaths>
					<fork>true</fork>
					<compilerArgs>
						<arg>-Ascijava.ops.parse="${scijava.ops.parse}"</arg>
						<arg>-Ascijava.ops.opVersion="${project.version}"</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<links>
						<link>https://javadoc.scijava.org/Java11/</link>
						<link>https://javadoc.scijava.org/ImgLib2/</link>
						<link>https://javadoc.scijava.org/SCIFIO/</link>
						<link>https://javadoc.scijava.org/SciJava/</link>
					</links>
					<tagletArtifacts>
						<tagletArtifact>
							<groupId>org.scijava</groupId>
							<artifactId>scijava-taglets</artifactId>
							<version>${project.version}</version>
						</tagletArtifact>
					</tagletArtifacts>
					<tags>
						<tag>
							<name>implNote</name>
							<placement>a</placement>
							<head>Implementation Note:</head>
						</tag>
					</tags>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>enforce-package-rules</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<rules>
								<NoPackageCyclesRule implementation="org.scijava.maven.plugin.enforcer.NoPackageCyclesRule" />
								<NoSubpackageDependenceRule implementation="org.scijava.maven.plugin.enforcer.NoSubpackageDependenceRule" />
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.alexecollins.maven.plugin</groupId>
				<artifactId>script-maven-plugin</artifactId>
				<version>1.0.0</version>
				<executions>
					<execution>
						<id>union-metadata-indices</id>
						<phase>process-test-classes</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<language>ruby</language>
							<script>
								# Append the source plugin annotations to the test plugin annotations
								require 'set'

								# Handle windows paths
								basedir = '${project.basedir}'.gsub /\\+/, '\\\\'

								# Reads plugin metadata into a set of strings, one per plugin declaration.
								def read_plugins(path)
								delim = 'UNIQUE-SEQUENCE-THAT-NO-PLUGIN-WILL-EVER-USE'
								return File.exist?(path) ? File.read(path).sub('}{', '}' + delim + '{').split(delim).to_set : Set.new()
								end

								# Read in main and test scope plugin annotations.
								['ops.yaml'].each do |pluginsPath|
								mainPluginsPath = "#{basedir}/target/classes/#{pluginsPath}"
								testPluginsPath = "#{basedir}/target/test-classes/#{pluginsPath}"
								mainPlugins = read_plugins(mainPluginsPath)
								testPlugins = read_plugins(testPluginsPath)

								# Write out unioned plugin annotations to test scope plugin annotations.
								# Without this, the test scope code does not know of the main scope plugins.
								allPlugins = mainPlugins.union(testPlugins)
								unless allPlugins.empty?()
								require 'fileutils'
								FileUtils.mkdir_p File.dirname(testPluginsPath)
								File.write(testPluginsPath, allPlugins.to_a.join(''))
								end
								end
							</script>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.jruby</groupId>
						<artifactId>jruby-complete</artifactId>
						<version>9.2.11.1</version>
						<scope>runtime</scope>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>only-eclipse-scijava</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<!--
						Configure the Eclipse m2e plugin to support needed plugins.
						-->
						<plugin>
							<groupId>org.eclipse.m2e</groupId>
							<artifactId>lifecycle-mapping</artifactId>
							<!--
							NB: Eclipse cannot handle an overridden version property here!
							The version needs to stay hardcoded at 1.0.0.
							-->
							<version>1.0.0</version>
							<configuration>
								<lifecycleMappingMetadata>
									<pluginExecutions combine.children="append">
										<!--
										NB: Make Eclipse union the metadata indices on every build; see:
										https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html
										-->
										<pluginExecution>
											<pluginExecutionFilter>
												<groupId>com.alexecollins.maven.plugin</groupId>
												<artifactId>script-maven-plugin</artifactId>
												<versionRange>${script-maven-plugin.version}</versionRange>
												<goals>
													<goal>execute</goal>
												</goals>
											</pluginExecutionFilter>
											<action>
												<execute>
													<runOnConfiguration>true</runOnConfiguration>
													<!--
													NB: You might think we could run the annotations
													union script once only, at configuration time.
													Unfortunately, when configuration happens in Eclipse,
													the plugin annotations have not yet been generated.
													So let's redo the union on every incremental build.
													That'll show 'em!
													-->
													<runOnIncremental>true</runOnIncremental>
												</execute>
											</action>
										</pluginExecution>
									</pluginExecutions>
								</lifecycleMappingMetadata>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
	</profiles>
</project>
