Skip to content

Commit

Permalink
Merge pull request #116 from Bernardo-MG/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Bernardo-MG authored Nov 15, 2022
2 parents a09502e + 9455164 commit 1790b83
Show file tree
Hide file tree
Showing 114 changed files with 1,863 additions and 1,767 deletions.
121 changes: 26 additions & 95 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.bernardomg.maven</groupId>
<artifactId>base-pom</artifactId>
<version>1.4.4</version>
<version>1.5.3</version>
</parent>

<!-- ********************************************** -->
Expand All @@ -20,7 +20,7 @@

<groupId>com.bernardomg.tabletop</groupId>
<artifactId>dice</artifactId>
<version>2.2.1</version>
<version>2.2.2</version>
<packaging>jar</packaging>

<name>Dice Notation Tools for Java</name>
Expand Down Expand Up @@ -63,63 +63,9 @@
<!-- ********************************************** -->

<profiles>
<profile>
<!-- Profile for the Eclipse Maven plugin -->
<!-- Sets the POM so this plugin does not give the usual unregistered goals errors -->
<!-- It will be activated automatically on Eclipse if this has the m2e plugin, by detecting the version property -->
<id>eclipse-maven</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- m2e lifecycle mapping -->
<!-- This is used to configure the Maven plugin for Eclipse. -->
<!-- Among other things, it allows registering goals, which Eclipse would otherwise reject. -->
<!-- It has no real effect on Maven. -->
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>${plugin.lifecycle.version}</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<!-- Build helper plugin configuration -->
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>add-source</goal>
<goal>add-test-source</goal>
<goal>add-resource</goal>
<goal>add-test-resource</goal>
<goal>maven-version</goal>
<goal>parse-version</goal>
<goal>timestamp-property</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnConfiguration>true</runOnConfiguration>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<!-- ============================================== -->
<!-- ============ DEPLOYMENT PROFILES ============= -->
<!-- ============================================== -->
<profile>
<!-- Site deployment profile -->
<!-- Sets the site repository to point to the releases repo -->
Expand Down Expand Up @@ -225,32 +171,41 @@

