valid8j
is built and tested using Java 8, which is the most compatible as of April in 2024.
Prerequisites
-
JDK (Java SE 8. No older, no newer. OpenJDK is recommended.)
-
mvn
(3.6.x is recommended) -
dot
(Necessary for building the documentation. You can install it as a part ofgraphviz
) -
ruby
(3.0.x is recommended) -
bash
(5.1.x is recommended. I don’t think macOS’s default one works.)
Setting Up a Development Environment
-
git clone https://github.com/dakusui/valid8j.git
-
then
cd valid8j
.
Also, import the directory to your IDE as a project.
Build Process
Build by maven
- Building a binary
-
mvn clean compile
This compiles your production code. The compiled classes will be found under thetarget/classes
directory. - Running the test suite
-
mvn clean compile test
This compiles your production and test code. The compiled classes and test report will be found undertarget
directory. - Creating a package
-
mvn clean compile test package
This compiles your production code and executes the unit test suite. Reports will be generated under thetarget
directory. - Creating a site on your local
-
mvn clean compile test site
This will generate the product site’s undertarget/site
directory. This is time-consuming because it generates project reports such as JavaDoc, coverage report, etc. - Generating JavaDoc
-
mvn clean compile test javadoc:javadoc
This is less time-consuming than the "Creating a site on your local" or theCreating a package
procedures. The generated documentation is found undertarget/apidocs
directory. - Deploying the site publicly
-
mvn clean compile test site-deploy
To execute this, you need to have a GitHub account with a permission to do so.
Contribution Guidelines
Coding conventions are defined as IDEA’s configuration and found under .idea
directory of the source tree.
Note that asciidoc
and asciidoclet
are used for documentation rather than markdown.
When you open a pull request, don’t forget:
-
Running a test (
mvn test
) -
If the tests pass, try
mvn site
or run "all tests" from your IntelliJ to make sure your changes are exercised by the tests. If not, please write tests. -
The main branch is
main
References
-
[1] Wikipedia article on Design by Contract, Design by contract
-
[2] valid4j valid4j.org
-
[3] pcond dakusui.github.io/pcond
-
[4] Valid4j, valid4j.org
-
[5] PreconditionsExplained, PreconditionsExplained
-
[6] Hamcrest hamcrest.org
-
[7] Programming With Assertions Programming With Assertions
-
[8] Preconditions, Google Guava Preconditions class
-
[9] Validates, Apache Commons Validate class