<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.github.nbauma109</groupId>
  <artifactId>transformer-api</artifactId>
  <version>5.0.0</version>
  <packaging>jar</packaging>

  <name>Transformer API</name>
  <description>Unified Java API for multiple decompilers (Fernflower, Vineflower, Procyon, CFR, JD-Core, JADX)</description>
  <url>https://github.com/nbauma109/transformer-api</url>

  <licenses>
    <license>
      <name>GNU General Public License, Version 3</name>
      <url>https://www.gnu.org/licenses/gpl-3.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>nbauma109</id>
      <name>Nicolas Baumann</name>
      <url>https://github.com/nbauma109</url>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>25</maven.compiler.release>
    <version.asm>9.10.1</version.asm>
    <version.jadx>1.5.6</version.jadx>
    <version.procyon>0.6.2</version.procyon>
    <version.fernflower>262.8665.337</version.fernflower>

  <!-- ======================================================================
       Vineflower - Fork of the Fernflower decompiler 
       ======================================================================
       Modern Java decompiler aiming to be as accurate as possible, with an
       emphasis on output quality. 
       We use here a shaded version of Vineflower decompiler relocating package 
       org.jetbrains.java.decompiler to org.vineflower.java.decompiler.
       This allows this API to have both VineFlower and FernFlower
       in the classpath.
     ====================================================================== -->
    <version.vineflower>1.12.0</version.vineflower>

  <!-- ======================================================================
       JD-Core v0 — Pattern-Matching Decompiler (JAD-style engine)
       ======================================================================
       Operates directly on raw bytecode without building an intermediate
       representation. It reconstructs high-level constructs through opcode
       pattern templates that identify loops, branches, switches, synchronized
       sections, and try/finally blocks. This design yields remarkable speed.
       JD-Core v0 also supports line-number realignment for debugging.
     ====================================================================== -->
    <version.jd-core-v0>0.8.30</version.jd-core-v0>

  <!-- ======================================================================
       JD-Core v1 — Analytical Decompiler (Fernflower-style engine)
       ======================================================================
       Uses a control flow graph instead of pattern templates and does not
       process bytecode directly. It performs graph transformations and
       reductions and converts bytecode into an intermediate language syntax.
       This should help to produce cross-language output 
       (.class -> Java, Kotlin, Groovy, or even .apk -> Java)
       Like JD-Core v0, it realigns line numbers for debugger compatibility.
     ====================================================================== -->
    <version.jd-core-v1>1.3.4</version.jd-core-v1>
    <version.cfr>0.153</version.cfr>
  </properties>

  <scm>
    <connection>scm:git:https://github.com/nbauma109/transformer-api.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/nbauma109/transformer-api.git</developerConnection>
    <url>https://github.com/nbauma109/transformer-api</url>
    <tag>5.0.0</tag>
  </scm>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <testExcludes>
                <testExclude>**/TestCompact.java</testExclude>
              </testExcludes>
            </configuration>
          </execution>
          <execution>
            <!--
              TestCompact is decompiled by the test suite and its expected outputs are
              sensitive to the compiler that produced it: cross-compiling with a newer
              javac using the release flag still emits a different LineNumberTable for
              switch expressions than a genuine JDK 21 javac (confirmed by comparing
              method5's bytecode across both). Route this file through the real JDK 21
              toolchain so its class file stays byte-comparable to the checked-in
              test-*.jar fixtures. Requires a toolchains.xml with a jdk/21 entry; CI
              generates one automatically by passing multiple java-version entries to
              actions/setup-java. Falls back to the current JDK with a warning if no
              matching toolchain is registered.
            -->
            <id>compile-test-compact-jdk21</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <release>21</release>
              <jdkToolchain>
                <version>21</version>
              </jdkToolchain>
              <testIncludes>
                <testInclude>**/TestCompact.java</testInclude>
              </testIncludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>false</addClasspath>
            </manifest>
            <manifestEntries>
              <transformer-api-version>${project.version}</transformer-api-version>
              <fernflower-version>${version.fernflower}</fernflower-version>
              <vineflower-version>${version.vineflower}</vineflower-version>
              <jd-core-v0-version>${version.jd-core-v0}</jd-core-v0-version>
              <jd-core-v1-version>${version.jd-core-v1}</jd-core-v1-version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.3.1</version>
        <configuration>
          <goals>install</goals>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.15</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.12.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.2.8</version>
        <executions>
          <execution>
            <id>sign-release</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.11.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </repository>
    <repository>
      <id>google</id>
      <url>https://maven.google.com</url>
    </repository>
    <repository>
      <id>intellij</id>
      <url>https://www.jetbrains.com/intellij-repository/releases/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.22.0</version>
    </dependency>
    <dependency>
        <groupId>io.github.nbauma109</groupId>
        <artifactId>vineflower</artifactId>
        <version>${version.vineflower}</version>
    </dependency>
    <dependency>
      <groupId>com.jetbrains.intellij.java</groupId>
      <artifactId>java-decompiler-engine</artifactId>
      <version>${version.fernflower}</version>
    </dependency>
    <dependency>
      <groupId>io.github.nbauma109</groupId>
      <artifactId>jd-core-v0</artifactId>
      <version>${version.jd-core-v0}</version>
    </dependency>
    <dependency>
      <groupId>io.github.nbauma109</groupId>
      <artifactId>jd-core</artifactId>
      <version>${version.jd-core-v1}</version>
    </dependency>
    <dependency>
      <groupId>com.github.nbauma109</groupId>
      <artifactId>cfr</artifactId>
      <version>${version.cfr}</version>
    </dependency>
    <dependency>
      <groupId>com.github.nbauma109.procyon</groupId>
      <artifactId>procyon-decompiler</artifactId>
      <version>${version.procyon}</version>
      <exclusions>
        <exclusion>
          <groupId>com.github.nbauma109.procyon</groupId>
          <artifactId>procyon-compilertools</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.github.nbauma109.procyon</groupId>
          <artifactId>procyon-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.nbauma109.procyon</groupId>
      <artifactId>procyon-reflection</artifactId>
      <version>${version.procyon}</version>
      <exclusions>
        <exclusion>
          <groupId>com.github.nbauma109.procyon</groupId>
          <artifactId>procyon-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.github.skylot</groupId>
      <artifactId>jadx-core</artifactId>
      <version>${version.jadx}</version>
    </dependency>
    <dependency>
      <groupId>io.github.skylot</groupId>
      <artifactId>jadx-java-input</artifactId>
      <version>${version.jadx}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>2.0.18</version>
    </dependency>
    <!-- ASM related dependencies (BSD) -->
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>${version.asm}</version>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-commons</artifactId>
      <version>${version.asm}</version>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-util</artifactId>
      <version>${version.asm}</version>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-tree</artifactId>
      <version>${version.asm}</version>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-analysis</artifactId>
      <version>${version.asm}</version>
    </dependency>
    <!-- test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
    </dependency>
  </dependencies>
</project>
