<?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>de.pitkley</groupId>
    <artifactId>jmccs-osx</artifactId>
    <version>0.2.1</version>

    <name>jMCCS OS X</name>
    <description>
        This is a OS X implementation for jMCCS
    </description>
    <url>https://github.com/pitkley/jmccs-osx</url>

    <licenses>
        <license>
            <name>GNU General Public License 3</name>
            <url>http://opensource.org/licenses/GPL-3.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Pit Kleyersburg</name>
            <email>pitkley@googlemail.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:pitkley/jmccs-osx.git</connection>
        <developerConnection>scm:git:git@github.com:pitkley/jmccs-osx.git</developerConnection>
        <url>git@github.com:pitkley/jmccs-osx.git</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>de.pitkley.jmccs</groupId>
            <artifactId>jmccs</artifactId>
            <version>0.3.0</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>4.1.0</version>
        </dependency>
    </dependencies>

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

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <id>osx</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.3.2</version>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>o64-clang</executable>
                            <workingDirectory>${basedir}/src/main/native</workingDirectory>
                            <arguments>
                                <argument>-O3</argument>
                                <argument>-arch i386</argument>
                                <argument>-arch x86_64</argument>
                                <argument>-shared</argument>
                                <argument>-o</argument>
                                <argument>../resources/libmccs.dylib</argument>
                                <argument>-framework</argument>
                                <argument>AppKit</argument>
                                <argument>-framework</argument>
                                <argument>IOKit</argument>
                                <argument>-framework</argument>
                                <argument>CoreGraphics</argument>
                                <argument>MCCS.c</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.5</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