<properties>
<!-- ============================================== -->
<!-- ================ JAVA VERSION ================ -->
<!-- =============== MAVEN VERSION ================ -->
<!-- ============================================== -->
<java.version>11</java.version>
<maven.version>3.8</maven.version>
<!-- ============================================== -->
<!-- =============== MANIFEST DATA ================ -->
<!-- ============================================== -->
<manifest.name>com/bernardomg/tabletop/dice</manifest.name>
<!-- ============================================== -->
<!-- =========== DEPENDENCIES VERSIONS ============ -->
<!-- ============================================== -->
<antlr.version>4.9.3</antlr.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<lombok.version>1.18.22</lombok.version>
<mockito.version>4.2.0</mockito.version>
<log4j.version>2.17.1</log4j.version>
<slf4j.version>1.7.30</slf4j.version>
<antlr.version>4.11.1</antlr.version>
<junit.jupiter.version>5.9.1</junit.jupiter.version>
<lombok.version>1.18.24</lombok.version>
<mockito.version>4.9.0</mockito.version>
<log4j.version>2.19.0</log4j.version>
<slf4j.version>2.0.3</slf4j.version>
<!-- ============================================== -->
<!-- ============== PLUGINS VERSIONS ============== -->
<!-- ============================================== -->
<plugin.antlr.version>${antlr.version}</plugin.antlr.version>
<plugin.antlr.test.version>1.19</plugin.antlr.test.version>
<plugin.buildhelp.version>3.2.0</plugin.buildhelp.version>
<plugin.antlr.test.version>1.22</plugin.antlr.test.version>
<plugin.buildhelp.version>3.3.0</plugin.buildhelp.version>
<!-- ============================================== -->
<!-- ============ PLUGIN CONFIGURATION ============ -->
<!-- ============================================== -->
<!-- Checkstyle customized rules file -->
<checkstyle.config.location>${project.basedir}/src/config/checkstyle/checkstyle-rules.xml</checkstyle.config.location>
<!-- Excludes generated code for Checkstyle -->
<checkstyle.excludes>**/generated/**/*</checkstyle.excludes>
<!-- Exclusion patterns for SpotBugs -->
<spotbugs.excludeFilterFile>${project.basedir}/src/config/spotbugs/spotbugs-exclude.xml</spotbugs.excludeFilterFile>
<!-- ============================================== -->
<!-- ================= MAVEN SITE ================= -->
<!-- ============================================== -->
<site.skin.version>2.2.5</site.skin.version>
<site.skin.version>2.2.7</site.skin.version>
<mavenURL>http://mvnrepository.com/artifact/com.bernardomg.tabletop/dice</mavenURL>
<githubArtifactURL><![CDATA[https://github.com/Bernardo-MG?tab=packages&amp;repo_name=dice-notation-java]]></githubArtifactURL>
</properties>
Expand Down Expand Up @@ -437,7 +392,6 @@
<showTree>true</showTree>
<entryPoint>notation</entryPoint>
<grammarName>DiceNotation</grammarName>
<lexerName>DiceNotationLexer</lexerName>
<packageName>com.bernardomg.tabletop.dice.generated</packageName>
<exampleFiles>src/test/resources/examples</exampleFiles>
</configuration>
Expand Down Expand Up @@ -480,19 +434,6 @@

<reporting>
<plugins>
<plugin>
<!-- Checkstyle -->
<!-- Checks that the source files comply with style standards -->
<!-- It is using a customized rules file -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<!-- The customized rules file -->
<configLocation>${project.basedir}/src/config/checkstyle/checkstyle-rules.xml</configLocation>
<!-- Excludes generated code -->
<excludes>**/generated/**/*</excludes>
</configuration>
</plugin>
<plugin>
<!-- Javadoc -->
<!-- Generates the javadocs -->
Expand Down Expand Up @@ -522,17 +463,7 @@
</excludes>
</configuration>
</plugin>
<plugin>
<!-- SpotBugs -->
<!-- Checks for patterns which are prone to errors -->
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<!-- Exclusion patterns -->
<excludeFilterFile>${project.basedir}/src/config/spotbugs/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</reporting>

</project>
</project>
5 changes: 4 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@
Updated dependencies.
</action>
</release>
<release version="2.3.0" date="2022-01-02" description="">
<release version="2.2.2" date="2022-11-15" description="Updated dependencies">
<action dev="bmg" type="update">
Updated dependencies.
</action>
</release>
</body>
</document>
4 changes: 2 additions & 2 deletions src/config/checkstyle/checkstyle-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<property name="eachLine" value="true" />
</module>

<!-- Checks line lenght -->
<!-- Checks line length -->
<module name="LineLength">
<property name="max" value="100" />
<property name="max" value="120" />
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
</module>

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/bernardomg/tabletop/dice/DefaultDice.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
/**
* Immutable group of dice.
* <p>
* Some basic constraints are applied to the dice values. The quantity should be
* equal or higher than zero, and the number of sides equal or higher than one.
* If any other value is received then an exception will be thrown.
*
* Some basic constraints are applied to the dice values. The quantity should be equal or higher than zero, and the
* number of sides equal or higher than one. If any other value is received then an exception will be thrown.
*
* @author Bernardo Mart&iacute;nez Garrido
*/
@Data
Expand Down
20 changes: 9 additions & 11 deletions src/main/java/com/bernardomg/tabletop/dice/Dice.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
/**
* A group of dice, all with the same number of sides.
* <p>
* This is meant to represent a group of dice by itself, to handle complex
* notation the classes in the {@link com.bernardomg.tabletop.dice.notation
* notation} package should be used.
* This is meant to represent a group of dice by itself, to handle complex notation the classes in the
* {@link com.bernardomg.tabletop.dice.notation notation} package should be used.
* <p>
* The number of dice are expected to be positive or zero, and the number of
* sides greater than zero, as any other value would make no sense.
* The number of dice are expected to be positive or zero, and the number of sides greater than zero, as any other value
* would make no sense.
* <p>
* No other limitation is expected. In the real world the number of sides which
* a die may physically have are limited by the rules of geometry, but there is
* no reason to take care of that.
*
* No other limitation is expected. In the real world the number of sides which a die may physically have are limited by
* the rules of geometry, but there is no reason to take care of that.
*
* @author Bernardo Mart&iacute;nez Garrido
*/
public interface Dice {
Expand All @@ -38,7 +36,7 @@ public interface Dice {
* Returns the number of dice which compose this group.
* <p>
* This is expected to be a positive value or zero.
*
*
* @return the number of dice being rolled
*/
public Integer getQuantity();
Expand All @@ -49,7 +47,7 @@ public interface Dice {
* All the dice will have this same number of sides.
* <p>
* This is expected to be a positive value greater than zero.
*
*
* @return the dice's number of sides
*/
public Integer getSides();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
/**
* Immutable roll history.
* <p>
* To allow returning a clean text output of the full history it receives a text
* history in the constructor. This will be returned by the {@code toString}
* method.
*
* To allow returning a clean text output of the full history it receives a text history in the constructor. This will
* be returned by the {@code toString} method.
*
* @author Bernardo Mart&iacute;nez Garrido
*
*/
Expand Down Expand Up @@ -58,24 +57,21 @@ public final class DefaultRollHistory implements RollHistory {
* Constructs a roll history with the specified data.
* <p>
* The text history will be used for the {@code toString} method.
*
*
* @param results
* each roll result
* @param text
* history text
* @param total
* sum of all the values
*/
public DefaultRollHistory(@NonNull final Iterable<RollResult> results,
@NonNull final String text, @NonNull final Integer total) {
public DefaultRollHistory(@NonNull final Iterable<RollResult> results, @NonNull final String text,
@NonNull final Integer total) {
super();

rollResults = Objects.requireNonNull(results,
"Received a null pointer as roll results");
historyText = Objects.requireNonNull(text,
"Received a null pointer as history text");
totalRoll = Objects.requireNonNull(total,
"Received a null pointer as total roll");
rollResults = Objects.requireNonNull(results, "Received a null pointer as roll results");
historyText = Objects.requireNonNull(text, "Received a null pointer as history text");
totalRoll = Objects.requireNonNull(total, "Received a null pointer as total roll");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* Immutable roll result. Contains all the values generated and the sum of them.
*
*
* @author Bernardo Mart&iacute;nez Garrido
*
*/
Expand All @@ -54,38 +54,34 @@ public final class DefaultRollResult implements RollResult {

/**
* Constructs a roll result with the specified data.
*
*
* @param d
* dice which generated the result
* @param rolls
* generated values
* @param total
* sum of all the values
*/
public DefaultRollResult(@NonNull final Dice d,
@NonNull final Iterable<Integer> rolls,
public DefaultRollResult(@NonNull final Dice d, @NonNull final Iterable<Integer> rolls,
@NonNull final Integer total) {
super();

dice = Objects.requireNonNull(d, "Received a null pointer as dice");
allRolls = Objects.requireNonNull(rolls,
"Received a null pointer as rolls");
totalRoll = Objects.requireNonNull(total,
"Received a null pointer as total roll");
allRolls = Objects.requireNonNull(rolls, "Received a null pointer as rolls");
totalRoll = Objects.requireNonNull(total, "Received a null pointer as total roll");
}

/**
* Constructs a roll result with a single value.
*
*
* @param total
* sum of all the values
*/
public DefaultRollResult(@NonNull final Integer total) {
super();

dice = new DefaultDice(1, total);
totalRoll = Objects.requireNonNull(total,
"Received a null pointer as total roll");
totalRoll = Objects.requireNonNull(total, "Received a null pointer as total roll");

allRolls = Arrays.asList(total);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@
* <p>
* A {@link RollResult} will be present for each dice set rolled.
* <p>
* Note that constants may be represented as dice set with a single side, and as
* many dice as the value.
*
* Note that constants may be represented as dice set with a single side, and as many dice as the value.
*
* @author Bernardo Mart&iacute;nez Garrido
*
*/
public interface RollHistory {

/**
* The results from rolling each dice set.
*
*
* @return the results from rolling each dice set
*/
public Iterable<RollResult> getRollResults();

/**
* The sum of all the rolled values.
*
*
* @return the sum of all the rolled values
*/
public Integer getTotalRoll();
Expand Down
Loading

0 comments on commit 1790b83

Please sign in to comment.