<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mobidevelop.robovm</groupId>
    <version>2.3.23.0</version>
    <artifactId>cocoatouch-swift-parent</artifactId>
    <name>CocoaTouch Swift Pods Parent</name>
    <packaging>pom</packaging>
    <url>https://github.com/MobiVM/robovm-cocoatouch-swift</url>
    <description>Common rules and settings for CocoaTouch Swift Pods</description>
    <inceptionYear>2025</inceptionYear>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>Developers</id>
            <url>https://github.com/orgs/MobiVM/people</url>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/MobiVM/robovm-cocoatouch-swift</url>
    </issueManagement>

    <scm>
        <url>https://github.com/MobiVM/robovm-cocoatouch-swift</url>
        <connection>scm:git:https://github.com/MobiVM/robovm-cocoatouch-swift.git</connection>
        <developerConnection>scm:https://github.com/MobiVM/robovm-cocoatouch-swift.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <sonatypeOssDistMgmtSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <robovm.version>2.3.23</robovm.version>
        <skipTests>true</skipTests>
        <kotlin.version>1.9.25</kotlin.version>
        <!-- override with -DskipBuildBinaries=true to skip building natives -->
        <skipBuildBinaries>false</skipBuildBinaries>
    </properties>

    <profiles>
        <!-- profile that replaces oss-parent-7 functionality, being activated from release plugin -->
        <profile>
            <id>ossrh-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
        </snapshotRepository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>maven.org</id>
            <url>http://repo1.maven.org/maven2/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <!-- sonatype to access snapshots -->
    <repositories>
        <repository>
            <name>Central Portal Snapshots</name>
            <id>central-portal-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <!-- common robovm dependencies -->
    <dependencies>
        <dependency>
            <groupId>com.mobidevelop.robovm</groupId>
            <artifactId>robovm-rt</artifactId>
            <version>${robovm.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mobidevelop.robovm</groupId>
            <artifactId>robovm-objc</artifactId>
            <version>${robovm.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mobidevelop.robovm</groupId>
            <artifactId>robovm-cocoatouch</artifactId>
            <version>${robovm.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- adds META-INF/robovm.xml where available -->
        <resources>
            <resource>
                <directory>src/main/robopods</directory>
            </resource>
        </resources>

        <!--  -->
        <!-- common plugins: versions to be specified only here -->
        <!--  -->
        <pluginManagement>
            <plugins>
                <!-- compiler: produce Java8 code everywhere by default -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <release>8</release>
                        <debug>true</debug>
                        <optimize>true</optimize>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <doclint>none</doclint>
                        <release>8</release>
                        <detectJavaApiLink>false</detectJavaApiLink>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <excludeResources>true</excludeResources>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <sourceDirs>
                                    <source>src/main/kotlin</source>
                                    <source>src/main/resources</source>
                                </sourceDirs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/main/kotlin</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.4</version>
                </plugin>
                <!-- Central publishing -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.8.0</version>
                    <extensions>true</extensions>
                    <configuration>
                       <publishingServerId>sonatype-nexus-snapshots</publishingServerId>
                       <autoPublish>false</autoPublish>
                    </configuration>
                </plugin>  
            </plugins>
        </pluginManagement>


        <!--  -->
        <!-- Common actions: build, javadoc and sources -->
        <!--  -->
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>
