-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
85 lines (77 loc) · 3.98 KB
/
build.xml
File metadata and controls
85 lines (77 loc) · 3.98 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
84
85
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="oidb">
<xmlproperty file="expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<xmlproperty file="repo.xml"/>
<property name="project.status" value="${meta.status}"/>
<property name="project.app" value="oidb"/>
<property name="build.dir" value="build"/>
<!-- Create a config module for the application from property file -->
<target name="config">
<!-- TODO: check for property file -->
<mkdir dir="${build.dir}"/>
<copy file="modules/config.xqm.in" tofile="${build.dir}/config.xqm" overwrite="true"/>
<echo> Check the property file: config.properties</echo>
<echoproperties srcfile="config.properties" />
<!-- get substitution data from the property file (config.properties) -->
<replace file="${build.dir}/config.xqm" propertyFile="config.properties">
<replacefilter token="@jndi-name@" property="jndi-name"/>
<replacefilter token="@sql-table@" property="sql-table"/>
<replacefilter token="@tap-baseurl-stable@" property="tap-baseurl-stable"/>
<replacefilter token="@tap-baseurl-beta@" property="tap-baseurl-beta"/>
<replacefilter token="@tap-baseurl-alpha@" property="tap-baseurl-alpha"/>
</replace>
</target>
<target name="dl-aspro-conf">
<!-- retrieve last aspro conf git repo -->
<exec executable="git">
<arg value="clone"/>
<arg value="https://github.com/JMMC-OpenDev/aspro-conf"/>
</exec>
<delete dir="instruments" failonerror="false"/>
<copy todir="instruments/AsproConf">
<fileset dir="aspro-conf/src/main/resources/fr/jmmc/aspro/model"/>
</copy>
</target>
<target name="init" description="copy files retrieved after running npm install command">
<tstamp />
<mkdir dir="${build.dir}" />
<copy file="node_modules/jquery/dist/jquery.min.js" todir="resources/scripts" />
<copy file="node_modules/datatables.net/js/jquery.dataTables.min.js" todir="resources/scripts" />
<copy file="node_modules/datatables.net-bs/js/dataTables.bootstrap.min.js" todir="resources/scripts/" />
<copy file="node_modules/datatables.net-bs/css/dataTables.bootstrap.min.css" todir="resources/css" />
<copy file="node_modules/plotly.js-dist-min/plotly.min.js" todir="resources/scripts" />
</target>
<!-- Build a .XAR with custom config -->
<target name="xar" depends="config,dl-aspro-conf,init">
<mkdir dir="${build.dir}"/>
<delete dir="${build.dir}" includes="*.xar"/>
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}-${project.status}.xar">
<exclude name="${build.dir}/**"/>
<exclude name="build.xml"/>
<exclude name="pom.xml"/>
<exclude name="target/**"/>
<!-- do not bundle netbeans files in the deployment archive -->
<exclude name="nbproject/**"/>
<!-- do not bundle property files in the deployment archive -->
<exclude name="**.properties"/>
<!-- do not bundle data in the deployment archive -->
<exclude name="data/**"/>
<!-- do not bundle aspro-conf -->
<exclude name="aspro-conf/**"/>
<exclude name="instruments/AsproConf/skytable_mean_atm.fits"/>
<!-- ignore local config... -->
<exclude name="modules/config.xqm"/>
<!-- ignore local node-modules -->
<exclude name="node_modules/**"/>
<exclude name="npm/**"/>
<!-- ... but include new custom config module -->
<mappedresources>
<fileset file="${build.dir}/config.xqm"/>
<globmapper from="*" to="modules/*"/>
</mappedresources>
</zip>
<delete file="${build.dir}/config.xqm" />
<!-- <delete dir="instruments"/> -->
</target>
</project>