Skip to content

Commit

Permalink
Eliminate jcommander in favour of quarrel.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed May 16, 2024
1 parent db392de commit 1f318d1
Show file tree
Hide file tree
Showing 16 changed files with 425 additions and 487 deletions.
154 changes: 114 additions & 40 deletions com.io7m.jspiel.cmdline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,81 +36,155 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.jaffirm</groupId>
<artifactId>com.io7m.jaffirm.core</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.junreachable</groupId>
<artifactId>com.io7m.junreachable.core</artifactId>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<groupId>com.io7m.quarrel</groupId>
<artifactId>com.io7m.quarrel.core</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<groupId>com.io7m.quarrel</groupId>
<artifactId>com.io7m.quarrel.ext.logback</artifactId>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.bundle</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<!-- Move the CycloneDX plugin execution before assembly construction. -->
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<executions>
<execution>
<id>default</id>
<goals>
<goal>makeAggregateBom</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<!-- Ignore dependencies that bytecode analysis gets wrong. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<failOnWarning>true</failOnWarning>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>
com.io7m.jspiel:*
</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>
ch.qos.logback:logback-classic:*
</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>

<!-- Produce command-line onejar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<groupId>com.io7m.stmp</groupId>
<artifactId>string-template-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<id>generate-version</id>
<phase>generate-sources</phase>
<goals>
<goal>shade</goal>
<goal>renderTemplate</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<shadedClassifierName>main</shadedClassifierName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.io7m.jspiel.cmdline.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
<template>
<name>RiffMainVersion</name>
<inputFile>
${project.basedir}/src/main/string-template/RiffMainVersion.st
</inputFile>
<outputFile>
${project.build.directory}/generated-sources/string-template/com/io7m/jspiel/cmdline/RiffMainVersion.java
</outputFile>
<properties>
<appVersion>${project.version}</appVersion>
<appBuild>${buildNumber}</appBuild>
</properties>
</template>
</configuration>
</execution>
</executions>
</plugin>

<!-- Make the generated runnable jar reproducible -->
<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-jooq-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/string-template</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Ignore dependencies that bytecode analysis gets wrong. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<failOnWarning>true</failOnWarning>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>com.io7m.jspiel:com.io7m.jspiel.vanilla:*</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>com.io7m.jaffirm:com.io7m.jaffirm.core:*</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>distribution</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<attach>true</attach>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
<executions>
<execution>
<id>reproducible-zip</id>
<phase>package</phase>
<goals>
<goal>strip-jar</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<includes>
<include>.*\.zip</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
38 changes: 38 additions & 0 deletions com.io7m.jspiel.cmdline/src/main/assembly/distribution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>

<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">

<id>distribution</id>

<baseDirectory>jspiel</baseDirectory>

<formats>
<format>dir</format>
<format>zip</format>
</formats>

<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
</dependencySet>
</dependencySets>

<files>
<file>
<source>src/main/sh/jspiel</source>
<outputDirectory>/bin</outputDirectory>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/bom.xml</source>
<outputDirectory/>
<fileMode>0644</fileMode>
</file>
</files>

</assembly>

This file was deleted.

This file was deleted.

0 comments on commit 1f318d1

Please sign in to comment.