forked from phpmd/phpmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
138 lines (119 loc) · 5.17 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="PHPMD" basedir=".">
<!--
Include local project properties.
-->
<property file="build.properties" />
<!--
Import common build targets
-->
<import file="${basedir}/setup/src/main/xml/base.xml" />
<!--
Hook that will be called after we have copied the project's library
directory.
Parameters:
output.dir Output directory for the temporary build tree.
library.dir The library directory in the temporary build tree.
-->
<target name="~copy-vendor-dir-after">
<delete includeemptydirs="true">
<fileset dir="${vendor.dir}/pdepend">
<exclude name="pdepend/src/main/**" />
</fileset>
<fileset dir="${vendor.dir}/symfony">
<include name="**/Tests/**" />
</fileset>
<fileset dir="${vendor.dir}/phpdocumentor" />
<fileset dir="${vendor.dir}/phpspec" />
<fileset dir="${vendor.dir}/phpunit" />
<fileset dir="${vendor.dir}/sebastian" />
<fileset dir="${vendor.dir}/squizlabs" />
</delete>
</target>
<!--
Hook method for copying files for the project's xyz archive format.
Parameters:
output.dir Output directory for the temporary build tree.
-->
<target name="do-copy-files-for-xyz-archive">
<move todir="${output.dir}/src/main/php">
<fileset dir="${output.dir}/" includes="PHPMD/**/*.*" />
</move>
<copy todir="${output.dir}/src/main/resources/rulesets">
<fileset dir="${commons.srcdir.resource}/rulesets" />
</copy>
<copy file="${basedir}/composer.json" todir="${output.dir}/" />
<copy file="${basedir}/composer.lock" todir="${output.dir}/" />
</target>
<!--
We use the phar archive after hook to validate that a newly created
phar archive works as expected.
Parameters:
${-package:phar:filename} Name of the created phar file.
-->
<target name="-phpmd:phar:after~hooked" extensionOf="-phar:after~hook">
<echo message="Executing:" level="verbose" />
<echo message=" ${-phar:filename} PHPMD/Rule text ${phpmd.rulesets}" level="verbose" />
<exec dir="${basedir}"
executable="${-phar:filename}"
failonerror="true">
<arg value="${commons.srcdir.php}/PHPMD/Rule" />
<arg value="text" />
<arg value="${phpmd.rulesets}" />
</exec>
</target>
<target name="-copy-vendor-dir:before~hooked" extensionOf="-copy-vendor-dir:before~hook">
<exec executable="php" failonerror="true">
<arg line="composer.phar" />
<arg line="config" />
<arg line="platform.php" />
<arg line="5.3.9"/>
</exec>
<exec executable="php" failonerror="true">
<arg line="composer.phar" />
<arg line="update" />
<arg line="--no-dev" />
<arg line="--optimize-autoloader"/>
<arg line="--prefer-dist" />
<arg line="--prefer-stable" />
</exec>
</target>
<target name="phpmd:deploy" depends="-phpmd:deploy:after~hooked" />
<target name="-phpmd:deploy:after~hooked" extensionOf="-deploy:after~hook" if="release">
<exec executable="git" dir="${basedir}" failonerror="true">
<arg line="pull" />
</exec>
<exec executable="git" dir="${basedir}" failonerror="true">
<arg line="push" />
<arg line="--all" />
</exec>
<exec executable="git" dir="${basedir}" failonerror="true">
<arg line="tag" />
<arg line="${project.version}" />
</exec>
<exec executable="git" dir="${basedir}" failonerror="true">
<arg line="push" />
<arg line="--tags" />
</exec>
<property name="project.web.release.dir" value="${project.web.root}/static.${project.uri}/php/${project.version}" />
<exec dir="${commons:builddir}" executable="ssh" failonerror="true">
<arg line="${remote.shell.credentials}" />
<arg line="mkdir '${project.web.release.dir}'" />
</exec>
<exec dir="${commons:builddir}" executable="scp" failonerror="true">
<arg line="dist/${project.name}-${project.version}.phar" />
<arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.phar" />
</exec>
<exec dir="${commons:builddir}" executable="scp" failonerror="true">
<arg line="dist/${project.name}-${project.version}.phar" />
<arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.bz2.phar" />
</exec>
<exec dir="${commons:builddir}" executable="ssh" failonerror="true">
<arg line="${remote.shell.credentials}" />
<arg line="cd '${project.web.release.dir}/..' ; rm latest ; ln -s '${project.version}' latest" />
</exec>
<exec dir="${basedir}" executable="ant" failonerror="true">
<arg line="site:deploy" />
</exec>
</target>
</project>