Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mattbertolini/jxr-ant

An Ant task for the JXR report. Based on the JXR Maven plugin.
https://github.com/mattbertolini/jxr-ant

ant ant-task java jxr jxr-ant

Last synced: about 1 month ago
JSON representation

An Ant task for the JXR report. Based on the JXR Maven plugin.

Awesome Lists containing this project

README

        

# JXR Ant Task

Version 2.1.0

Written by Matt Bertolini

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.mattbertolini/jxr-ant/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mattbertolini/jxr-ant)

## License

The JXR Ant Task is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

## Usage

Download the library from [Maven Central](http://search.maven.org/#search|ga|1|g%3A%22com.mattbertolini%22%20a%3A%22jxr-ant%22) and make sure it is available to ant in some way (e.g. On Ant's classpath or in a ``).

Maven:
```xml

com.mattbertolini
jxr-ant
2.1.0

```

Ivy:
```xml

```

In your ant file, load the task.

```xml

```

## Parameters


Attribute
Description
Availability
Required


bottom
The text or HTML to place at the footer of the generated files.
all
No.

destdir
The destination directory where the generated files are saved.
all
Yes


doctitle
The document title to give the generated files.
all
No. Defaults to ${project.name} Xref Documentation


inputencoding
The character set to use when reading the input/source files.
all
No. Defaults to JVM file.encoding system property.


javadocdir
The directory where the equivalient javadoc files are located. Adding this attribute will link the javadoc with
the xref files.
all
No


outputencoding
The character set to use when writing the generated files.
all
No. Defaults to JVM file.encoding system property.


sourcepath
The directory where the source files are located.
all
Yes unless a nested <sourcepath> is given.


stylesheet
The file path to the custom stylesheet to use when generating the documentation.
all
No


templatedir
The directory where the custom templates are located.
all
No


windowtitle
The window title to give the generated HTML files.
all
No. Defaults to ${project.name} Xref Documentation.

## Parameters defined as nested elements

### bottom

Same as the bottom attribute. Nested element allows for easier defining of large blocks of text or HTML.

### doctitle

Same as the doctitle attribute.

### Sourcepath

A Path. This element allows for multiple source paths to be combined and generated into the final generated
documentation. All path elements must be directories. No individual files can be listed in the path. If defined, the
sourcepath attribute is not needed.

### windowtitle

The same as the window title attribute.

## Examples

Here is a basic uasage example:

```xml

```

Here is an example using the `` nested element instead of the attribute:

```xml



```

Here is an example with an HTML footer defined in the `` nested element:

```xml

Footer text here]]>

```

Here is an example with some classes excluded using a `` element:

```xml



```

### Gradle

Since Ant tasks are [first-class citizens](http://www.gradle.org/docs/current/userguide/ant.html) in Gradle, adding
JXR-Ant to a gradle build is very easy. To start add the JXR-Ant dependency to the dependencies section. It is
recommended you create a special configuration for the library:

```groovy
configurations {
jxr
}
dependencies {
jxr group: 'com.mattbertolini', name: 'jxr-ant', version: '2.1.0'
}
```

Next, define the ant task an invoke it:

```groovy
task runJxr() {
ant.taskdef(resource: 'com/mattbertolini/jxr/ant/antlib.xml', classpath: configurations.jxr.asPath)
ant.jxr(destDir: "$docsDir/jxr", sourcePath: files(sourceSets.main.java.srcDirs).asPath)
}
```

Here is a more complex example:

```groovy
task runJxr(dependsOn: 'javadoc') {
ant.taskdef(resource: 'com/mattbertolini/jxr/ant/antlib.xml', classpath: configurations.jxr.asPath)
ant.jxr(destDir: "$docsDir/jxr", sourcePath: files(sourceSets.main.java.srcDirs).asPath, javadocDir: "$docsDir/javadoc") {
bottom('

Footer text here

')
patternset(excludes: '**/example/subpackage/**')
}
}
```

## Build and Test
### Requirements
* [Apache Ant](http://ant.apache.org/) - Version 1.8 or higher.
* JDK 6 or higher (Compiled with 1.6 source and target).

### Build
To build this project, clone the repo and run the ```ant``` command:
```
$ git clone https://github.com/mattbertolini/JXR-Ant.git
$ cd JXR-Ant
$ ant
```

The distributable jar files will be located in the ```dist``` folder. The build reports (unit test, dependency,
coverage, etc.) will be located in the ```build/reports``` dir.

To run the unit tests run the ```run-unit-tests``` task.
```
$ ant run-unit-tests
```

## Bugs

If you find any bugs, please file them in the issue tracker above. Patches and pull requests are encouraged.

## Release Notes

**3.0.0.dev - In development. Not yet released.**

* Minimum Java version now at 1.7.
* Updated build dependencies (JUnit, JaCoCo, Findbugs, etc).

**2.1.0 - 2014-11-16**

* Updating JXR dependency to 2.5. Backward compatible.

**2.0.0 - 2013-12-20**

* Updating JXR dependency to version 2.4.

**1.0.0 - 2012-06-24**

* Initial release.
* Uses JXR version 2.3