Skip to content

Commit 1bfd11f

Browse files
committed
add dist target, cleaning up properties, more notes in the readme
1 parent d44dd69 commit 1bfd11f

File tree

4 files changed

+57
-2
lines changed

4 files changed

+57
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ javafx-*.zip
1212

1313
# everything is downloaded from online
1414
/library
15+
16+
# the build files
17+
/dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ These are not done by default because we've seen projects that (1) run on all th
4141

4242
ant dist
4343

44-
Then upload dist/javafx.zip and dist/javafx.txt to the `latest` tag on Github. Can also upload them to the tag for the current version, for anyone installing manually.
44+
Then upload dist/processing4-javafx.zip and dist/processing4-javafx.txt to the `latest` tag on Github. Can also upload them to the tag for the current version, for anyone installing manually.
4545

4646
6. Add changes in MarkDown format to the release: <https://github.com/processing4/processing4-javafx/releases>

build.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0"?>
22
<project name="Processing JavaFX renderer" default="build">
33

4+
<property name="me" value="processing4-javafx" />
5+
46
<target name="core-check">
57
<property file="local.properties" />
68

@@ -190,4 +192,54 @@ ${line.separator}with the path to where you have the code for Processing 4 check
190192
<target name="build" depends="compile" description="Build JavaFX renderer">
191193
<jar basedir="bin" destfile="library/javafx.jar" />
192194
</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+
193245
</project>

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = The Processing Foundation
33
url = https://github.com/processing/processing4-javafx
44
category = Other
55
sentence = The FX2D renderer for Processing 4
6-
paragraph =
6+
paragraph = Since Processing 4.0 beta 4, the FX2D renderer is available as a separate library.
77
version = 1279
88
prettyVersion = 4.0 beta 4
99
minRevision = 1279

0 commit comments

Comments
 (0)