<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://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.jruby</groupId>
    <artifactId>jruby-artifacts</artifactId>
    <version>9.4.2.0</version>
  </parent>
  <artifactId>jruby-dist</artifactId>
  <packaging>pom</packaging>
  <name>JRuby Dist</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack jruby-stdlib</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <stripVersion>true</stripVersion>
              <artifactItems>
                <artifactItem>
                  <groupId>org.jruby</groupId>
                  <artifactId>jruby-stdlib</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>bin.tar.gz and bin.zip</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/bin.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <recompressZippedFiles>true</recompressZippedFiles>
          <tarLongFileMode>gnu</tarLongFileMode>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>net.ju-n.maven.plugins</groupId>
        <artifactId>checksum-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>io.takari.polyglot</groupId>
        <artifactId>polyglot-maven-plugin</artifactId>
        <version>0.4.7</version>
        <executions>
          <execution>
            <id>fix_executable_bits</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <taskId>fix_executable_bits</taskId>
              <nativePom>pom.rb</nativePom>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>io.takari.polyglot</groupId>
            <artifactId>polyglot-ruby</artifactId>
            <version>0.4.7</version>
          </dependency>
        </dependencies>
        <inherited>false</inherited>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-checksums</id>
                <phase>package</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-bin.tar.gz.sha256</file>
                      <classifier>bin</classifier>
                      <type>tar.gz.sha256</type>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-bin.tar.gz.sha512</file>
                      <classifier>bin</classifier>
                      <type>tar.gz.sha512</type>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-bin.zip.sha256</file>
                      <classifier>bin</classifier>
                      <type>zip.sha256</type>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-bin.zip.sha512</file>
                      <classifier>bin</classifier>
                      <type>zip.sha512</type>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-src.zip.sha256</file>
                      <classifier>src</classifier>
                      <type>zip.sha256</type>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-dist-${project.version}-src.zip.sha512</file>
                      <classifier>src</classifier>
                      <type>zip.sha512</type>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>source dist</id>
      <activation>
        <file>
          <exists>../../.git</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-artifacts</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/${project.build.finalName}-src.zip</file>
                      <type>zip</type>
                      <classifier>src</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>io.takari.polyglot</groupId>
            <artifactId>polyglot-maven-plugin</artifactId>
            <version>0.4.7</version>
            <executions>
              <execution>
                <id>pack_sources</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <taskId>pack_sources</taskId>
                  <nativePom>pom.rb</nativePom>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>io.takari.polyglot</groupId>
                <artifactId>polyglot-ruby</artifactId>
                <version>0.4.7</version>
              </dependency>
            </dependencies>
            <inherited>false</inherited>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
