forked from Baumann-Digital/portal-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
90 lines (82 loc) · 3.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="dist" name="raffArchive" basedir="." xmlns:unless="ant:unless">
<dirname property="raffArchive.basedir" file="${ant.file.raffArchive}"/>
<!-- import default properties from file -->
<property file="${raffArchive.basedir}/local.build.properties"/>
<property file="${raffArchive.basedir}/build.properties"/>
<target name="clean-all">
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="clean-dist" if="${build.dir}">
<delete includeemptydirs="true">
<fileset dir="${build.dir}" defaultexcludes="false">
<include name="**/*"/>
</fileset>
</delete>
</target>
<target name="init" depends="get-current-hash-of-HEAD">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.dir}"/>
</target>
<target name="get-current-hash-of-HEAD">
<description>Get the hash of the current git HEAD</description>
<exec executable="${bash.command}" outputproperty="local.revision">
<arg value="-c"/>
<arg value="${git.command} rev-parse --short HEAD"/>
<env key="LANG" value="C"/>
</exec>
<echo>Current HEAD: ${local.revision}</echo>
</target>
<target name="dist" depends="init">
<property name="project.version.package" value="${project.version}"/>
<loadresource property="project.version.package.name">
<propertyresource name="project.version.package" />
<filterchain>
<tokenfilter>
<replaceregex pattern="\." replace="" flags="g"/>
</tokenfilter>
</filterchain>
</loadresource>
<property name="project.app.pkg.name" value="${project.app}-${project.version.package.name}-${local.revision}.xar"/>
<copy todir="${build.dir}/">
<fileset dir=".">
<include name="**/*.*"/>
<exclude name="build.xml"/>
<exclude name=".existdb.json"/>
<exclude name=".git*"/>
<exclude name="*.tmpl"/>
<exclude name="*.xpr"/>
<exclude name="*.properties"/>
<exclude name="build/"/>
<exclude name="dist/"/>
<exclude name="scripts/"/>
</fileset>
</copy>
<copy file="expath-pkg.xml.tmpl" tofile="${build.dir}/expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.app" value="${project.app}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="project.version" value="${project.version}"/>
<filter token="project.version.hash" value="${local.revision}"/>
<filter token="project.url" value="${project.url}"/>
</filterset>
</copy>
<copy file="repo.xml.tmpl" tofile="${build.dir}/repo.xml" filtering="true" overwrite="true">
<filterset>
<filter token="data.target" value="${project.app}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="user.permissions" value="${user.permissions}"/>
</filterset>
</copy>
<zip destfile="${dist.dir}/${project.app.pkg.name}">
<fileset dir="${build.dir}/">
<include name="**/*.*"/>
</fileset>
</zip>
<antcall target="clean"/>
</target>
</project>