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

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

    <artifactId>kotlin-reflect</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <!-- Do not use ${protobuf.version} because it couldn't be resolve in gradle -->
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>target/copied-sources</sourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>

                <executions>
                    <execution>
                        <id>copy-sources</id>
                        <phase>process-sources</phase>
                        <configuration>
                            <target>
                                <delete dir="${basedir}/target/copied-sources" failonerror="false" />
                                <copy todir="${basedir}/target/copied-sources">
                                    <fileset dir="${basedir}/../../../core/descriptor.loader.java/src"/>
                                    <fileset dir="${basedir}/../../../core/descriptors/src"/>
                                    <fileset dir="${basedir}/../../../core/descriptors.runtime/src"/>
                                    <fileset dir="${basedir}/../../../core/reflection.jvm/src"/>
                                    <fileset dir="${basedir}/../../../core/serialization/src"/>
                                    <fileset dir="${basedir}/../../../core/serialization.jvm/src"/>
                                    <fileset dir="${basedir}/../../../core/util.runtime/src"/>
                                </copy>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${project.version}</version>

                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
