Skip to content

Commit

Permalink
Added ANT buildfile, updated README and optimized images.
Browse files Browse the repository at this point in the history
Added new Apache Ant build.xml file for those without access to *nix make. README has been updated to reflect this.
Also optimized images using Yahoo's SmushIt service, resulting in a 93%(!) lossless filesize reduction.
Makefile has also been optimized slightly and .gitattributes file removed as it was causing problems with commits.
  • Loading branch information
Craga89 committed Jul 21, 2010
1 parent 7074fe6 commit ecffc3a
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RHINO = java -jar ${BUILD_DIR}/js.jar
COMPILER = java -jar ${BUILD_DIR}/compiler.jar --warning_level=QUIET
PACKER = java -jar ${BUILD_DIR}/js.jar ${BUILD_DIR}/packer.js

DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`
DATE=`git log --pretty=format:'%ad' -1`

all: clean qtip css images min pack lint
@@echo "qTip build complete."
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@

What you need to build qTip
---------------------------------------
* Make sure that you have PHP installed (if you want to build a minified version of qTip).
* Make sure that you have Java installed (if you want to use the JSLint checker).
If not, [go to this page](http://java.sun.com/javase/downloads/index.jsp) and download "Java Runtime Environment (JRE) 5.0"
* *nix make or [Apache Ant](http://ant.apache.org/bindownload.cgi)
* [Java Runtime Environment](http://java.sun.com/javase/downloads/index.jsp) (If you wish to build minified sources or use JSLint check)


How to build qTip
-----------------
How to build qTip (using MAKE)
------------------------

In the main directory of the distribution (the one that this file is in), type
the following to make qTip and its accompanying CSS and images:
the following to build qTip and its accompanying CSS and images:

make

You can also create each individually using these commands:

make qtip # Build non-minified qTip source
make min # Build minified qTip source
make css # Build CSS files
make min # Build minified qTip source
make pack # Build minified and packed qTip source (Smallest filesize!)
make css # Build CSS files
make images # Build images

To build and test the source code against JSLint type this:
Expand All @@ -32,7 +32,18 @@ Finally, you can remove all the built files using the command:
make clean


Building to a different directory
How to build qTip (Using ANT)
------------------------

For those of you without access to *nix make, an ANT build file is also included in the repository. Build instructions are identical to
those above, but replace _make_ with _ant_ e.g.

ant [command]

[command] is optional and can be any of the above i.e. qtip, min, pack etc.


Building to a different directory (MAKE only)
----------------------------------

If you want to build qTip to a directory that is different from the default location, you can...
Expand Down
152 changes: 152 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<project name="qTip" default="all" basedir=".">

<loadfile property="version" srcfile="version.txt" />
<exec outputproperty="date" executable="git" >
<arg line="log --pretty=format:'%ad' -1" />
</exec>

<property name="BUILD_DIR" value="./build" description="Build folder" />
<property name="SRC_DIR" value="./src" description="Source folder" />
<property name="DIST_DIR" value="./dist" description="Compiled qTip folder" />
<property name="IMG_DIR" value="./images" description="Images folder" />

<property name="QTIP" value="${DIST_DIR}/jquery.qtip.js" />
<property name="QTIP_MIN" value="${DIST_DIR}/jquery.qtip.min.js" />
<property name="QTIP_PACK" value="${DIST_DIR}/jquery.qtip.pack.js" />
<property name="QTIP_CSS" value="${DIST_DIR}/jquery.qtip.css" />
<property name="QTIP_IMG" value="${DIST_DIR}/images" />

<target name="all" depends="clean,qtip,css,images,min,pack,lint" description="Builds qTip including minified, packed JS files, as well as images and CSS" />

<target name="dir" description="Builds distribution directory">
<mkdir dir="${DIST_DIR}" />
</target>

<target name="qtip" depends="dir" description="Main qTip build. Concatenates source and css files and replaces @VERSION/Date">
<echo message="Building ${QTIP}" />

<concat destfile="${QTIP}">
<fileset file="${SRC_DIR}/header.txt" />
<fileset file="${SRC_DIR}/intro.js" />
<fileset file="${SRC_DIR}/core.js" />
<fileset file="${SRC_DIR}/ajax.js" />
<fileset file="${SRC_DIR}/tips.js" />
<fileset file="${SRC_DIR}/imagemap.js" />
<fileset file="${SRC_DIR}/modal.js" />
<fileset file="${SRC_DIR}/ie6.js" />
<fileset file="${SRC_DIR}/outro.js" />
</concat>

<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${QTIP}" />
<replaceregexp match="Date: " replace="Date: ${date}" file="${QTIP}" />

<echo message="${QTIP} built." />
</target>

<target name="min" depends="qtip" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${QTIP_MIN}" />

<apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}">
<fileset dir="${DIST_DIR}">
<include name="jquery.qtip.js" />
</fileset>

<arg line="-jar" />
<arg path="${BUILD_DIR}/compiler.jar" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="jquery.qtip.js" to="tmpmin" />
</apply>

<concat destfile="${QTIP_MIN}">
<filelist files="${QTIP}, dist/tmpmin" />
<filterchain>
<headfilter lines="18" />
</filterchain>
</concat>

<concat destfile="${QTIP_MIN}" append="yes">
<filelist files="dist/tmpmin" />
</concat>
<delete file="dist/tmpmin"/>

<echo message="${QTIP_MIN} built." />
</target>

<target name="pack" depends="min" description="Compresses minified qTip source for even smaller file-sizes">
<echo message="Building ${QTIP_PACK}" />

<apply executable="java" parallel="false" verbose="true">
<fileset dir="${DIST_DIR}">
<include name="jquery.qtip.js" />
</fileset>

<arg line="-jar" />
<arg path="${BUILD_DIR}/js.jar" />
<arg value="${BUILD_DIR}/packer.js" />
<arg value="${QTIP_MIN}" />
<arg value="${QTIP_PACK}.tmp" />
</apply>

<concat destfile="${QTIP_PACK}">
<filelist files="${QTIP}, ${QTIP_PACK}.tmp" />
<filterchain>
<headfilter lines="18" />
</filterchain>
</concat>

<concat destfile="${QTIP_PACK}" append="yes">
<filelist files="${QTIP_PACK}.tmp" />
</concat>
<delete file="${QTIP_PACK}.tmp"/>

<echo message="${QTIP_PACK} built." />
</target>

<target name="css" depends="dir" description="Builds qTip CSS file">
<echo message="Building ${QTIP_CSS}" />

<concat destfile="${QTIP_CSS}">
<fileset file="${SRC_DIR}/header.txt" />
<fileset file="${SRC_DIR}/core.css" />
<fileset file="${SRC_DIR}/tips.css" />
<fileset file="${SRC_DIR}/modal.css" />
<fileset file="${SRC_DIR}/extra.css" />
</concat>

<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${QTIP}" />
<replaceregexp match="Date: " replace="Date: ${date}" file="${QTIP_CSS}" />

<echo message="${QTIP_CSS} built." />
</target>

<target name="images" depends="dir" description="Builds images directory">
<echo message="Building ${QTIP_IMG}" />

<mkdir dir="${QTIP_IMG}" />
<copy todir="${QTIP_IMG}">
<fileset dir="${IMG_DIR}">
<include name="**/*.png"/>
</fileset>
</copy>

<echo message="${QTIP_IMG} built." />
</target>

<target name="lint" description="Builds and checks the qTip source with JSLint">
<echo message="Checking qTip against JSLint..." />

<exec executable="java">
<arg line="-jar" />
<arg path="${BUILD_DIR}/js.jar" />
<arg value="${BUILD_DIR}/jslint-check.js" />
</exec>
</target>

<target name="clean">
<delete dir="${DIST_DIR}" />
</target>
</project>
Binary file modified images/close-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/close-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/close-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/close-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/close-red.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ecffc3a

Please sign in to comment.