<?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.cryptomator</groupId>
	<artifactId>integrations-mac</artifactId>
	<version>1.0.0-beta2</version>

	<name>Cryptomator Integrations for macOS</name>
	<description>Provides optional macOS services used by Cryptomator</description>
	<url>https://github.com/cryptomator/integrations-mac</url>
	<scm>
		<connection>scm:git:git@github.com:cryptomator/integrations-mac.git</connection>
		<developerConnection>scm:git:git@github.com:cryptomator/integrations-mac.git</developerConnection>
		<url>git@github.com:cryptomator/integrations-mac.git</url>
	</scm>
	<developers>
		<developer>
			<name>Sebastian Stenzel</name>
			<email>sebastian.stenzel@skymatic.de</email>
			<timezone>+1</timezone>
			<organization>Skymatic GmbH</organization>
			<organizationUrl>http://skymatic.de</organizationUrl>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<!-- runtime dependencies -->
		<api.version>1.0.0-beta2</api.version>
		<slf4j.version>1.7.30</slf4j.version>
		<guava.version>30.0-jre</guava.version>
		<gson.version>2.8.6</gson.version>

		<!-- test dependencies -->
		<junit.jupiter.version>5.6.2</junit.jupiter.version>
		<mockito.version>3.3.3</mockito.version>
	</properties>

	<licenses>
		<license>
			<name>GNU Affero General Public License (AGPL) version 3.0</name>
			<url>https://www.gnu.org/licenses/agpl.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<dependencies>
		<dependency>
			<groupId>org.cryptomator</groupId>
			<artifactId>integrations-api</artifactId>
			<version>${api.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>${gson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>${guava.version}</version>
		</dependency>

		<!-- JUnit / Mockito / Hamcrest -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>${slf4j.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>${mockito.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>${project.basedir}/src/main/headers</directory>
							<followSymlinks>false</followSymlinks>
							<includes>
								<include>*.h</include>
							</includes>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<compilerArgs>
						<arg>-h</arg>
						<arg>${project.basedir}/src/main/headers</arg>
					</compilerArgs>
					<release>11</release>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<execution>
						<id>check-preconditions</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireOS>
									<family>mac</family>
									<message>This build configuration requires macOS.</message>
								</requireOS>
								<requireFilesExist>
									<files>
										<file>/usr/bin/xcodebuild</file>
									</files>
									<message>This build configuration requires Xcode command line tools. Missing
										"xcodebuild" command.
									</message>
								</requireFilesExist>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.6.0</version>
				<executions>
					<execution>
						<goals>
							<goal>exec</goal>
						</goals>
						<phase>compile</phase>
						<configuration>
							<executable>xcodebuild</executable>
							<workingDirectory>${project.basedir}/src/main/native</workingDirectory>
							<arguments>
								<argument>-project</argument>
								<argument>Integrations.xcodeproj</argument>
								<argument>-scheme</argument>
								<argument>Integrations</argument>
								<argument>-configuration</argument>
								<argument>Release</argument>
								<argument>-archivePath</argument>
								<argument>${project.build.directory}/integrations.xcarchive</argument>
								<argument>-quiet</argument>
								<argument>clean</argument>
								<argument>archive</argument>
								<argument>USER_HEADER_SEARCH_PATHS="${project.basedir}/src/main/headers/ ${java.home}/include/**"</argument>
							</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<phase>process-classes</phase>
						<configuration>
							<outputDirectory>${project.build.directory}/classes</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/integrations.xcarchive/Products/usr/local/lib</directory>
									<includes>
										<include>*.dylib</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.2</version>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<quiet>true</quiet>
					<release>11</release>
					<tags>
						<!-- workaround for "unknown tag: implNote", see https://blog.codefx.org/java/new-javadoc-tags/#Maven  -->
						<tag>
							<name>apiNote</name>
							<placement>a</placement>
							<head>API Note:</head>
						</tag>
						<tag>
							<name>implSpec</name>
							<placement>a</placement>
							<head>Implementation Requirements:</head>
						</tag>
						<tag>
							<name>implNote</name>
							<placement>a</placement>
							<head>Implementation Note:</head>
						</tag>
						<tag>
							<name>param</name>
						</tag>
						<tag>
							<name>return</name>
						</tag>
						<tag>
							<name>throws</name>
						</tag>
						<tag>
							<name>since</name>
						</tag>
						<tag>
							<name>version</name>
						</tag>
						<tag>
							<name>serialData</name>
						</tag>
						<tag>
							<name>see</name>
						</tag>
					</tags>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>sign</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>deploy-central</id>
			<distributionManagement>
				<repository>
					<id>ossrh</id>
					<name>Maven Central</name>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>deploy-github</id>
			<distributionManagement>
				<repository>
					<id>github</id>
					<name>GitHub Packages</name>
					<url>https://maven.pkg.github.com/cryptomator/integrations-mac</url>
				</repository>
			</distributionManagement>
		</profile>
	</profiles>
</project>