|
1 | 1 | <?xml version="1.0"?>
|
2 | 2 | <project name="Processing JavaFX renderer" default="build">
|
3 | 3 |
|
| 4 | + <property name="me" value="processing4-javafx" /> |
| 5 | + |
4 | 6 | <target name="core-check">
|
5 | 7 | <property file="local.properties" />
|
6 | 8 |
|
@@ -190,4 +192,54 @@ ${line.separator}with the path to where you have the code for Processing 4 check
|
190 | 192 | <target name="build" depends="compile" description="Build JavaFX renderer">
|
191 | 193 | <jar basedir="bin" destfile="library/javafx.jar" />
|
192 | 194 | </target>
|
| 195 | + |
| 196 | + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
| 197 | + |
| 198 | + <target name="dist" depends="revision-check, build"> |
| 199 | + <mkdir dir="dist" /> |
| 200 | + <zip destfile="dist/${me}.zip"> |
| 201 | + <!-- This can probably be done more efficiently, no? How about a PR? --> |
| 202 | + <zipfileset dir="." prefix="${me}" includes="library/**" /> |
| 203 | + <zipfileset dir="." prefix="${me}" includes="library.properties" /> |
| 204 | + </zip> |
| 205 | + <copy file="library.properties" tofile="dist/${me}.txt" /> |
| 206 | + </target> |
| 207 | + |
| 208 | + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
| 209 | + |
| 210 | + <target name="revision-check"> |
| 211 | + <!-- figure out the revision number --> |
| 212 | + <loadfile srcfile="todo.txt" property="revision"> |
| 213 | + <filterchain> |
| 214 | + <headfilter lines="1"/> |
| 215 | + <tokenfilter> |
| 216 | + <stringtokenizer suppressdelims="true" /> |
| 217 | + <!-- remove the preceding zeroes --> |
| 218 | + <containsregex pattern="\d\d\d\d" /> |
| 219 | + </tokenfilter> |
| 220 | + </filterchain> |
| 221 | + </loadfile> |
| 222 | + <!-- <echo message="revision is ${revision}." /> --> |
| 223 | + |
| 224 | + <!-- figure out the revision number in library.properties --> |
| 225 | + <loadfile srcfile="library.properties" property="properties.version"> |
| 226 | + <filterchain> |
| 227 | + <tokenfilter> |
| 228 | + <containsregex pattern="version\s*=\s*(\d+)*" replace="\1" /> |
| 229 | + </tokenfilter> |
| 230 | + <striplinebreaks /> |
| 231 | + </filterchain> |
| 232 | + </loadfile> |
| 233 | + <!-- <echo message="properties.version is ${properties.version}." /> --> |
| 234 | + |
| 235 | + <condition property="revision.correct"> |
| 236 | + <contains string="${revision}" substring="${properties.version}"/> |
| 237 | + </condition> |
| 238 | + |
| 239 | + <!-- the properties.version property won't be set |
| 240 | + if $revision wasn't found... --> |
| 241 | + <fail unless="revision.correct" |
| 242 | + message="Fix version number in library.properties, it should be ${revision}" /> |
| 243 | + </target> |
| 244 | + |
193 | 245 | </project>
|
0 commit comments