Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 162cf02f91
Fetching contributors…

Cannot retrieve contributors at this time

215 lines (172 sloc) 8.198 kB
<project name="processingLibs" default="build">
<description>
PeasyCam build
</description>
<property name="processing" location="../processing-1.5.1" />
<property name="processingLibraries" location="C:/Documents and Settings/Administrator/My Documents/Processing/libraries" />
<property name="libraryClasspath" location="${processing}/lib" />
<path id="library-classpath">
<fileset dir="${libraryClasspath}">
<include name="core.jar" />
</fileset>
</path>
<property name="javaVersion" value="1.5" />
<property file="library.properties" prefix="library" />
<property name="author" value="Jonathan Feinberg" />
<property name="copyright" value="(c) 2011" />
<property name="libraryName" value="peasycam" />
<property name="yourLink" value="http://mrfeinberg.com" />
<property name="keywords" value="3D,camera,rotation" />
<property name="tested:platform" value="Windows" />
<property name="tested:processingVersion" value="1.5.1" />
<property name="tested:dependencies" value="" />
<property name="source:host" value="GitHub" />
<property name="source:url" value="http://github.com/jdf/peasycam/" />
<property name="source:repository" value="http://github.com/jdf/peasycam/" />
<!-- no changes or adjustments required below -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="./resources/code/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<property name="jarFile" value="peasycam.jar" />
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="reference" location="reference" />
<property name="dist" location="distribution" />
<target name="init">
<echo>Properties initialized.
src path ${src}
bin path ${bin}
libraryClasspath ${libraryClasspath}
processing Libraries ${processingLibraries}
java version ${javaVersion}
</echo>
<echo>building library ...</echo>
<!-- Create the time stamp -->
<tstamp>
<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour" />
</tstamp>
<mkdir dir="${dist}" />
</target>
<target name="pushweb" depends="build">
<exec executable="sh" dir="distribution/web">
<arg value="-c"/>
<arg value="chmod -R +rwX *"/>
</exec>
<exec executable="sh" dir="distribution/web">
<arg value="-c"/>
<arg value="rsync -azv --exclude .svn --delete -e ssh * jdf@mrfeinberg.com:/var/www/html/mrfeinberg.com/peasy"/>
</exec>
<exec executable="sh" dir="distribution/web">
<arg value="-c"/>
<arg value="ssh jdf@mrfeinberg.com chmod -R a+rX /var/www/html/mrfeinberg.com/peasy"/>
</exec>
</target>
<!-- compile the library -->
<target name="compile" depends="init" description="compile the source">
<echo message="Bump version number in applet"/>
<replaceregexp
match='VERSION = "[^"]+"'
replace='VERSION = "${library.version}"'
file="${src}/peasy/PeasyCam.java"/>
<echo message="bin: ${bin}"/>
<echo message="javaVersion: ${javaVersion}"/>
<echo message="library-classpath$ ${library-classpath}"/>
<mkdir dir="${bin}"/>
<javac target="${javaVersion}" destdir="${bin}" source="${javaVersion}">
<classpath>
<path refid="library-classpath" />
</classpath>
<src path="${src}" />
</javac>
</target>
<!-- build the distribution of the library -->
<target name="build" depends="compile" description="generate the distribution">
<!-- delete the previous content of the ${dist} folder -->
<delete dir="${dist}" />
<!-- build the structure for ${dist} -->
<mkdir dir="${dist}" />
<property name="realDist" value="${dist}/peasycam"/>
<mkdir dir="${realDist}" />
<mkdir dir="${realDist}/library" />
<mkdir dir="${realDist}/examples" />
<mkdir dir="${realDist}/reference" />
<mkdir dir="${realDist}/src" />
<jar jarfile="${realDist}/library/${jarFile}" basedir="${bin}" />
<copy todir="${realDist}" file="library.properties"/>
<copy todir="${realDist}/examples">
<fileset dir="examples" />
</copy>
<copy todir="${realDist}/src">
<fileset dir="src" />
</copy>
<copy todir="web" file="${realDist}/library/${jarFile}"/>
<copy todir="../Patchy/web" file="${realDist}/library/${jarFile}"/>
<!-- create the java reference of the library -->
<mkdir dir="${reference}" />
<javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}" classpath="${libraryClasspath}/core.jar" destdir="${reference}" verbose="false" stylesheetfile="resources/stylesheet.css" doctitle="Javadocs: ${libraryName}" public="true" version="false" windowtitle="Javadocs: ${libraryName}">
<taglet name="ExampleTaglet" path="resources/code" />
<fileset dir="${src}" excludes="**/*.gz">
<include name="**/*" />
</fileset>
</javadoc>
<copy todir="${realDist}/reference">
<fileset dir="${reference}" />
</copy>
<!-- copy the jar file to processing's libraries -->
<copy todir="${processingLibraries}">
<fileset dir="${dist}" />
</copy>
<!-- zip the distribution of the library -->
<zip destfile="${dist}/${libraryName}.zip" basedir="${dist}" excludes="**/_DS.Store,**/applet/**" />
<copy file="${dist}/${libraryName}.zip" tofile="${dist}/${libraryName}_${library.version}.zip" />
<!-- organize the ${dist} folder -->
<mkdir dir="${dist}/web" />
<move todir="${dist}/web/reference">
<fileset dir="${realDist}/reference" />
</move>
<move todir="${dist}/web/examples">
<fileset dir="${realDist}/examples" />
</move>
<delete dir="${dist}/library" />
<copy todir="${dist}/web">
<fileset dir="web" />
</copy>
<copy tofile="${dist}/web/peasycam.txt" file="library.properties"/>
<replaceregexp file="${dist}/web/index.html" match="##yourLibrary##" replace="${libraryName}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##author##" replace="${author}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##versionNumber##" replace="${library.version}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##yourLink##" replace="${yourLink}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##date##" replace="${date}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##keywords##" replace="${keywords}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##tested:platform##" replace="${tested:platform}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##tested:processingVersion##" replace="${tested:processingVersion}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##tested:dependencies##" replace="${tested:dependencies}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##source:host##" replace="${source:host}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##source:url##" replace="${source:url}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##source:repository##" replace="${source:repository}" flags="g" />
<echo>---------------------</echo>
<antcall target="processExamples" />
<echo>---------------------</echo>
<replaceregexp file="${dist}/web/index.html" match="##examples##" replace="" flags="g" />
<!-- finish organizating library's distribution -->
<copy file="${dist}/${libraryName}.zip" todir="${dist}/web" />
<copy file="${dist}/${libraryName}_${library.version}.zip" todir="${dist}/web" />
<copy todir="${processingLibraries}/peasycam/reference">
<fileset dir="${reference}" />
</copy>
<!-- done, finished. -->
<echo>done, finished.</echo>
</target>
<!-- parsing the examples folder -->
<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>
</target>
<target name="addExamples">
<replaceregexp file="${dist}/web/index.html" match="(##examples##)" replace="&lt;li&gt;&lt;a href=&quot;examples/${exampleDir}/applet/index.html&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.