Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deletes all build artifacts for a specified module.
Compiles the main source tree and test source tree for a specified module (dealing with all necessary classpath configuration).
Builds a JAR file for a specified module. Includes main classes and omits test class. Sets the Class-Path and Main-Class manifest properties as required.
Builds a source JAR for a specified module, omitting test sources.
Simplified Javadoc invocation (requires fewer lines of XML than using the Ant Javadoc task directly).
Copies all build artifacts and dependencies from each module into the “dist” directory so that that directory contains a complete self-contained build of the entire project.
Builds release archives (ZIP and TGZ) that contain the contents of the “dist” directory plus any API docs and any text files from the project root (e.g. LICENCE.txt, README.txt, CHANGELOG.txt).
Constructs a Maven POM and uploads the module JAR file to a Maven repository with source JAR and test source JAR attached.
Add the uncommons namespace to the root project element:
<project name="myproject" xmlns:uncommons="antlib:org.uncommons.antlib">
Load the macros and taskdefs:
<path id="tool.path"> <fileset dir="lib" includes="**/*.jar" /> </path> <taskdef uri="antlib:org.uncommons.antlib" resource="org/uncommons/antlib/antlib.xml" classpathref="tool.path"/>
Use the macros:
<uncommons:clean module="framework" /> <uncommons:compile module="framework" /> <uncommons:jar module="framework" /> <uncommons:test suites="testng.xml" title="My Unit Test Report" mincoverage="80" />
This example will delete any existing build artifacts from the “framework” module, compile all module sources and test sources (with a classpath that includes any libs in the global lib directory and module lib directory) and build a file called “framework.jar”. It then runs the unit test suites specified by “testng.xml”, generating test and coverage HTML reports. The build will fail if any of the tests fail or if branch or line coverage is below 80%.