Skip to content

Latest commit

 

History

History
283 lines (211 loc) · 8.12 KB

developers-guide.adoc

File metadata and controls

283 lines (211 loc) · 8.12 KB

Refer also to the Wiki for developer documentation: https://vassalengine.org/wiki/Main_Page#Engine_Development

Developer’s guide

Build system

Maven

Build lifecycle

  1. clean: deletes everything in /target

  2. validate

    • checkstyle

  3. generate-resources

    • asciidoctor

  4. compile: compiles code and copies resources to /target/classes

  5. test: runs unit tests

    • spotbugs

    • clirr

      • Travis runs up to here

  6. package: creates build artifacts (.jar files) in /target

    • javadoc

    • source: creates source code jar

    • license: downloads licenses

  7. verify

    • pmd

  8. install: copies build artifacts into local maven repository

  9. site: not used

  10. deploy: copies build artifacts and maven meta files to /snapshots or /releases

Maven plugins

Checkstyle
Note

Runs goal checkstyle:check in validate phase

PMD
Note

Runs goal pmd:check in verify phase

Source
Note

Runs goal source:jar-no-fork in package phase

Javadoc
Note

Runs goal javadoc:jar in package phase

Spotbugs
Note

Runs goal spotbugs:check in test phase

Clirr
Note

Runs goal clirr:check-no-fork in test phase

Asciidoc
Note

Runs goal asciidoctor:process-asciidoc in generate-resources phase

Asciidoc documentation:

The asciidoctor plugin runs once for each of the following:

  1. convert Reference Manual files to HTML

  2. convert Userguide to PDF

  3. convert Designer’s Guide to PDF

License Maven Plugin
Note

Runs goal license:aggregate-download-licenses in package phase

Build parameters

Version number

The internal version number (the one shown in the about screen) is set by the maven parameter gitVersion and defaults to the maven version number. It is passed from the Makefile during the release process.

Skip parameters

Each build step can be skipped by passing certain parameters.

Table 1. Skipping build steps
Plugin Skip parameter

Main (Skip code compilation)

-Dmaven.main.skip=true

Surefire (Unit tests)

-DskipTests=true

Checkstyle

-Dcheckstyle.skip=true

Spotbugs

-Dspotbugs.skip=true

Javadoc

-Dmaven.javadoc.skip=true

Asciidoctor

-Dasciidoctor.skip=true

Clirr

-Dclirr.skip=true

License Maven Plugin

-Dlicense.skipAggregateDownloadLicenses=true

Examples
  • Compile only, build jar in vassal-app/target, skip tests, checkstyle, spotbugs, javadoc, asciidoctor, clirr:

mvn clean package -DskipTests=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Dmaven.javadoc.skip=true -Dasciidoctor.skip=true -Dclirr.skip=true
  • Run AsciiDoctor only:

mvn clean compile -Dmaven.main.skip=true -DskipTests=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Dmaven.javadoc.skip=true -Dclirr.skip=true

Regular TODOs

Check for new dependency versions
mvn versions:display-dependency-updates
Check for maven plugin updates
mvn versions:display-plugin-updates

Configuration of dependent projects

The project’s public maven repository can be found at https://vassalengine.org/maven/

Example configuration for dependent projects:
<project>
  <dependencies>
    <dependency>
      <groupId>org.vassalengine</groupId>
      <artifactId>vassal-app</artifactId>
      <version>3.4.1</version> <!--(1)-->
      </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>vassal-releases</id>
      <url>https://vassalengine.org/maven/</url>
    </repository>
  </repositories>
</project>
  1. Use desired Vassal version here

make

List of available make targets:
link:../Makefile[role=include]

Release checklist

Running Vassal

Player

Main class: VASSAL.launch.Player
VM arguments: /path/to/module/VassalModule.vmod

Editor

Main class: VASSAL.launch.Editor
VM arguments: --edit /path/to/module/VassalModule.vmod

Additional parameters

  • To simulate a HiDPI monitor: -Dsun.java2d.uiScale=2