Style
Jeka contains a library for all regular things you need to build/test/publish projects.. The library does not depend on the execution engine and has zero dependency.
API Style¶
Jeka tries to stick with a consistent API design style.
- All Jeka public classes/interfaces start with
Jk
. The reason is for easing distinction, in IDE, between classes supposed be used in production or test and the ones used for building. It also helps to explore Jeka API. - As a rule of thumb Jeka favors immutable objects for shallow structures and parent-chaining trees for deeper ones. Both provide a fluent interface when possible.
- All objects are instantiated using static factory methods. Every factory method names start with
of
. - All accessor method names (methods returning a result without requiring IO, only computation) starts with
get
. - To create a subtly different object from another immutable one, Jeka provides :
- Methods starting with
with
when a property is to be replaced by another. - Methods starting with
and
when a collection property is to be replaced by the same one plus an extra element. - Methods starting with
minus
when a collection property is to be replaced by the same one minus a specified element. - To modify a mutable object, Jeka provides :
- Methods starting with
set
to replace a single property value by another. - Methods starting with
add
to add a value to a collection property. Those methods return the object itself for chaining.
Domains Covered by the API¶
The previous example demonstrates how the Java/project API can be used to build and publish Java projects. This API relies on other lower level ones provided by Jeka. In a glance these are the domains covered by the Jeka APIs :
- Files : File trees, filters, zip, path sequence
- System : Launching external process, Logging, Meta-info
- Cryptography : PGP signer
- Dependency management : Dependency management, publishing on repositories
- Java : Compilation, javadoc, resource processor, manifest, packager, classloader, classpath, launching
- Testing : Launching tests and get reports
- Project : Project structure to build
- Tooling : Eclipse integration, intellij integration, Maven interaction, Git
- Support : Set of utility class with static methods to handle low-level concerns