Smack Source Distribution

This document provides detailed information for developers that wish to compile and make changes to the Smack source code.

For additional developer resources, please visit: http://www.igniterealtime.org/projects/smack. The Smack build process is based on Gradle. Visit the Gradle website for more information and downloads.

This documentation is divided into two sections:

1. Setup -- how to setup your environment for Smack development.
2. Build tasks -- tasks that can be performed using the build program.

1. Setup Your Environment

Getting your machine ready for Smack development requires a few steps. Wherever possible, instructions are provided for both Unix/Linux and Windows users.

Configure Java

Java 6 (JDK 1.6 or later) must be installed and setup on your machine. To test the installation, open a shell in a Unix or a MS-DOS prompt in Windows. Check your version of Java with "java -version". If Java isn't installed, download a copy from the Java website.

Configure Gradle

Download Gradle from the Gradle website. Follow the setup instructions for your operating system.

Test the Build Script

Now, invoke the build tool to compile the Smack source code

`gradle build`

If the build tool is invoked correctly and Smack compiles, you've correctly configured your copy of the Smack developer distribution.

Finished!

If you've gotten this far, you've finished setting up the Smack developer distribution. Now, read below to learn about all of the tasks that you can perform with the build tool.

2. Gradle Tasks

The list of build tasks is below.
For a list of the commands and a brief description from the command line, type `gradle tasks`. For more complete help, read the documentation below.
To execute a build task, type `gradle [options] targetname` where "targetname" is one of the targets listed below:

- build
- javadocAll
- clean
- eclipse
- projects

Each task is documented with a syntax guide and description. Optional paramaters for each task are enclosed with braces.

build

Syntax:

`gradle build
`

Description:

Compiles all the Smack source code and run the test suite. The artifacts of the sub-projects can be found at `<subprojectDir>/build/libs`

[return to task list]

javadocAll

Syntax:

`gradle javadocAll
`

Description:

JavaDocs all Smack source code and saves it under `build/javadoc`.

[return to task list]

clean

Syntax:

`gradle clean
`

Description:

Cleans your Smack distribution directory by deleting compiled class files and artifacts.

[return to task list]

eclipse

Syntax:

`gradle eclipse
`

Description:

Generates Eclipse configuration files for every project. After running `gradle build eclipse` you can import Smack in Eclipse by selecting `File` → `Import...` → `Existing Projects into Workspace`
Make sure to check "`Search for nested projects`". It may be also a good idea to create a working set for Smack, and add all Smack projects to that working set.
Note that it's recommended to also call the `build` target when generating the Eclipse files, or else Eclipse may not find all requirements.

[return to task list]

projects

Syntax:

`gradle projects
`

Description:

Show all Smack projects and their description.

[return to task list]