build.xml 1.42 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
Mathias Goebel's avatar
Mathias Goebel committed
2
<project default="xar" name="SADE">
Mathias Goebel's avatar
JENKINS    
Mathias Goebel committed
3
    <property environment="env"/>
Mathias Goebel's avatar
Mathias Goebel committed
4
    <property file="build.properties"/>
Mathias Goebel's avatar
Mathias Goebel committed
5
    <property name="build.dir" value="build"/>
Mathias Goebel's avatar
Mathias Goebel committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19

    <!-- look for the current branch in .git folder -->
    <loadfile property="git.branch" srcfile=".git/HEAD">
        <filterchain>
            <headfilter lines="1" skip="0"/>
            <tokenfilter>
                <replaceregex pattern="^.*\/" replace="" flags="gi"/>
            </tokenfilter>
            <striplinebreaks/>
        </filterchain>
    </loadfile>

    <property name="jenkins.branch" value="${env.GIT_BRANCH}" />

Mathias Goebel's avatar
Mathias Goebel committed
20
    <property name="namespace" value="${project.namespace}-${branch}"/>
Mathias Goebel's avatar
test    
Mathias Goebel committed
21
22


Mathias Goebel's avatar
Mathias Goebel committed
23
    <target name="xar">
Mathias Goebel's avatar
Mathias Goebel committed
24
25
26
27
28
29
30
31
        <echo message="${jenkins.branch}"/>
        <echo message="${git.branch}"/>

        <condition property="branch" else="${jenkins.branch}" value="${git.branch}">
            <matches pattern="\$" string="${jenkins.branch}"/>
        </condition>
        <echo message="${branch}"/>

Mathias Goebel's avatar
Mathias Goebel committed
32
        <copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
Mathias Goebel's avatar
JENKINS    
Mathias Goebel committed
33
34
35
            <filterset>
                <filter token="project.version" value="${project.version}"/>
            </filterset>
Mathias Goebel's avatar
Mathias Goebel committed
36
        </copy>
Mathias Goebel's avatar
Mathias Goebel committed
37
        <mkdir dir="${build.dir}"/>
Mathias Goebel's avatar
Mathias Goebel committed
38
        <zip basedir="." destfile="${build.dir}/${project.abbrev}-${project.version}-${branch}.xar" excludes="${build.dir}/*"/>
Mathias Goebel's avatar
Mathias Goebel committed
39
    </target>
Mathias Goebel's avatar
Mathias Goebel committed
40

Mathias Goebel's avatar
Mathias Goebel committed
41
</project>