-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
126 lines (109 loc) · 3.65 KB
/
build.xml
File metadata and controls
126 lines (109 loc) · 3.65 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="eix-core" default="build">
<!-- Phing build script for libraries -->
<!-- Set common properties -->
<property name="repository" value="${user.home}/.eix/repository"/>
<property name="srcDir" value="src/php"/>
<property name="testDir" value="${srcDir}/test"/>
<property name="buildDir" value="build"/>
<property name="reportsDir" value="${buildDir}/reports"/>
<property name="distFileName" value="${phing.project.name}-${version}"/>
<property name="distFileType" value="zip"/>
<property name="version" value="dev-master"/>
<!-- Define project file locations and sets -->
<fileset dir="${srcDir}" id="phpFiles">
<include name="**/*.php"/>
</fileset>
<fileset dir="${srcDir}" id="main">
<include name="main/**/*.php"/>
</fileset>
<fileset dir="${srcDir}" id="devel">
<include name="test/**/*.php"/>
</fileset>
<!-- Targets -->
<target name="report"
description="Report on code quality"
>
<mkdir dir="${reportsDir}"/>
<!-- Measure project size using PHPLOC -->
<phploc
reportType="txt"
reportDirectory="${reportsDir}"
reportName="phploc"
>
<fileset dir="${srcDir}">
<include name="**/*.php"/>
</fileset>
</phploc>
<!-- Calculate software metrics -->
<parallel>
<!-- Check for duplicate code -->
<phpcpd minLines="10" minTokens="20">
<fileset refid="phpFiles"/>
<formatter type="pmd" outfile="${reportsDir}/pmd-cpd.xml"/>
</phpcpd>
</parallel>
</target>
<target name="clean"
description="Prepare the build environment"
>
<!-- Ensure the build folder is clean -->
<delete dir="${buildDir}" quiet="true"/>
<!-- Ensure the build folder exists -->
<mkdir dir="${buildDir}"/>
</target>
<target name="test"
description="Run unit tests"
depends="clean"
>
<phplint haltonfailure="true">
<fileset refid="main"/>
<fileset refid="devel"/>
</phplint>
<exec executable="src/php/lib/phpunit/phpunit/phpunit"
passthru="true"
checkreturn="true"
/>
</target>
<target name="quickbuild"
description="A quick build without tests or reports"
>
<phingcall target="_build"/>
</target>
<!-- A full build -->
<target name="build"
description="A full build"
depends="test,report"
>
<phingcall target="_build"/>
</target>
<target name="_build"
description="Package the contents of the library"
>
<composer
command="archive"
composer="/usr/local/bin/composer"
>
<arg value="--format=zip"/>
<arg value="--dir=build"/>
</composer>
</target>
<target name="publish"
description="Make the packages available in the repository"
depends="build"
>
<mkdir dir="${repository}"/>
<echo>
Copying ${distFileName}.${distFileType} to ${repository}...
</echo>
<copy
todir="${repository}"
haltonerror="true"
>
<fileset dir="${buildDir}">
<include name="${distFileName}*.${distFileType}"/>
</fileset>
</copy>
<echo>Done.</echo>
</target>
</project>