<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>

    <parent>
        <groupId>com.mobidevelop.robovm</groupId>
        <artifactId>robovm-compiler-parent</artifactId>
        <version>2.3.12</version>
    </parent>

    <artifactId>robovm-rt</artifactId>
    <name>RoboVM Runtime Library</name>
    <packaging>jar</packaging>

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

    <build>
        <resources>
            <resource><directory>robovm/src/main/resources</directory></resource>
            <resource><directory>libcore/crypto/src/main/resources</directory></resource>
            <resource><directory>libcore/dalvik/src/main/resources</directory></resource>
            <resource><directory>libcore/json/src/main/resources</directory></resource>
            <resource><directory>libcore/libdvm/src/main/resources</directory></resource>
            <resource><directory>libcore/luni/src/main/resources</directory></resource>
            <resource><directory>libcore/xml/src/main/resources</directory></resource>
            <resource><directory>external/apache-xml/src/main/resources</directory></resource>
            <resource><directory>external/bouncycastle/bcpkix/src/main/resources</directory></resource>
            <resource><directory>external/bouncycastle/bcprov/src/main/resources</directory></resource>
            <resource><directory>external/javasqlite/src/main/resources</directory></resource>
            <resource><directory>external/okhttp/src/main/resources</directory></resource>
            <resource>
                <directory>libcore/luni/src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>external/apache-xml/src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>robovm/src/filtered-java/</directory>
                <targetPath>${project.build.directory}/generated-sources/filtered-java</targetPath>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- provide empty bootclass its the RT -->
                <configuration combine.self="override">
                    <compilerArguments>
                        <target>1.8</target>
                        <source>1.8</source>
                        <bootclasspath>""</bootclasspath>
                    </compilerArguments>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/filtered-java</source>
                                <source>robovm/src/main/java</source>
                                <source>libcore/crypto/src/main/java</source>
                                <source>libcore/dalvik/src/main/java</source>
                                <source>libcore/json/src/main/java</source>
                                <source>libcore/libdvm/src/main/java</source>
                                <source>libcore/luni/src/main/java</source>
                                <source>libcore/xml/src/main/java</source>
                                <source>external/apache-http/src</source>
                                <source>external/apache-xml/src/main/java</source>
                                <source>external/bouncycastle/bcpkix/src/main/java</source>
                                <source>external/bouncycastle/bcprov/src/main/java</source>
                                <source>external/javasqlite/src/main/java</source>
                                <source>external/okhttp/src/main/java</source>
                                <source>external/okhttp/android/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>org/bouncycastle/**/*</exclude>
                        <exclude>org/conscrypt/**/*</exclude>
                        <exclude>com/squareup/**/*</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration combine.self="override">
                    <maxmemory>2g</maxmemory>
                    <!-- docs for RT: no lint, no bootclass and api 8 -->
                    <doclint>none</doclint>
                    <source>8</source>
                    <bootclasspath>""</bootclasspath>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>org.bouncycastle</pattern>
                                    <shadedPattern>com.android.org.bouncycastle</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.conscrypt</pattern>
                                    <shadedPattern>com.android.org.conscrypt</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.squareup</pattern>
                                    <shadedPattern>com.android</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
