-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
85 lines (73 loc) · 2.96 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
<?xml version="1.0"?>
<project name="npc" description="NPC build file" default="main" >
<property name="version" value="2.0.4" />
<property name="base.dir" value="/home/bgunn/workspace/npc" />
<property name="build.dir" value="/home/bgunn/workspace/npc/build/npc" />
<property name="src.dir" value="." />
<property name="js.src.dir" value="/home/bgunn/workspace/npc/build/npc/js/src" />
<property name="tmp.dir" value="/tmp" />
<property name="svnpath" value="/usr/bin/svn" />
<property name="repo" value="http://svn2.assembla.com/svn/npc/trunk" />
<property name="yuicompressor" value="/home/bgunn/workspace/yuicompressor.jar" />
<target name="main" depends="package"/>
<target name="src.update">
<svnupdate
svnpath="/usr/bin/svn"
nocache="true"
todir="${src.dir}"/>
<svnlastrevision
svnpath="/usr/bin/svn"
workingcopy="${src.dir}"
propertyname="svn.lastrevision"/>
</target>
<target name="src.copy" depends="src.update">
<copy todir="${build.dir}" >
<fileset dir="${src.dir}">
<include name="**" />
</fileset>
</copy>
</target>
<target name="js.concat" depends="src.copy">
<concat destfile="${tmp.dir}/npc-all.js">
<fileset dir="${js.src.dir}" >
<include name="plugins/*.js" />
</fileset>
<fileset dir="${js.src.dir}" >
<include name="overrides/*.js" />
</fileset>
<fileset dir="${js.src.dir}" >
<include name="Portal.js" />
<include name="PortalColumn.js" />
<include name="Portlet.js" />
<include name="npc.js" />
</fileset>
<fileset dir="${js.src.dir}" >
<include name="monitoring/*.js" />
<include name="monitoring/services/*.js" />
<include name="monitoring/hosts/*.js" />
</fileset>
</concat>
<concat destfile="${tmp.dir}/portlets-all.js">
<fileset dir="${js.src.dir}" >
<include name="portlets/*.js" />
</fileset>
</concat>
</target>
<target name="js.minify" depends="js.concat">
<exec command="java -jar ${yuicompressor} --type js -o ${build.dir}/js/npc-all-min.js ${tmp.dir}/npc-all.js" />
<exec command="java -jar ${yuicompressor} --type js -o ${build.dir}/js/portlets-all-min.js ${tmp.dir}/portlets-all.js" />
<delete file="${tmp.dir}/npc-all.js" />
<delete file="${tmp.dir}/portlets-all.js" />
</target>
<target name="prod" depends="js.minify">
<exec command="perl -i -p -e 's/layoutDev/layout/ig' ${build.dir}/npc.php" />
</target>
<target name="readme" depends="prod">
<exec command="perl -i -p -e 's/VERSION/${version}/g' ${build.dir}/README" />
</target>
<target name="package" depends="readme">
<zip destfile="${base.dir}/npc-${version}.zip" basedir="${base.dir}/build"/>
<tar destfile="${base.dir}/npc-${version}.tar.gz" basedir="${base.dir}/build" compression="gzip"/>
<delete dir="${build.dir}" />
</target>
</project>