This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
51 lines (42 loc) · 2.25 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
<?xml version='1.0' encoding='UTF-8'?>
<project name='LabKeyModules' default='deploy' basedir='.'>
<property environment='env'/>
<target name='init'>
<property name='modules.dir' value='${env.MODULES_DIR}'/>
<property name='moduleDir' location='${basedir}'/>
<basename property='module.name' file='${moduleDir}'/>
<property name='module.src.dir' value='${basedir}'/>
<property name='build.modules.dir' location='${basedir}/..'/>
</target>
<target name='module.properties' depends='init'>
<mkdir dir='${module.src.dir}/config'/>
<tstamp>
<format property='buildtime' pattern='MMMM d yyyy, h:mm aa'/>
</tstamp>
<copy tofile='${module.src.dir}/config/module.xml' file='${basedir}/module.template.xml' overwrite='true'>
<filterset begintoken='@@' endtoken='@@'>
<filtersfile file='${basedir}/module.properties'/>
<filter token='RequiredServerVersion' value='${RequiredServerVersion}'/>
<filter token='ModuleDependencies' value=''/>
<filter token='BuildTime' value='${buildtime}'/>
<filter token='BuildOS' value='${os.name}'/>
<filter token='BuildUser' value='${user.name}'/>
<filter token='BuildPath' value='${build.modules.dir}/${module.name}.module'/>
<filter token='SourcePath' value='${moduleDir}'/>
<filter token='URL' value='Not built from a Subversion source tree'/>
<filter token='Revision' value='Not built from a Subversion source tree'/>
</filterset>
</copy>
</target>
<target name='build' depends='module.properties'>
<zip destfile='${build.modules.dir}/${module.name}.module'>
<zipfileset dir='.'/>
</zip>
<available property='modulesDirExists' file='${modules.dir}'/>
</target>
<target name='deploy' depends='build' if='modulesDirExists'>
<echo message='Deploying ${module.name}.module to ${modules.dir}'/>
<copy file='${build.modules.dir}/${module.name}.module' overwrite='true' tofile='${modules.dir}/${module.name}.module'/>
<delete file='${build.modules.dir}/${module.name}.module'/>
</target>
</project>