-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-deploy-applications.xml
More file actions
83 lines (75 loc) · 2.8 KB
/
3-deploy-applications.xml
File metadata and controls
83 lines (75 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!--
Copy support folders to each standalone application folder
created by the Processing sketch "Export Application" command.
-->
<project name="deploy-applications" default="deploy" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="../java_libs/apache-ant-1.6.2/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- Define a custom task for extracting the platform name from the directory name -->
<scriptdef name="platformname" language="javascript">
<attribute name="text" />
<attribute name="property" />
<![CDATA[
var text = attributes.get("text");
var start = text.lastIndexOf(".") + 1;
project.setProperty(attributes.get("property"), text.substring(start));
]]>
</scriptdef>
<!-- Load the Hub properties file so we can get the version info -->
<loadproperties srcFile="conf/hub.properties" />
<property name="sketch.name" value="NETLabHub" />
<property name="sketchbook.dir" value="${user.home}/Workspaces/Processing"/>
<property name="sketch.dir" value="${sketchbook.dir}/${sketch.name}"/>
<property name="build.dir" value="build/applications"/>
<target name="deleteBuildDir">
<if>
<available file="${build.dir}" type="dir" />
<then>
<delete includeEmptyDirs="true">
<fileset dir="${build.dir}">
<include name="**/*" />
</fileset>
</delete>
</then>
</if>
</target>
<target name="deploy" depends="deleteBuildDir">
<!-- Process each application folder (copy support dirs, create zip archives) -->
<foreach target="process-application-directory" param="theAppDir">
<path>
<dirset dir="${sketch.dir}">
<include name="application*" />
</dirset>
</path>
</foreach>
<!-- Copy macosx icon -->
<copy todir="${sketch.dir}/application.macosx/NETLabHub.app/Contents/Resources">
<fileset dir="${sketch.dir}/data" includes="sketch.icns" />
</copy>
<!-- Move to build directory -->
<mkdir dir="${build.dir}" />
<move todir="${build.dir}">
<fileset dir="${sketch.dir}" includes="application.*/**" />
</move>
<echo>Application support files deployed to ${build.dir}</echo>
</target>
<target name="process-application-directory">
<mkdir dir="${theAppDir}/log" />
<touch file="${theAppDir}/log/hub.log" />
<copy todir="${theAppDir}">
<fileset dir="${sketch.dir}" includes="plugins/** conf/** data/** *.txt *.md" excludes=".DS_Store"/>
</copy>
<delete>
<fileset dir="${theAppDir}" includes="**/source/*" />
</delete>
<delete>
<dirset dir="${theAppDir}" includes="source" />
</delete>
<platformname text="${theAppDir}" property="platform" />
<!-- Don't zip because Ant zip task will strip file permissions.
<zip destfile="${sketch.dir}/netlabhub-${app.version}-${platform}.zip" basedir="${theAppDir}" />-->
</target>
</project>