-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
114 lines (101 loc) · 4.29 KB
/
build.xml
File metadata and controls
114 lines (101 loc) · 4.29 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
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
114
<?xml version="1.0" encoding="UTF-8"?>
<project default="dist" name="crApp" basedir="." xmlns:unless="ant:unless">
<dirname property="crApp.basedir" file="${ant.file.crApp}"/>
<!-- import default properties from file -->
<property file="${crApp.basedir}/local.build.properties"/>
<property file="${crApp.basedir}/build.properties"/>
<target name="clean-all">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="clean">
<antcall target="clean-build"/>
<antcall target="clean-dist"/>
</target>
<target name="clean-build" if="${build.dir}">
<delete includeemptydirs="true">
<fileset dir="${build.dir}" defaultexcludes="false">
<include name="**/*"/>
<exclude name="*.xar"/>
<exclude name="*.tar.gz"/>
</fileset>
</delete>
</target>
<target name="clean-dist" if="${dist.dir}">
<delete includeemptydirs="true">
<fileset dir="${dist.dir}" defaultexcludes="false">
<include name="**/*"/>
</fileset>
</delete>
</target>
<target name="init" depends="get-current-hash-of-HEAD">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="get-current-hash-of-HEAD">
<description>Get the hash of the current git HEAD</description>
<exec executable="git" outputproperty="local.revision">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<echo>Current HEAD: ${local.revision}</echo>
</target>
<target name="collect-data" depends="init">
<copy todir="${build.dir}/" overwrite="true">
<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="submodules/**"/>
<exclude name="node_modules/**"/>
<exclude name="scripts/**/local/**"/>
<exclude name="resources/sass/**"/>
</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}"/>
</filterset>
</copy>
<echo>Get application logo</echo>
<copy file="resources/img/crApp-logo-transparent.png" tofile="${build.dir}/icon.png"/>
</target>
<target name="compile" depends="collect-data">
<description>Update javascript libraries via yarn</description>
<exec executable="${yarn.cmd}" failonerror="yes">
<arg value="install"/>
</exec>
<description>Create CSS files via sass</description>
<exec executable="${sass.cmd}">
<arg line="resources/sass/main.scss ${build.dir}/resources/css/styles.css"/>
</exec>
</target>
<target name="dist" depends="compile">
<property name="project.app.pkg.name" value="${project.app}-${project.version}-${local.revision}.xar"/>
<zip destfile="${dist.dir}/${project.app.pkg.name}">
<fileset dir="${build.dir}/">
<include name="**/*.*"/>
</fileset>
</zip>
<delete file="expath-pkg.xml"/>
<delete file="repo.xml"/>
<delete dir="${build.dir}"/>
</target>
</project>