<?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">
  <parent>
    <artifactId>kotlin-project</artifactId>
    <groupId>org.jetbrains.kotlin</groupId>
    <version>1.1.51</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>kotlin-compiler-embeddable</artifactId>
  <description>the Kotlin compiler embeddable</description>
  <build>
    <testSourceDirectory>test/kotlin</testSourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-sources-for-shade-plugin</id>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <createSourcesJar>true</createSourcesJar>
              <filters>
                <filter>
                  <artifact>*:kotlin-compiler</artifact>
                  <excludes>
                    <exclude>com/sun/jna/**</exclude>
                    <exclude>net/rubygrapefruit/**</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>com.intellij</pattern>
                  <shadedPattern>${kotlin.relocated.package}.com.intellij</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${kotlin.relocated.package}.com.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache</pattern>
                  <shadedPattern>${kotlin.relocated.package}.org.apache</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.jdom</pattern>
                  <shadedPattern>${kotlin.relocated.package}.org.jdom</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.fusesource</pattern>
                  <shadedPattern>${kotlin.relocated.package}.org.fusesource</shadedPattern>
                  <excludes>
                    <exclude>org.fusesource.jansi.internal.CLibrary</exclude>
                  </excludes>
                </relocation>
                <relocation>
                  <pattern>org.picocontainer</pattern>
                  <shadedPattern>${kotlin.relocated.package}.org.picocontainer</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.jline</pattern>
                  <shadedPattern>${kotlin.relocated.package}.org.jline</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>gnu</pattern>
                  <shadedPattern>${kotlin.relocated.package}.gnu</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.inject</pattern>
                  <shadedPattern>${kotlin.relocated.package}.javax.inject</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>kotlinx.coroutines</pattern>
                  <shadedPattern>${kotlin.relocated.package}.kotlinx.coroutines</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>test-compile</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-version}</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <workingDirectory>${project.build.directory}</workingDirectory>
          <systemPropertyVariables>
            <compilerJar>${project.artifactId}-${project.parent.version}.jar</compilerJar>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test-junit</artifactId>
      <version>1.1.51</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>kotlin-test</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <kotlin.relocated.package>org.jetbrains.kotlin</kotlin.relocated.package>
    <maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
    <maven.version>3.0.4</maven.version>
    <surefire-version>2.16</surefire-version>
  </properties>
</project>

