Useful commands (gw
comes from https://github.com/dougborg/gdub, otherwise ./gradlew
can be used instead):
# Build and start JMeter GUI gw runGui # Build project and copy relevant jars to rootDir/lib, and start JMeter gw createDist; ./bin/jmeter # Build all distributions (source, binary) gw :src:dist:assemble
# Display all submodules gw projects # Different tasks for current module gw tasks
Technically clean
should not be required, every time it is required it might be a bug. However it might be useful to perform a “clean” build:
# Cleans current project (submodule) gw clean # Cleans the specified project gw :src:core:clean
# Displays dependencies. Gradle's "configurations" are something like different classpaths. gw dependencies # Displays dependencies for all projects gw allDependencies # Analyze why the project depends on `org.ow2.asm:asm` gw dependencyInsight --dependency org.ow2.asm:asm # Verify checksums of dependencies # Checksum verification is done by default # Expected checksums are stored in /checksum.properties file # Actual checksums are stored in /build/checksum/computed.checksum.properties
# Run RAT gw rat
# Run spotlessApply and checkstyleAll gw style # Run checkstlye for all gw checkstyleAll
# Run checkstyle for main (non-test) code gw checkstyleMain # Run checkstyle for test code gw checkstyleTest # Run Spotless checks gw spotlessCheck # Fix any issues found by Spotless gw spotlessApply
gw compileJava gw compileTestJava ...
# Just build jar (see build/libs/*.jar) gw jar # "build" is a default task to "execute all the actions" gw build # Test might be skipped by `-x test` (Gradle's default way to skip task by name) gw -x test build # Build project in parallel gw build --parallel
Gradle automatically tracks task dependencies, so if you modify a file in /src/jorphan/*
, then you can invoke gw check
at project level or in core
, and Gradle will automatically build only the required jars and files.
# Runs all the tests (unit tests, checkstyle, etc) gw check # Runs just unit tests gw test # Runs just core tests gw :src:core:test
# Generates code coverage report for the test task to build/reports/jacoco/test/html gw jacocoTestReport # Generate combined coverage report gw jacocoReport
# Builds javadoc to build/docs/javadoc subfolder gw javadoc # Builds javadoc jar to build/libs/jorphan-javadoc.jar gw javadocJar
# Creates preview of a site to build/docs/site gw :src:dist:previewSite # Builds and publishes site preview to a Git repository gw :src:dist:pushPreviewSite
# publishes Maven artifact to local repository gw publishToMavenLocal # Generate all pom files # The resulting files are placed under build/publications folder gw generatePom
# Builds ZIP and TGZ artifacts for the release gw :src:dist:assemble
It is implemented via gradle signing plugin, so it is done automatically provided credentials are specified via signatory credentials
# Signs all the artifacts of the current module # see results in build/**/*.asc gw sign
Note: signing is performed as a part of release artifact build so it will be performed with
gw :src:dist:assemble
# Builds the project, pushes artifacts to svn://.../dev, # stages artifacts to Nexus staging repository gw prepareVote -Prc=1
Note: The above step uses an asf-like release environment, so it does not alter public repositories
# Prepare another release candidate gw prepareVote -Prc=2 -Pasf # Release staged artifacts to SVN and Nexus gw publishDist -Prc=2 -Pasf