This repository has been archived by the owner on Apr 19, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
150 lines (140 loc) · 5.96 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?xml version="1.0" encoding="UTF-8"?>
<project name="module-drush" basedir=".">
<dirname property="project.basedir" file="${ant.file.module-drush}"/>
<property name="root.dir" location="${project.basedir}/.."/>
<property name="build.properties" value="${project.basedir}/build.properties"/>
<property file="${build.properties}"/>
<!-- Neard dev -->
<property name="dev.path" location="${root.dir}/dev"/>
<fail unless="dev.path" message="Project 'dev' not found in ${dev.path}"/>
<echo message="Neard dev found in ${dev.path}" level="debug"/>
<!-- Import build-commons.xml -->
<import file="${dev.path}/build/build-commons.xml"/>
<!-- Import build-bundle.xml -->
<import file="${dev.path}/build/build-bundle.xml"/>
<target name="release.build">
<basename property="bundle.folder" file="${bundle.path}"/>
<replaceproperty src="bundle.folder" dest="bundle.version" replace="${bundle.name}" with=""/>
<getmoduleuntouched name="${bundle.name}" version="${bundle.version}" propSrcDest="bundle.srcdest" propSrcFilename="bundle.srcfilename"/>
<propertyregex property="bundle.srcbasename" input="${bundle.srcfilename}" regexp="(.*)\.(.*)" select="\1"/>
<condition property="bundle.srcfinal" value="${bundle.srcdest}/${bundle.srcbasename}"><available file="${bundle.srcdest}/${bundle.srcbasename}" type="dir"/></condition>
<fail unless="bundle.srcfinal" message="Main folder not found"/>
<assertfile file="${bundle.srcfinal}/drush"/>
<!-- Remove content of src (use composer instead) -->
<delete dir="${bundle.srcfinal}"/>
<mkdir dir="${bundle.srcfinal}"/>
<!-- Composer -->
<composer dir="${bundle.srcfinal}">
<args>
<arg value="require"/>
<arg value="drush/drush:${bundle.version}"/>
</args>
</composer>
<!-- Temp copy -->
<copy todir="${bundle.srcfinal}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes"/>
</copy>
<!-- Binaries -->
<if>
<available file="${bundle.srcfinal}/bins.properties" type="file"/>
<then>
<property prefix="drush" file="${bundle.srcfinal}/bins.properties"/>
<mkdir dir="${bundle.srcfinal}/bins"/>
<!-- bzip2 -->
<if>
<isset property="drush.bzip2"/>
<then>
<download url="${drush.bzip2}" returnProperty="bzip2.dest"/>
<assertfile file="${bzip2.dest}/bin/bzip2.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${bzip2.dest}/bin"/>
</copy>
</then>
</if>
<!-- gzip -->
<if>
<isset property="drush.gzip"/>
<then>
<download url="${drush.gzip}" returnProperty="gzip.dest"/>
<assertfile file="${gzip.dest}/bin/gzip.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${gzip.dest}/bin"/>
</copy>
</then>
</if>
<!-- libarchive -->
<if>
<isset property="drush.libarchive"/>
<then>
<download url="${drush.libarchive}" returnProperty="libarchive.dest"/>
<assertfile file="${libarchive.dest}/bin/bsdtar.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${libarchive.dest}/bin"/>
</copy>
</then>
</if>
<!-- tar -->
<if>
<isset property="drush.tar"/>
<then>
<download url="${drush.tar}" returnProperty="tar.dest"/>
<assertfile file="${tar.dest}/bin/tar.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${tar.dest}/bin"/>
</copy>
</then>
</if>
<!-- wget -->
<if>
<isset property="drush.wget"/>
<then>
<download url="${drush.wget}" returnProperty="wget.dest"/>
<assertfile file="${wget.dest}/bin/wget.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${wget.dest}/bin"/>
</copy>
</then>
</if>
<!-- wget-dep -->
<if>
<isset property="drush.wget-dep"/>
<then>
<download url="${drush.wget-dep}" returnProperty="wget-dep.dest"/>
<assertfile file="${wget-dep.dest}/bin/libeay32.dll"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${wget-dep.dest}/bin"/>
</copy>
</then>
</if>
<!-- mysql -->
<if>
<isset property="drush.mysql"/>
<then>
<download url="${drush.mysql}" skipexisting="true" returnProperty="mysql.dest"/>
<basename property="mysql.filename" file="${drush.mysql}"/>
<propertyregex property="mysql.basename" input="${mysql.filename}" regexp="(.*)\.(.*)" select="\1"/>
<assertfile file="${mysql.dest}/${mysql.basename}/bin/mysql.exe"/>
<copy todir="${bundle.srcfinal}/bins" overwrite="true">
<fileset dir="${mysql.dest}/${mysql.basename}/bin" includes="
mysql.exe,
mysqladmin.exe,
mysqlcheck.exe
"/>
</copy>
</then>
</if>
<delete file="${bundle.srcfinal}/bins.properties"/>
</then>
</if>
<delete dir="${bundle.tmp.prep.path}/${bundle.folder}"/>
<mkdir dir="${bundle.tmp.prep.path}/${bundle.folder}"/>
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
<fileset dir="${bundle.srcfinal}"/>
</copy>
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes" excludes="
bins.properties"
/>
</copy>
</target>
</project>