-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·113 lines (96 loc) · 4.16 KB
/
build.xml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<project name="VeraAutomationHub" default="war" basedir=".">
<loadproperties srcFile="default.properties"/>
<property name="pi.host.dev" value="${pi.host.dev}"/>
<property name="pi.port.dev" value="22"/>
<property name="pi.user.dev" value="pi"/>
<property name="pi.password.dev" value="${pi.password.dev}"/>
<property name="pi.dirCopyTo.dev" value="/opt/web/mybase/webapps"/><!--/var/lib/tomcat7/webapps-->
<path id="compile.classpath">
<pathelement location="lib/guava-18.0.jar"/>
<pathelement location="lib/commons-logging-api-1.0.4.jar"/>
<pathelement location="lib/httpclient-4.1.2.jar"/>
<pathelement location="lib/httpcore-4.1.2.jar"/>
<pathelement location="lib/gson-2.8.1.jar"/>
<pathelement location="lib/huelocalsdk.jar"/>
<pathelement location="lib/huesdkresources.jar"/>
<pathelement location="./src"/>
<pathelement path="lib/gwt/gwt-user.jar"/>
<pathelement path="lib/gwt/gwt-dev.jar"/>
<pathelement path="lib/gwt/validation-api-1.0.0.GA-sources.jar"/>
<pathelement path="lib/gwt/validation-api-1.0.0.GA.jar"/>
<pathelement path="lib/mgwt/mgwt-2.0.0.jar"/>
</path>
<target name="_compile">
<mkdir dir="classes" />
<javac classpathref="compile.classpath" srcdir="src/main/java" destdir="classes"/>
</target>
<target name="deploy" depends="war">
<scp file="Lights.war" todir="${pi.user.dev}:${pi.password.dev}@${pi.host.dev}:${pi.dirCopyTo.dev}" port="${pi.port.dev}" trust="true" verbose="true" failonerror="true"></scp>
</target>
<target name="_Lights.jar" depends="_compile" description="">
<jar basedir="classes" includes="**/*.class, META-INF/*" jarfile="Lights.jar">
</jar>
</target>
<target name="war" depends="_Lights.jar, compileGWT, manifest, __insertCacheKill">
<war destfile="Lights.war" webxml="web/WEB-INF/web.xml" duplicate="preserve">
<zipfileset dir="web" includes="*.html,*.css,*.jsp,*.ico,*.png,*.appcache,*.js,*.gif"/>
<fileset dir="HouseLights">
<include name="**/*.*"/>
</fileset>
<lib dir="." includes="Lights.jar"/>
<lib dir="lib" includes="*"/>
</war>
</target>
<tstamp>
<format property="time.stamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
</tstamp>
<target name="__insertCacheKill">
<replace file="HouseLights/HouseLights.html" token="nocache.js" value="nocache.js?ck=${time.stamp}"/>
</target>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib.gwt/ant/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<property file="default.properties"/>
<path id="gwt.path">
<pathelement location="./src/main/java"/>
<pathelement path="lib/gwt/gwt-user.jar"/>
<pathelement path="lib/gwt/gwt-dev.jar"/>
<pathelement path="lib/gwt/validation-api-1.0.0.GA-sources.jar"/>
<pathelement path="lib/gwt/validation-api-1.0.0.GA.jar"/>
<pathelement path="lib/mgwt/mgwt-2.0.0.jar"/>
</path>
<target name="compileGWT">
<java classpathref="gwt.path" classname="com.google.gwt.dev.Compiler" fork="true" maxmemory="1024M" failonerror="true">
<arg value="-localWorkers"/>
<arg value="8"/>
<arg value="-war"/>
<arg value="."/>
<arg value="com.bigboxer23.house.lights.HouseLights"/>
</java>
</target>
<target name="manifest">
<echo message="copying manifest.appcache to HouseLights"/>
<copy file="src/main/resources/manifest.appcache" tofile="HouseLights/manifest.appcache" />
<echo message="manifest cleaning" />
<!-- update version -->
<echo message="Updating the site.manifest version date to today"/>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<replaceregexp match="# version .+" replace="# version ${TODAY}" file="HouseLights/manifest.appcache"/>
<!-- replace javascript files -->
<echo message="Updating the site.manifest with the new js"/>
<for param="file">
<path>
<fileset dir="HouseLights" includes="*.cache.js"/>
</path>
<sequential>
<basename property="filename.@{file}" file="@{file}" />
<echo message="${filename.@{file}}${line.separator}" file="HouseLights/manifest.appcache" append="true"/>
</sequential>
</for>
<echo message="FALLBACK:${line.separator}${line.separator}NETWORK:${line.separator}*" file="HouseLights/manifest.appcache" append="true"/>
</target>
</project>