forked from flagbit/Magento-FeedReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
80 lines (68 loc) · 2.99 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
<project name="Flagbit_FeedReader" default="deploy" basedir=".">
<property file="${basedir}/build.properties" />
<property file="${basedir}/build.default.properties" />
<property name="php.bin" value="/usr/bin/php" />
<property name="build.dir" value="${basedir}/build" />
<property name="srcdir" value="${basedir}/src"/>
<property name="builddir" value="${basedir}/build"/>
<property name="docdir" value="${basedir}/doc"/>
<property name="doc.dir" value="${basedir}/doc" />
<target name="clean" description="Removes old files" depends="clean-phpdoc" />
<target name="clean-phpdoc">
<delete dir="${doc.dir}" includeemptydirs="true" failonerror="true" />
</target>
<target name="prepare">
<mkdir dir="${build.dir}" />
<replaceregexp file="${srcdir}/app/code/community/Flagbit/Feedreader/etc/config.xml"
match="(<version>)(.*)(</version>)" replace="\1${package.version}\3"/>
<tstamp>
<format property="package.date" pattern="yyyy-MM-dd"/>
</tstamp>
<tstamp>
<format property="package.time" pattern="HH:mm:ss"/>
</tstamp>
<replaceregexp file="${basedir}/package.xml"
match="(<(date)>).*?(</\2>)" replace="\1${package.date}\3" />
<replaceregexp file="${basedir}/package.xml"
match="(<(time)>).*?(</\2>)" replace="\1${package.time}\3" />
<replaceregexp file="${basedir}/package.xml"
match="(<version>.*?<(release)>).*?(</\2>.*?<(api)>).*?(</\4>.*?</version>)"
replace="\1${package.version}\3${package.version}\5" flags="gs" />
</target>
<target name="package" depends="prepare" description="Creates a PEAR package">
<copy file="${basedir}/package.xml" tofile="${srcdir}/package.xml"/>
<exec dir='${srcdir}/' executable="${pear}">
<arg value="mpx"/>
</exec>
<replaceregexp file="${srcdir}/package.xml" match="(\\)" replace="/" flags="gs" />
<copy file="${srcdir}/package.xml" tofile="${basedir}/package.xml"/>
<exec dir="${srcdir}" executable="${pear}">
<arg value="mage-package"/>
</exec>
<delete file="${srcdir}/package.xml"/>
<move file="${srcdir}/${ant.project.name}-${package.version}.tgz" todir="${builddir}"/>
</target>
<target name="deploy">
<copy todir="${deploy.dir}/app" overwrite="yes" verbose="yes">
<fileset dir="app">
<exclude name="**/.svn" />
</fileset>
</copy>
<copy todir="${deploy.dir}/skin" overwrite="yes" verbose="yes">
<fileset dir="skin">
<exclude name="**/.svn" />
</fileset>
</copy>
</target>
<target name="phpdoc" description="" depends="clean-phpdoc">
<exec executable="${php.bin}" dir="${basedir}/app">
<arg value="${phpdoc.inc}" />
<arg value="-f" />
<arg value="*.php" />
<arg value="-t" />
<arg value="${doc.dir}" />
<arg value="-ti" />
<arg value="${ant.project.name}" />
</exec>
</target>
</project>