-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
136 lines (117 loc) · 6.29 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="carousel">
<xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false"/>
<property name="build.dir" value="build"/>
<target name="clean">
<echo message="Deleting xar files..."/>
<delete dir="${build.dir}"/>
</target>
<target name="prepare">
<echo message="Creating build folder..."/>
<mkdir dir="${build.dir}"/>
</target>
<target name="copy">
<echo message="Copying the files to the build folder..."/>
<copy todir="${build.dir}/${app.name}-${app.version}">
<fileset dir="${basedir}">
<exclude name="${build.dir}/**"/>
</fileset>
</copy>
</target>
<target name="apply-filters-to-expath-pkg">
<echo message="Apply values to expath-pkg.xml..."/>
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
<fileset file="expath-pkg.xml.tmpl"/>
<filterset>
<filter token="name" value="${app.name}"/>
<filter token="version" value="${app.version}"/>
<filter token="url" value="${app.url}"/>
<filter token="title" value="${app.title}"/>
</filterset>
<globmapper from="*.tmpl" to="*"/>
</copy>
</target>
<target name="apply-filters-to-producer-dev">
<echo message="Apply DEV values to collection.xconf..."/>
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
<fileset file="collection.xconf.tmpl"/>
<fileset file="expath-pkg.xml.tmpl"/>
<filterset>
<filter token="provider-url" value="${trigger.provider-url.dev}"/>
<filter token="destination" value="${trigger.destination.dev}"/>
<filter token="name" value="${app.name}"/>
<filter token="version" value="${app.version}"/>
<filter token="url" value="${app.url}"/>
<filter token="title" value="${app.title}"/>
</filterset>
<globmapper from="*.tmpl" to="*"/>
</copy>
</target>
<target name="apply-filters-to-producer-prod">
<echo message="Apply PROD values to collection.xconf..."/>
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
<fileset file="collection.xconf.tmpl"/>
<fileset file="expath-pkg.xml.tmpl"/>
<filterset>
<filter token="provider-url" value="${trigger.provider-url.prod}"/>
<filter token="destination" value="${trigger.destination.prod}"/>
<filter token="name" value="${app.name}"/>
<filter token="version" value="${app.version}"/>
<filter token="url" value="${app.url}"/>
<filter token="title" value="${app.title}"/>
</filterset>
<globmapper from="*.tmpl" to="*"/>
</copy>
</target>
<target name="xar-dev" depends="clean,prepare" description="create xar files for DEV environment">
<antcall target="copy"/>
<antcall target="apply-filters-to-expath-pkg"/>
<echo message="------------------------------------------------------------"/>
<echo message="Creating DEV 'consumer' xar file..."/>
<echo message="------------------------------------------------------------"/>
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer-dev.xar">
<exclude name="${build.dir}/**"/>
<exclude name="**/*.tmpl"/>
</zip>
<antcall target="apply-filters-to-producer-dev"/>
<echo message="------------------------------------------------------------"/>
<echo message="Creating DEV 'producer' xar file containing triggers..."/>
<echo message="------------------------------------------------------------"/>
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer-dev.xar">
<exclude name="**/*.tmpl"/>
</zip>
<delete dir="${build.dir}/${app.name}-${app.version}"/>
</target>
<target name="xar-prod" depends="clean,prepare" description="create xar files for PROD environment">
<antcall target="copy"/>
<antcall target="apply-filters-to-expath-pkg"/>
<echo message="------------------------------------------------------------"/>
<echo message="Creating PROD 'consumer' xar file..."/>
<echo message="------------------------------------------------------------"/>
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer.xar">
<exclude name="${build.dir}/**"/>
<exclude name="**/*.tmpl"/>
</zip>
<antcall target="apply-filters-to-producer-prod"/>
<echo message="------------------------------------------------------------"/>
<echo message="Creating PROD 'producer' xar file containing triggers..."/>
<echo message="------------------------------------------------------------"/>
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer.xar">
<exclude name="${build.dir}/**"/>
<exclude name="**/*.tmpl"/>
</zip>
<delete dir="${build.dir}/${app.name}-${app.version}"/>
</target>
<target name="xar" depends="clean,prepare" description="create xar file">
<antcall target="copy"/>
<antcall target="apply-filters-to-expath-pkg"/>
<echo message="------------------------------------------------------------"/>
<echo message="Creating xar file..."/>
<echo message="------------------------------------------------------------"/>
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}.xar">
<exclude name="${build.dir}/**"/>
<exclude name="**/*.tmpl"/>
</zip>
<delete dir="${build.dir}/${app.name}-${app.version}"/>
</target>
</project>