-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.xml
executable file
·72 lines (56 loc) · 2.68 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
<project name="PAYONE Payment Plugin" default="buildTarget" basedir=".">
<description>
Build file for release packages
</description>
<!-- set global properties for this build -->
<property name="srcShopware5" location="./"/>
<property name="build" location="/tmp/MoptPaymentPayone-build/"/>
<property name="dist" location="./"/>
<!-- property name="expires" value="2011-05-11"/ -->
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<target name="init" depends="git.revision">
<!-- Create the time stamp -->
<tstamp/>
<echo>Module Version: ${git.revision}</echo>
<condition property="expiry" value="2999-12-31" >
<not>
<isset property="expiry" />
</not>
</condition>
<echo>Expire Date: ${expiry}</echo>
</target>
<target name="buildTarget" depends="init" description="copy the files, do the zip" >
<!-- Create the build directory structure-->
<mkdir dir="${build}"/>
<!-- copy module to build folder excluding git files -->
<copy todir="${build}" overwrite="true" encoding="UTF-8" outputencoding="UTF-8" >
<fileset dir="${srcShopware5}" excludes=".* README.md CONTRIBUTING.md build.xml composer.json .idea/ composer.lock .github/ notizen.md LICENSE" />
</copy>
<!-- replace Comment vars in Shopware4 -->
<replace dir="${build}" encoding="UTF-8" >
<replacefilter token="%%NAME%%" value="${ant.project.name}"/>
<replacefilter token="%%VERSION%%" value="${git.revision}"/>
<replacefilter token="%%REVISION%%" value=""/>
<include name="Frontend/MoptPaymentPayone/Bootstrap.php"/>
<include name="Frontend/MoptPaymentPayone/plugin.json"/>
</replace>
<!-- pack source code zip file -->
<zip destfile="${dist}/FatchipPayoneConnector_${git.revision}_shopware5_source.zip" basedir="${build}" />
<!-- Clean UP -->
<delete dir="${build}"/>
</target>
</project>