Building
This project is split into three parts:
Command Line Tool
The command line tool is created via Gradle’s application plugin. The main
class is uk.co.cacoethes.lazybones.LazyBonesMain
, which currently implements
all the sub-commands (create, list, etc.) as command classes.
The main class plus everything else under src/main is packaged into a skeletal-app-<version>.jar
that is included in the distribution zip. The Gradle application plugin generates
a skeletal
shell script and a skeletal.bat
script that then runs the main
class with all required dependencies on the classpath.
To build the distribution, from the skeletal project top level directory simply run:
./gradlew distZip
You will find the application packaged in build/distributions/skeletal-<version>.zip
Unpack the zip file contents to anywhere you keep such applications and add the
bin
subdirectory to your system path to get the skeletal
command.
The $HOME/.skeletal
profile directory will be created after the first create
or config
command is ran.
You can build an “installed” build for manual testing locally before production.
./gradlew installDist
You can run it using the path to the application script
skeletal-app/build/install/skeletal/bin/skeletal <command>
Automated Tests
We use Spock for tests (specifications). There are approximatly 300 unit or integration tests currently ran during a build of the distribution.
To run the tests alone
./gradlew check
Gradle reports are found in build/reports/tests
. We have recently added Athaydes Spock Reports but we haven’t done much with the configuration of those yet. Those reports are found in build/spock-reports
Skeletal Gradle Plugin
The Gradle plugin that was a subproject in Lazybones has been moved into its own Skeletal Gradle Plugin project.
Lazybones Project Templates
Template Versions
You define the version of a template by putting a VERSION file in the root
directory of the template that contains just the version number. For example,
you specify a version of 1.2.8 for the my-template template by adding the file
templates/my-template/VERSION
with the contents
1.2.8
Template Description
Skeletal requires a DESCRIPTION
file that contains a description for the
template.
A project for managing Lazybones project templates.
For core templates in this project, run from the Skeletal project root
directory and include the lazybones-templates
sub-project:
./gradlew :lazybones-templates:publishTemplate<TemplateName>
You can also publish all the templates in one fell swoop:
./gradlew :lazybones-templates:publishAllTemplates
That’s it! The VERSION
and DESCRIPTION
files will automatically be excluded from the project
template archive.
More complete information about template publishing can be found in the project documention pages and the Skeletal Gradle Plugin project.
Creating a Release
Releases are created in the GitHub repo by creating a tag and a Release based on that tag and a Changelog of major changes and uploading build artifacts and source archives.
This is automated by JReleaser using the jreleaser.yml
configuration file and the JReleaser CLI.
Pre-Release Checklist
- App version is correct in
skeletal-app/app.gradle
anddocs/*.adoc
files. - build distribution with
./gradlew distZip
- verify all tests passed.
Steps to Create a Release
export JRELEASER_PROJECT_VERSION=version to release
export JRELEASER_OUTPUT_DIRECTORY=skeletal-app/build
jreleaser config
jreleaser full-release --dry-run
- check
skeletal-app/build/jreleaser/release/CHANGELOG.md
for errors jreleaser full-release