Skip to content

Commit

Permalink
Merge branch '2.7' into pos-args
Browse files Browse the repository at this point in the history
  • Loading branch information
rvesse committed Apr 24, 2019
2 parents 33d29c2 + a204725 commit be33f21
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jdk:
# - openjdk11 # Not currently supported by Jacoco plugin
env:
- MAVEN_OPTS="-Dhttps.protocol=TLSv1.2"
script: mvn install -Prelease -Dgpg.skip=true
script: mvn install -Prelease -Dgpg.skip=true -Djdk.enforced=1.7
after_success: mvn package -Pcoveralls
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- Added `@LengthRange` and `@ExactLength` for strings (#73)
- Added `@AllowedEnumValues` as a simpler way of specifying `@AllowedRawValues` on enum typed fields (#73)
- Added `@StartsWith` and `@EndsWith` for enforcing prefixes/suffixes on strings (#73)
- Build Improvements
- `Automatic-Module-Name` manifest entries and `module-info.java` available so modules can be used on Module Path (#92) - Thanks to [jfallows](https://github.com/jfallows)

## 2.6.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Airline is built with Java 7 so can be used with Java 7 or above.

Airline does make heavy use of reflection and therefore will likely not work on the Module Path without exporting packages that contain your CLI and Command classes as part of your `module-info.java`

I do not currently use JPMS in any of my personal/work projects that use Airline and therefore there has been no testing of this.
Current `2.7.0-SNAPSHOT` builds include contributions from our user community to enable use of Airline on the Module Path including relevant `module-info.java` and `Automatic-Module-Name` manifest entries. If you encounter a problem with this please report it at https://github.com/rvesse/airline/issues

## Maven Artifacts

Expand Down
1 change: 1 addition & 0 deletions airline-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<properties>
<license.header.path>${project.parent.basedir}</license.header.path>
<coveralls.skip>true</coveralls.skip>
<moditect.moduleName>com.github.rvesse.airline</moditect.moduleName>
</properties>

<dependencies>
Expand Down
93 changes: 93 additions & 0 deletions airline-core/src/main/moditect/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module com.github.rvesse.airline
{
requires com.github.rvesse.airline.io;
requires org.apache.commons.lang3;
requires org.apache.commons.collections4;
requires javax.inject;

exports com.github.rvesse.airline;
exports com.github.rvesse.airline.annotations;
exports com.github.rvesse.airline.annotations.help;
exports com.github.rvesse.airline.annotations.restrictions;
exports com.github.rvesse.airline.annotations.restrictions.global;
exports com.github.rvesse.airline.annotations.restrictions.ranges;
exports com.github.rvesse.airline.builder;
exports com.github.rvesse.airline.help;
exports com.github.rvesse.airline.help.cli;
exports com.github.rvesse.airline.help.common;
exports com.github.rvesse.airline.help.sections;
exports com.github.rvesse.airline.help.sections.common;
exports com.github.rvesse.airline.help.sections.factories;
exports com.github.rvesse.airline.help.suggester;
exports com.github.rvesse.airline.model;
exports com.github.rvesse.airline.parser;
exports com.github.rvesse.airline.parser.aliases;
exports com.github.rvesse.airline.parser.command;
exports com.github.rvesse.airline.parser.errors;
exports com.github.rvesse.airline.parser.errors.handlers;
exports com.github.rvesse.airline.parser.options;
exports com.github.rvesse.airline.parser.resources;
exports com.github.rvesse.airline.parser.suggester;
exports com.github.rvesse.airline.restrictions;
exports com.github.rvesse.airline.restrictions.common;
exports com.github.rvesse.airline.restrictions.factories;
exports com.github.rvesse.airline.restrictions.global;
exports com.github.rvesse.airline.restrictions.options;
exports com.github.rvesse.airline.types;
exports com.github.rvesse.airline.types.numerics;
exports com.github.rvesse.airline.types.numerics.abbreviated;
exports com.github.rvesse.airline.types.numerics.bases;
exports com.github.rvesse.airline.utils;
exports com.github.rvesse.airline.utils.comparators;
exports com.github.rvesse.airline.utils.predicates;
exports com.github.rvesse.airline.utils.predicates.parser;
exports com.github.rvesse.airline.utils.predicates.restrictions;

provides com.github.rvesse.airline.help.sections.factories.HelpSectionFactory with
com.github.rvesse.airline.help.sections.factories.CommonSectionsFactory;

provides com.github.rvesse.airline.restrictions.factories.ArgumentsRestrictionFactory with
com.github.rvesse.airline.restrictions.factories.AllowedValuesRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.OccurrencesRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.PathRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.PortRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.RangeRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.SimpleRestrictionsFactory,
com.github.rvesse.airline.restrictions.factories.StringRestrictionFactory;

provides com.github.rvesse.airline.restrictions.factories.GlobalRestrictionFactory with
com.github.rvesse.airline.restrictions.factories.StandardGlobalRestrictionsFactory;

provides com.github.rvesse.airline.restrictions.factories.OptionRestrictionFactory with
com.github.rvesse.airline.restrictions.factories.AllowedValuesRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.OccurrencesRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.PathRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.PortRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.RangeRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.RequiredOnlyIfRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.RequireFromRestrictionFactory,
com.github.rvesse.airline.restrictions.factories.SimpleRestrictionsFactory,
com.github.rvesse.airline.restrictions.factories.StringRestrictionFactory;

uses com.github.rvesse.airline.ChannelFactory;
uses com.github.rvesse.airline.help.sections.factories.HelpSectionFactory;
uses com.github.rvesse.airline.restrictions.factories.ArgumentsRestrictionFactory;
uses com.github.rvesse.airline.restrictions.factories.GlobalRestrictionFactory;
uses com.github.rvesse.airline.restrictions.factories.OptionRestrictionFactory;

}
1 change: 1 addition & 0 deletions airline-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<properties>
<license.header.path>${project.parent.basedir}</license.header.path>
<coveralls.skip>true</coveralls.skip>
<moditect.moduleName>com.github.rvesse.airline.io</moditect.moduleName>
</properties>

<dependencies>
Expand Down
28 changes: 28 additions & 0 deletions airline-io/src/main/moditect/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module com.github.rvesse.airline.io
{
requires org.apache.commons.lang3;

exports com.github.rvesse.airline.io;
exports com.github.rvesse.airline.io.colors;
exports com.github.rvesse.airline.io.colors.sources;
exports com.github.rvesse.airline.io.decorations;
exports com.github.rvesse.airline.io.decorations.sources;
exports com.github.rvesse.airline.io.output;
exports com.github.rvesse.airline.io.printers;
exports com.github.rvesse.airline.io.writers;
}
2 changes: 1 addition & 1 deletion docs/guide/practise/jdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Airline is built with Java 7 so can be used with Java 7 or above.

Airline does make heavy use of reflection and therefore will likely not work on the Module Path without exporting packages that contain your CLI and Command classes as part of your `module-info.java`

I do not currently use JPMS in any of my personal/work projects that use Airline and therefore there has been no testing of this.
Current `2.7.0-SNAPSHOT` builds include contributions from our user community to enable use of Airline on the Module Path including relevant `module-info.java` and `Automatic-Module-Name` manifest entries. If you encounter a problem with this please report it at https://github.com/rvesse/airline/issues
117 changes: 116 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

<properties>
<jdk.target>1.7</jdk.target>
<jdk.enforced>1.7</jdk.enforced>
<license.header.path>${project.basedir}</license.header.path>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>

Expand All @@ -67,6 +68,7 @@
<plugin.gpg>1.6</plugin.gpg>
<plugin.shade>3.1.1</plugin.shade>
<plugin.surefire>2.22.0</plugin.surefire>
<plugin.moditect>1.0.0.Beta2</plugin.moditect>

<!-- Dependency Versions -->
<dependency.javax-inject>1</dependency.javax-inject>
Expand Down Expand Up @@ -162,7 +164,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>${jdk.target}</version>
<version>${jdk.enforced}</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -386,6 +388,9 @@
<module>airline-maven-plugin</module>
<module>docs</module>
</modules>
<properties>
<jdk.enforced>1.8</jdk.enforced>
</properties>
<build>
<plugins>
<!-- Release Plugin -->
Expand Down Expand Up @@ -535,5 +540,115 @@
</plugins>
</build>
</profile>

<profile>
<id>moditect-jdk8-plus</id>
<activation>
<jdk>[1.8,)</jdk>
<file>
<exists>${basedir}/src/main/moditect/module-info.java</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>${plugin.moditect}</version>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<jvmVersion>9</jvmVersion>
<overwriteExistingFiles>true</overwriteExistingFiles>
<module>
<moduleInfoFile>
${basedir}/src/main/moditect/module-info.java
</moduleInfoFile>
</module>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>automatic-module-name</id>
<activation>
<property>
<name>moditect.skip</name>
<value>true</value>
</property>
<file>
<exists>${basedir}/src/main/moditect/module-info.java</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${plugin.jar}</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>${moditect.moduleName}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>generate-module-info</id>
<properties>
<jdk.enforced>9</jdk.enforced>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>${plugin.moditect}</version>
<executions>
<execution>
<goals>
<goal>generate-module-info</goal>
</goals>
<configuration>
<modules>
<module>
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
</artifact>
<moduleInfo>
<name>${moditect.moduleName}</name>
<exports>
*;
</exports>
<requires>
*;
</requires>
<addServiceUses>true</addServiceUses>
</moduleInfo>
</module>
</modules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit be33f21

Please sign in to comment.