forked from SoftwareAG/sagdevops-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
41 lines (33 loc) · 1.54 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
<?xml version="1.0"?>
<project name="main" xmlns="antlib:org.apache.tools.ant" basedir="." default="apply" >
<!-- standard header start -->
<dirname file="${ant.file.main}" property="project.dir" />
<property name="build.dir" location="${project.dir}/build" />
<property environment="env" />
<condition property="antcc.home" value="${env.ANTCC_HOME}" else="antcc">
<isset property="env.ANTCC_HOME"/>
</condition>
<import file="${antcc.home}/build.xml" />
<!-- standard header end -->
<target name="templateInit">
<fail unless="env.CC_TEMPLATE">
MUST provide $CC_TEMPLATE envrionment variable to run 'apply' and 'test' targets
</fail>
<condition property="env.properties" value="${project.dir}/templates/${env.CC_TEMPLATE}/env.properties" else="${project.dir}/environments/dev/env.properties">
<available file="${project.dir}/templates/${env.CC_TEMPLATE}/env.properties"/>
</condition>
</target>
<target name="templateApply" description="Apply $CC_TEMPLATE" depends="templateInit" >
<antcall target="sagenv.apply">
<param name="t" value="templates/${env.CC_TEMPLATE}"/>
<param name="env.properties" value="${env.properties}"/>
</antcall>
</target>
<target name="templateTest" description="Test $CC_TEMPLATE" if="env.CC_TEMPLATE" depends="templateInit">
<antcall target="sagtest.test">
<param name="fileset.dir" value="templates/${env.CC_TEMPLATE}"/>
<param name="env.properties" value="${env.properties}"/>
<param name="env.properties.full.path" location="${env.properties}"/>
</antcall>
</target>
</project>