<?xml version="1.0"?>
<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>
    <groupId>org.jenkins-ci</groupId>
    <artifactId>jenkins</artifactId>
    <version>1.30</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>bytecode-compatibility-transformer</artifactId>
  <name>Bytecode transformation-based library for managing backward compatibility</name>
  <version>1.5</version>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>test-compile</phase>
            <configuration>
              <tasks>
                <mkdir dir="target/test-classes/v1" />
                <mkdir dir="target/test-classes/v2" />
                <mkdir dir="target/test-classes/client" />

                <path id="lib">
                  <fileset dir="target/lib" includes="*.jar" />
                </path>

                <!-- basic sanity. unmodified client and v1 should work as expected -->
                <javac source="1.6" target="1.6" debug="true" srcdir="src/test/v1" destdir="target/test-classes/v1">
                  <classpath>
                    <path refid="lib" />
                  </classpath>
                </javac>
                <javac source="1.6" target="1.6" debug="true" srcdir="src/test/client" destdir="target/test-classes/client">
                  <classpath>
                    <pathelement path="target/classes" />
                    <pathelement path="target/test-classes/v1" />
                    <path refid="maven.compile.classpath" />
                    <path refid="maven.test.classpath" />
                    <path refid="lib" />
                  </classpath>
                </javac>

                <!-- compile v2 -->
                <javac source="1.6" target="1.6" debug="true" srcdir="src/test/v2" destdir="target/test-classes/v2">
                  <classpath>
                    <path refid="maven.compile.classpath" />
                    <pathelement path="target/classes" />
                    <path refid="lib" />
                  </classpath>
                </javac>
              </tasks>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.6</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.ivy</groupId>
                  <artifactId>ivy</artifactId>
                  <version>2.3.0</version>
                  <outputDirectory>target/lib</outputDirectory>
                  <destFileName>ivy.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci</groupId>
      <artifactId>annotation-indexer</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.9.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kohsuke</groupId>
      <artifactId>asm5</artifactId>
      <version>5.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci</groupId>
      <artifactId>constant-pool-scanner</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <scm>
    <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}.git</developerConnection>
    <url>https://github.com/jenkinsci/${project.artifactId}</url>
  </scm>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>

  <licenses>
    <license>
      <name>The MIT license</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

</project>
