Skip to content
Snippets Groups Projects
Commit 0f3cfd0e authored by Christian Mahnke's avatar Christian Mahnke
Browse files

Update README.md

parent 4701ef75
Branches master
No related tags found
No related merge requests found
Salvador - SUB Ant Library for Web Development
==============================================
#Introduction
# Introduction
This is a Library of [Apache Ant](http://ant.apache.org/) Tasks that might be useful for Web developers. The main purpose is the management of external tool dependencies, so you don't need to manage them by yourself. It is also able to use a embedded web server, precompile PHP files to static HTML and provides some Ruby tools like SASS and Compass.
#Modules
# Modules
Lockated in the 'modules' sub directory.
* scm.xml - Tasks for [Git](http://git-scm.com/) and [Subversion](http://subversion.tigris.org/).
* jetty.xml - Tasks for [Jetty](http://jetty.codehaus.org/jetty/)
......@@ -19,13 +19,13 @@ Lockated in the 'modules' sub directory.
* groovy.xml - integration of [Groovy](http://groovy.codehaus.org/)
* basex.xml - integration of [BaseX](http://basex.org/)
##Unfinished modules
## Unfinished modules
* envjs.xml - [EnvJS](https://github.com/envjs/env-js) integration (not finished).
* jekyll.xml - [Jekyll](https://github.com/mojombo/jekyll) integration (doesn't work since stupid Jekyll relies on native crap)
* webjar.xml - [Webjar](http://www.webjars.org/) integration (not finished).
#Usage
##Basics
# Usage
## Basics
To use the libraries import the desired module in your Ant project:
><import file="./build/modules/jetty.xml"/>
......@@ -34,102 +34,102 @@ Add the requested task as a dependency of your task:
> <target name="war.run" depends="salvador.jetty.install"/>
Then either use the dependency declarations of your Ant tasks to get the functionality of the required tools and libraries (for dependency related tasks) or use the supplied macros for specific functionality.
##Naming of tasks
## Naming of tasks
* Tasks containing "download" in their name, get the libraries and set up the classpath accordingly, you can use them to create your own macros.
* Tasks containing "install" in their name rely on the download and set up macro definitions.
##build.xml
## build.xml
This is the base package of Salvador, it provides Maven tasks and Ant enhancements.
###Additional Tasks
### Additional Tasks
* The target **salvador.base.ant.httptask.install** provides the [Missing Link Ant HTTP Tasks](http://code.google.com/p/missing-link/)
* The target **salvador.base.ant.contrib.install** provides the [Ant Contrib Tasks](http://ant-contrib.sourceforge.net/)
* The target **salvador.base.maven.install** provides the [Maven Ant Tasks](http://maven.apache.org/ant-tasks/)
##scm.xml
## scm.xml
This file provides [Git](http://git-scm.com/) and [Subversion](http://subversion.tigris.org/) integration.
###Additional Tasks
### Additional Tasks
* User the target **salvador.scm.jgit.install** to get the [JGIT Ant Tasks](http://wiki.eclipse.org/JGit/User_Guide#Ant_Tasks)
###Macros
### Macros
* **salvador.scm.svn.co**, part of the target **salvador.scm.svn.install**, takes the attributes '*url*' and '*todir*' to check out the latest revision of a subersion retository.
##jetty.xml
## jetty.xml
This file provides [Jetty](http://jetty.codehaus.org/jetty/) integration.
###Additional Tasks
### Additional Tasks
* The target **salvador.jetty.install** provides the [Jetty 9 Ant Tasks](http://www.eclipse.org/jetty/documentation/current/jetty-ant.html)
###Macros
### Macros
* The target **salvador.jetty.install** also provides the macro **salvador.jetty.run**: It takes the attributes '*path*', '*webxml*' (might be empty), '*port*' (default: 8080) and '*contextpath*' (default: /ant). This is a wrapper around the <jetty> task, it will scan for changes ever 5 seconds.
##javascript.xml
## javascript.xml
This file provides several JavaScript tools.
###Additional Tasks
### Additional Tasks
* The target **salvador.js.jsdoctoolkit.install** provides the [JSDoc Ant Tasks](https://github.com/ironsidevsquincy/jsdoc-toolkit-ant-task)
###Macros
### Macros
The target **salvador.js.yui.install** provides the following [YUI](http://yuilibrary.com/) tasks:
* **salvador.js.yui.compress.js**: Takes a '*src*' and '*destfile*' attribute and compress a JS file.
* **salvador.js.yui.compress.css**: Takes a '*src*' and '*destfile*' attribute and compress a CSS file.
##jruby.xml
## jruby.xml
This file provides [JRuby](http://jruby.org/). I's mainly used by SASS and Compass, but can also be used to get access to other Ruby Gems. It operate on an internal JRuby distribution, not the one provided by your system.
###Macros
### Macros
The target **salvador.jruby.gems** provides two macros:
* **salvador.jruby.gem.check** checks if the ruby Gem given by the attribute '*gem*' is installed. Check the property **salvador.jruby.gem.check.return.code** for the value '*0*' (zero).
* **salvador.jruby.gem.install** installs the ruby Gem given by the attribute '*gem*'
##compass.xml
## compass.xml
This file provides [Compass](http://compass-style.org/) related tasks.
###Macros
### Macros
* The target **salvador.sass.install** provides the macro **salvador.sass.compile.watch**. It takes two attributes '*src*' and '*dest*'. It watches the '*src*' directory and writes changes to the '*dest*' directory using the poll method.
##sass.xml
## sass.xml
This file provides [SASS](http://sass-lang.com/) related tasks.
###Macros
### Macros
The target **salvador.sass.macros** provides the following macros:
* **salvador.sass.convert.watch**: It takes two attributes '*src*' and '*dest*'. It watches the '*src*' directory and writes changes to the '*dest*' directory using the poll method.
* **salvador.sass.convert**: It takes two attributes '*src*' and '*destfile*'. It converts the '*src*' file and writes the result to '*destfile*'.
* **salvador.sass.convert.dir**: It takes two attributes '*refid*' and '*todir*'. It converts the fileSet given by the reference '*refid*' file and writes the result to '*todir*' using **salvador.sass.convert**.
##php.xml
## php.xml
This file provides an [PHP](http://php.net/) [compiler](http://quercus.caucho.com/).
###Macros
### Macros
* The target **salvador.tinypng.macros** provides the macros:
* **salvador.php.compile**: Takes a '*src*' and '*destfile*' attribute, compiles PHP files to static HTML (or whatever the PHP file emits)
* **salvador.php.compile.dir**: It takes three attributes '*refid*', '*todir*' and suffix (default ".html"). It converts the fileSet given by the reference '*refid*' file and writes the result to '*todir*' using **salvador.php.compile**, use another '*suffix*' if the results shouldn't end with html.
##exist.xml
## exist.xml
This file provides integration of [eXist](http://www.exist-db.org/exist/apps/homepage/index.html).
**Warning**: this takes some time on the first usage, since it needs to fetch a complete eXist distribution.
###Additional Tasks
### Additional Tasks
* The target **salvador.exist.install** provides the [eXist Ant Tasks](http://www.exist-db.org/exist/apps/doc/ant-tasks.xml)
##tinypng.xml
## tinypng.xml
This file provides integration of the [TinyPNG](http://tinypng.org/) web service.
**Note**: You need a API key to use this
###Macros
### Macros
* The target **salvador.tinypng.macros** provides the macros:
* **salvador.tinypng.compress**: It takes a '*src*' and '*destfile*' attribute, sends the provided image to TinyPNG and saves the result. Make sure you set the property **salvador.tinypng.apikey**, containing your API key.
* **salvador.tinypng.compress.dir**: It takes two attributes '*refid*' and '*todir*'. It converts the fileSet given by the reference '*refid*' file and writes the result to '*todir*' using **salvador.tinypng.compress**.
##jtidy.xml
## jtidy.xml
This file provides integration of [JTidy](http://jtidy.sourceforge.net/).
###Additional Tasks
### Additional Tasks
* The target **salvador.jtidy.install** provides the [JTidy Ant Tasks](http://jtidy.sourceforge.net/apidocs/org/w3c/tidy/ant/JTidyTask.html).
##groovy.xml
## groovy.xml
This file provides integration of of [Groovy](http://groovy.codehaus.org/).
###Additional Tasks
### Additional Tasks
* The target **salvador.groovy.install** provides the [Groovy Ant Tasks](http://groovy.codehaus.org/The+groovy+Ant+Task)
##basex.xml
## basex.xml
This file provides integration of [BaseX](http://basex.org/).
###Macros
### Macros
* The macro **salvador.basex.download** downloads BaseX and sets a classpath for integration.
#Examples
# Examples
This section provides some examples.
## Running a web application with Jetty and Compass
Make sure you import the required modules:
......@@ -137,7 +137,7 @@ Make sure you import the required modules:
><import file="./build/modules/compass.xml"/>
#Development
# Development
In the test directory is a test.xml which can by run by
>ant -f test/test.xml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment