This repository was 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
58 lines (50 loc) · 2.5 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="module-phpmetrics" basedir=".">
<dirname property="project.basedir" file="${ant.file.module-phpmetrics}"/>
<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}/bin/phpmetrics"/>
<!-- Temp copy -->
<copy todir="${bundle.srcfinal}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes"/>
</copy>
<!-- Composer -->
<if>
<available file="${bundle.srcfinal}/composer.json" type="file"/>
<then>
<composer dir="${bundle.srcfinal}">
<args>
<arg value="update"/>
<arg value="--no-dev"/>
<arg value="--prefer-lowest"/>
<arg value="--optimize-autoloader"/>
</args>
</composer>
</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"/>
</copy>
</target>
</project>