Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 168 lines (155 sloc) 7.72 kb
876e7c5 google-feinberg Remove Processing anachronisms.
google-feinberg authored
1 <project default="build" name="processingLibs">
2 <description>Patchy build</description>
3
4 <property location="../processing" name="processing"/>
5
6 <path id="library-classpath">
7 <fileset dir="${processing}/core/library">
8 <include name="core.jar"/>
9 </fileset>
10 </path>
11
12 <property file="library.properties" prefix="library"/>
13
14 <property name="javaVersion" value="1.6"/>
15
16 <property name="author" value="Jonathan Feinberg"/>
17 <property name="copyright" value="(c) 2013"/>
18 <property name="libraryName" value="patchy"/>
19 <property name="yourLink" value="http://mrfeinberg.com/"/>
20 <property name="keywords" value="bicubic,patch,Bezier,Hermite,Catmull-Rom,BSpline,parametric surface"/>
21 <property name="tested:platform" value="Windows"/>
22 <property name="tested:processingVersion" value="2.0"/>
23 <property name="tested:dependencies" value=""/>
24 <property name="source:host" value="GitHub"/>
25 <property name="source:url" value="http://github.com/jdf/patchy/"/>
26 <property name="source:repository" value="http://github.com/jdf/patchy/"/>
27
28 <!-- no changes or adjustments required below -->
29
30 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
31 <classpath>
32 <pathelement location="./resources/code/ant-contrib-1.0b3.jar"/>
33 </classpath>
34 </taskdef>
35
36 <property name="jarFile" value="patchy.jar"/>
37 <property location="src" name="src"/>
38 <property location="bin" name="bin"/>
39 <property location="reference" name="reference"/>
40 <property location="distribution" name="dist"/>
41
42 <target name="init">
43 <echo>Properties initialized.
44 src path ${src}
45 bin path ${bin}
46 libraryClasspath ${libraryClasspath}
47 java version ${javaVersion}</echo>
48 <echo>building library ...</echo>
49 <tstamp>
50 <format offset="0" pattern="MM/dd/yyyy" property="date" unit="hour"/>
51 </tstamp>
52 <mkdir dir="${dist}"/>
53 </target>
54
55 <target name="pushweb" depends="build">
56 <exec dir="distribution/web" executable="sh">
57 <arg value="-c"/>
58 <arg value="chmod -R +rwX *"/>
59 </exec>
60 <exec dir="distribution/web" executable="sh">
61 <arg value="-c"/>
62 <arg value="rsync -azv --exclude .svn --delete -e ssh * jdf@mrfeinberg.com:/var/www/html/mrfeinberg.com/patchy"/>
63 </exec>
64 <exec dir="distribution/web" executable="sh">
65 <arg value="-c"/>
66 <arg value="ssh jdf@mrfeinberg.com chmod -R a+rX /var/www/html/mrfeinberg.com/patchy"/>
67 </exec>
68 </target>
69
70 <!-- compile the library -->
71 <target name="compile" depends="init" description="compile the source">
72 <echo message="bin: ${bin}"/>
73 <echo message="javaVersion: ${javaVersion}"/>
74 <echo message="library-classpath$ ${library-classpath}"/>
75 <mkdir dir="${bin}"/>
76 <javac destdir="${bin}" source="${javaVersion}" target="${javaVersion}">
77 <classpath>
78 <path refid="library-classpath"/>
79 </classpath>
80 <src path="${src}"/>
81 </javac>
82 <copy toDir="${bin}">
83 <fileset dir="src" excludes="**/*.java" />
84 </copy>
85 </target>
86
87 <!-- build the distribution of the library -->
88 <target depends="compile" description="generate the distribution" name="build">
89 <!-- delete the previous content of the ${dist} folder -->
90 <delete dir="${dist}"/>
91 <!-- build the structure for ${dist} -->
92 <mkdir dir="${dist}"/>
93 <property name="realDist" value="${dist}/patchy"/>
94 <mkdir dir="${realDist}"/>
95 <mkdir dir="${realDist}/library"/>
96 <mkdir dir="${realDist}/examples"/>
97 <mkdir dir="${realDist}/reference"/>
98 <mkdir dir="${realDist}/src"/>
99 <jar basedir="${bin}" jarfile="${realDist}/library/${jarFile}"/>
100 <copy file="library.properties" todir="${realDist}"/>
101 <copy todir="${realDist}/examples">
102 <fileset dir="examples"/>
103 </copy>
104 <copy todir="${realDist}/src">
105 <fileset dir="src"/>
106 </copy>
107 <copy file="${realDist}/library/${jarFile}" todir="web"/>
108 <!-- create the java reference of the library -->
109 <mkdir dir="${reference}"/>
110 <javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}" classpath="${libraryClasspath}/core.jar" destdir="${reference}" doctitle="Javadocs: ${libraryName}" public="true" stylesheetfile="resources/stylesheet.css" verbose="false" version="false" windowtitle="Javadocs: ${libraryName}">
111 <taglet name="ExampleTaglet" path="resources/code"/>
112 <fileset defaultexcludes="yes" dir="${src}">
113 <include name="**/*"/>
114 <exclude name="**/*.bpt.gz"/>
115 </fileset>
116 </javadoc>
117 <copy todir="${realDist}/reference">
118 <fileset dir="${reference}"/>
119 </copy>
120 <!-- zip the distribution of the library -->
121 <zip basedir="${dist}" destfile="${dist}/${libraryName}.zip" excludes="**/_DS.Store,**/applet/**"/>
122 <copy file="${dist}/${libraryName}.zip" tofile="${dist}/${libraryName}_${library.version}.zip"/>
123 <!-- organize the ${dist} folder -->
124 <mkdir dir="${dist}/web"/>
125 <move todir="${dist}/web/reference">
126 <fileset dir="${realDist}/reference"/>
127 </move>
128 <copy todir="${dist}/web/examples">
129 <fileset dir="${realDist}/examples"/>
130 </copy>
131 <delete dir="${dist}/library"/>
132 <copy todir="${dist}/web">
133 <fileset dir="web"/>
134 </copy>
135 <copy file="library.properties" tofile="${dist}/web/patchy.txt"/>
136 <replaceregexp file="${dist}/web/index.html" flags="g" match="##yourLibrary##" replace="${libraryName}"/>
137 <replaceregexp file="${dist}/web/index.html" flags="g" match="##author##" replace="${author}"/>
138 <replaceregexp file="${dist}/web/index.html" flags="g" match="##versionNumber##" replace="${library.version}"/>
139 <replaceregexp file="${dist}/web/index.html" flags="g" match="##yourLink##" replace="${yourLink}"/>
140 <replaceregexp file="${dist}/web/index.html" flags="g" match="##date##" replace="${date}"/>
141 <replaceregexp file="${dist}/web/index.html" flags="g" match="##keywords##" replace="${keywords}"/>
142 <replaceregexp file="${dist}/web/index.html" flags="g" match="##tested:platform##" replace="${tested:platform}"/>
143 <replaceregexp file="${dist}/web/index.html" flags="g" match="##tested:processingVersion##" replace="${tested:processingVersion}"/>
144 <replaceregexp file="${dist}/web/index.html" flags="g" match="##tested:dependencies##" replace="${tested:dependencies}"/>
145 <replaceregexp file="${dist}/web/index.html" flags="g" match="##source:host##" replace="${source:host}"/>
146 <replaceregexp file="${dist}/web/index.html" flags="g" match="##source:url##" replace="${source:url}"/>
147 <replaceregexp file="${dist}/web/index.html" flags="g" match="##source:repository##" replace="${source:repository}"/>
148 <echo>---------------------</echo>
149 <antcall target="processExamples"/>
150 <echo>---------------------</echo>
151 <replaceregexp file="${dist}/web/index.html" flags="g" match="##examples##" replace=""/>
152 <!-- finish organizating library's distribution -->
153 <copy file="${dist}/${libraryName}.zip" todir="${dist}/web"/>
154 <copy file="${dist}/${libraryName}_${library.version}.zip" todir="${dist}/web"/>
155 <!-- done, finished. -->
156 <echo>done, finished.</echo>
157 </target>
158 <!-- parsing the examples folder -->
159 <target name="processExamples">
160 <dirset dir="examples" excludes="*/*" id="examples.contents"/>
161 <property name="examples.list" refid="examples.contents"/>
162 <foreach delimiter=";" list="${examples.list}" param="exampleDir" target="addExamples"/>
163 </target>
164 <target name="addExamples">
165 <replaceregexp file="${dist}/web/index.html" flags="g" 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"/>
166 </target>
f93b14f Jonathan Feinberg Initial import.
authored
167 </project>
Something went wrong with that request. Please try again.