Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

310 lines (241 sloc) 9.258 kb
<project name="BezierSQLib" default="install" basedir="./">
<description>
BezierSQLib (formerly SQLibrary) build file, based on Processing libraries build file.
</description>
<target name="settings">
<!-- == Change these two for building == -->
<!-- Change to point to Processings library folder (core.jar, etc) -->
<property name="libraryClasspath"
location="/Applications/Processing.app/Contents/Resources/Java/"/>
<property name="processing.classes"
location="/Users/fjenett/Repos/processing/build/macosx/work/Processing.app/Contents/Resources/Java/" />
<!-- Change to point to your user libraries folder inside your sketchbook -->
<property name="processing" location="/Users/fjenett/Documents/Processing/libraries"/>
<!-- No changes or adjustments required below -->
<property name="author" value="Florian Jenett"/>
<property name="copyright" value="(c) 2005 - 2012"/>
<property name="libraryName" value="BezierSQLib"/>
<property name="versionNumber" value="0.2.1"/>
<property name="yourLink" value="http://bezier.de/" />
<property name="keywords" value="MySQL, SQLite, PostgreSQL, SQL, database"/>
<property name="javaVersion" value="1.5"/>
<buildnumber file="resources/build.number" />
<path id="library-classes-add">
<fileset dir="lib">
<include name="mysql-connector-java-3.1.14-bin.jar"/> <!-- MySQL -->
<include name="sqlite-jdbc-3.7.2.jar"/> <!-- SQLite -->
<include name="postgresql-9.2-1002.jdbc3.jar"/> <!-- PostgreSQL -->
</fileset>
</path>
<path id="library-classpath">
<fileset dir="${processing.classes}" >
<include name="core/library/core.jar"/>
</fileset>
<path refid="library-classes-add" />
</path>
<property name="jarFile" value="${libraryName}.jar"/>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="javadoc" location="documentation"/>
<property name="dist" value="${libraryName}"/>
<property name="build" location="build"/>
<property name="web" location="../sql-website" />
</target>
<target name="init" depends="settings">
<echo>
Properties initialized.
src path ${src}
bin path ${bin}
Processing classes ${processing.classes}
processing Libraries ${processing}
java version ${javaVersion}
</echo>
<buildnumber file="lib/build.number"/>
<tstamp>
<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour"/>
</tstamp>
<echo>Start to build the library ... this is vers. ${versionNumber}, build #${build.number} on ${date}</echo>
<!-- add ant-contrib package, needed for <foreach> -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<mkdir dir="${dist}"/>
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
COMPILE, BUILD
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="compile" depends="init" description="compile the source" >
<delete dir="${bin}" />
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" source="${javaVersion}">
<classpath>
<path refid="library-classpath"/>
</classpath>
</javac>
</target>
<target name="documentation" depends="compile">
<mkdir dir="${javadoc}" />
<javadoc bottom="Processing library ${libraryName} (formerly SQLibrary) by ${author}. ${copyright}"
destdir="${javadoc}"
verbose="false"
stylesheetfile="resources/stylesheet.css"
doctitle="Javadocs: ${libraryName}"
public="true" version="false"
windowtitle="Javadocs: ${libraryName} (formerly SQLibrary)">
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*"/>
</fileset>
<classpath>
<path refid="library-classpath"/>
</classpath>
</javadoc>
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
PACKAGE
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="package" depends="documentation" description="generate the distribution" >
<delete dir="${dist}" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}/library" />
<mkdir dir="${dist}/examples" />
<mkdir dir="${dist}/documentation" />
<mkdir dir="${dist}/source" />
<jar jarfile="${dist}/library/${jarFile}" basedir="${bin}"/>
<copy todir="${dist}/examples">
<fileset dir="examples"/>
</copy>
<copy todir="${dist}/source">
<fileset dir="${src}" />
</copy>
<copy todir="${dist}/library">
<path refid="library-classes-add" />
</copy>
<copy todir="${dist}/documentation">
<fileset dir="${javadoc}" />
</copy>
<copy todir="${dist}">
<fileset file="resources/library.properties" />
<fileset file="readme.md" />
</copy>
<replaceregexp file="${dist}/library.properties" flags="g"
match="@@LIBRARY_NAME@@" replace="${libraryName}" />
<replaceregexp file="${dist}/library.properties" flags="g"
match="@@VERSION@@" replace="${build.number}" />
<replaceregexp file="${dist}/library.properties" flags="g"
match="@@PRETTY_VERSION@@" replace="${versionNumber}" />
<!-- zip the distribution of the library -->
<zip destfile="releases/${libraryName}-${versionNumber}.zip">
<zipfileset dir="">
<include name="${dist}/**/**" />
</zipfileset>
</zip>
<!-- library contribution system -->
<mkdir dir="release" />
<copy tofile="release/${libraryName}.zip">
<fileset file="releases/${libraryName}-${versionNumber}.zip" />
</copy>
<copy tofile="release/${libraryName}.txt">
<fileset file="${dist}/library.properties" />
</copy>
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
INSTALL
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="install" depends="package">
<mkdir dir="${processing}/${libraryName}" />
<copy todir="${processing}/${libraryName}">
<fileset dir="${dist}"/>
</copy>
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
RELEASE
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="release" depends="install">
<mkdir dir="${web}" />
<move todir="${web}/documentation">
<fileset dir="${dist}/documentation" />
</move>
<move todir="${web}/examples">
<fileset dir="${dist}/examples" />
</move>
<copy todir="${web}">
<fileset dir="resources/web" />
</copy>
<!--
format the index.html file.
regular expressions are used to parse the web index.html file.
key words starting and ending with ## are replaced by values
defined earlier in the beginning of this build file.
-->
<replaceregexp file="${web}/index.html"
match="##yourLibrary##"
replace="${libraryName}"
flags="g" />
<replaceregexp file="${web}/index.html"
match="##author##"
replace="${author}"
flags="g" />
<replaceregexp file="${web}/index.html"
match="##versionNumber##"
replace="${versionNumber}"
flags="g" />
<replaceregexp file="${web}/index.html"
match="##yourLink##"
replace="${yourLink}"
flags="g" />
<replaceregexp file="${web}/index.html"
match="##date##"
replace="${date}"
flags="g" />
<replaceregexp file="${web}/index.html"
match="##keywords##"
replace="${keywords}"
flags="g" />
<antcall target="processExamples" />
<mkdir dir="${web}/download" />
<copy file="releases/${libraryName}-${versionNumber}.zip" todir="${web}/download" />
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
CLEAN
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="clean" >
<delete dir="${dist}" />
<delete dir="${javadoc}" />
<delete dir="${build}" />
<delete dir="${web}" />
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
EXAMPLES, all
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="processExamples">
<dirset id="examples.contents" dir="examples" excludes="*/*"/>
<property name="examples.list" refid="examples.contents"/>
<foreach list="${examples.list}" target="addExamples" param="exampleDir" delimiter=";">
</foreach>
<!--echo>${examples.list}</echo-->
<!--foreach param="exampleDir" target="addExamples">
<path>
<dirset id="examples.contents" dir="examples" excludes="*/*"/>
</path>
</foreach-->
<replaceregexp file="${web}/index.html"
match="(##examples##)"
replace=""
flags="g" />
</target>
<!-- + + + + + + + + + + + + + + + + + + + + + + +
EXAMPLES, one
+ + + + + + + + + + + + + + + + + + + + + + + -->
<target name="addExamples" depends="settings">
<property name="exampleZipped" value="${exampleDir}.zip"/>
<zip destfile="${web}/examples/${exampleZipped}"
basedir="${web}/examples/${exampleDir}/"
excludes="**/_DS.Store" />
<replaceregexp file="${web}/index.html"
match="(##examples##)"
replace="&lt;li&gt;&lt;a href=&quot;examples/${exampleZipped}&quot;&gt;${exampleDir}&lt;/a&gt;&lt;/li&gt; \1"
flags="g" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.