<?xml version="1.0" encoding="UTF-8"?>
<project
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
        xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


    <modelVersion>4.0.0</modelVersion>
    <properties>
        <maven.version>3.0.4</maven.version>
    </properties>

    <parent>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-project</artifactId>
        <version>0.10.4</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>kotlin-gradle-plugin</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-stdlib</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>gradle-api</artifactId>
          <version>1.4</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-gradle-plugin-core</artifactId>
          <version>${project.version}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-gradle-plugin-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>

        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
              <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${project.version}</version>
                <configuration>
                    <annotationPaths>
                        <annotationPath>${basedir}/kotlinAnnotation</annotationPath>
                    </annotationPaths>
                </configuration>

                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals> <goal>compile</goal> </goals>
                    </execution>

                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals> <goal>test-compile</goal> </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Invoker plugin maintains local maven repository in local-repo for gradle integration tests -->
                <artifactId>maven-invoker-plugin</artifactId>
                <version>1.8</version>
                <configuration>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <localRepositoryPath>local-repo</localRepositoryPath>
                    <postBuildHookScript>verify</postBuildHookScript> <!-- no extension required -->
                    <extraArtifacts>
                        <extraArtifact>org.jetbrains.kotlin:kotlin-gradle-plugin-core:${project.version}</extraArtifact>
                        <extraArtifact>org.jetbrains.kotlin:kotlin-jdk-annotations:${project.version}</extraArtifact>
                        <extraArtifact>org.jetbrains.kotlin:kotlin-android-sdk-annotations:${project.version}</extraArtifact>
                    </extraArtifacts>
                </configuration>
                <executions>
                    <execution>
                        <id>create_local</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>jetbrains-utils</id>
            <url>http://repository.jetbrains.com/utils</url>
        </repository>
    </repositories>
</project>