<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jruby</groupId>
  <artifactId>jruby-prism</artifactId>
  <packaging>jar</packaging>
  <version>2.0.2</version>
  <name>jruby-prism</name>
  <url>https://github.com/jruby/jruby-prism</url>
  <description>
    Java portion of JRuby Prism parser support.
  </description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit.version>5.12.1</junit.version>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <prism.parser.version>0.0.3</prism.parser.version>
  </properties>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/jruby/jruby-prism/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:https://github.com/jruby/jruby-prism.git</connection>
    <developerConnection>scm:git:git@github.com:jruby/jruby-prism.git</developerConnection>
    <url>https://github.com/jruby/jruby-prism</url>
  </scm>

  <licenses>
    <license>
      <name>EPL-2.0</name>
      <url>http://www.eclipse.org/legal/epl-v20.html</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>lopex</id>
      <name>Thomas Enebo</name>
      <email>tom.enebo@gmail.com</email>
    </developer>
  </developers>

  <repositories>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>sonatype</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-base</artifactId>
      <version>10.0.5.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.ruby-lang</groupId>
      <artifactId>prism-parser-api</artifactId>
      <version>${prism.parser.version}</version>
    </dependency>
    <dependency>
      <groupId>org.ruby-lang</groupId>
      <artifactId>prism-parser-wasm</artifactId>
      <version>${prism.parser.version}</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <finalName>jruby-prism</finalName>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav</artifactId>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.0</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <configuration>
              <compilerArgs>
                <arg>-Xlint:unchecked</arg>
              </compilerArgs>
              <excludes>
                <exclude>module-info.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <archive>
            <manifestFile>MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.7.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>jacoco</id>
      <build>
        <plugins>
          <plugin>
             <groupId>org.jacoco</groupId>
             <artifactId>jacoco-maven-plugin</artifactId>
             <version>0.8.0</version>
             <configuration>
                <excludes>
                </excludes>
             </configuration>
             <executions>
                <execution>
                    <id>default-prepare-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                   <id>pre-unit-test</id>
                   <goals>
                      <goal>prepare-agent</goal>
                   </goals>
                   <configuration>
                      <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
                      <propertyName>surefireArgLine</propertyName>
                   </configuration>
                </execution>
                <execution>
                   <id>post-unit-test</id>
                   <phase>test</phase>
                   <goals>
                      <goal>report</goal>
                   </goals>
                   <configuration>
                      <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
                      <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                   </configuration>
                </execution>
                <execution>
                   <id>default-report</id>
                   <phase>prepare-package</phase>
                   <goals>
                      <goal>report</goal>
                   </goals>
                </execution>
             </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <gpgArgument>--pinentry-mode</gpgArgument>
                <gpgArgument>loopback</gpgArgument>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <doclint>none</doclint>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
