forked from erochest/GoogleAnalyticsErr
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
208 lines (161 loc) · 7.44 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : build.xml
Created on : August 4, 2010, 12:51 PM
Version : $Id$
Author : Scholars' Lab
Description:
Provides a build environment for the this plugin.
The ImageMagick library is a dependency for to successfully run several
of the programs called below.
PEAR Channels:
You will need to have the following channels to ensure all the PEAR
packages can be installed
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover pear.phpmd.org
sudo pear channel-discover pear.pdepend.org
PEAR Packages:
You will need to make sure you have updated PEAR and install the
following packages:
sudo pear upgrade
sudo pear install PhpDocumentor
sudo pear install phpunit/PHPUnit
sudo pear install phpunit/phpcpd
sudo pear install phpmd/PHP_PMD-alpha
sudo pear install pdepend/PHP_Depend-beta
sudo pear install PHP_CodeSniffer-1.3.0a1
In addition to these, if you wish to have use the code browser package,
please refere to the documentation at http://github.com/mayflowergmbh/PHP_CodeBrowser
In short, these are the directions for installing the alpha package
sudo pear config-set preferred_state alpha
sudo pear install -a phpunit/PHP_CodeBrowser
sudo pear config-set peferred_state stable
-->
<project name="GoogleAnalyticsErr" default="usage" basedir=".">
<description>A simple build file for Omeka plugins.</description>
<property name="project" value="GoogleAnalyticsErr" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<tstamp />
<property name="now" value="${DSTAMP}-${TSTAMP}" />
<property name="tar" value="${project}-${now}.tar" />
<property name="gzip" value="${tar}.gz" />
<target name="setup" description="Create the build directory structure">
<tstamp />
<!-- create the build directory structure -->
<mkdir dir="${build}/api" />
<mkdir dir="${build}/code-browser" />
<mkdir dir="${build}/coverage" />
<mkdir dir="${build}/logs" />
<mkdir dir="${build}/pdepend" />
<mkdir dir="${build}/phpmd" />
</target>
<target name="clean" description="Clean up">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="package" description="Create a zipped package for distribution">
<mkdir dir="${dist}" />
<tar destfile="${dist}/${project}-${now}.tar"
basedir="${basedir}"
excludes="${build}/**,${dist}/**,nbproject/**" />
<gzip zipfile="${dist}/${gzip}" src="${dist}/${tar}" />
<delete file="${dist}/${tar}" />
</target>
<target name="package-docs" depends="phpdoc" description="Create a zipped package of the documentation">
<echo message="Compressing documentation" />
<mkdir dir="${dist}" />
<property name="docfile" value="${project}-docs-${now}.tar" />
<property name="zipfile" value="${docfile}.gz" />
<tar destfile="${dist}/${docfile}"
basedir="${build}/api" />
<gzip zipfile="${dist}/${zipfile}" src="${dist}/${docfile}" />
<delete file="${dist}/${docfile}" />
</target>
<target name="parallelTasks" description="Run pdepend, phpmd, phpcpd, phpcs, and phpdoc tasks on parallel threads">
<parallel>
<antcall target="pdepend" />
<antcall target="phpmd" />
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc" />
</parallel>
</target>
<target name="phpunit" description="Run unit tests on current plugin">
<exec executable="phpunit" failonerror="true" />
</target>
<target name="pdepend" depends="setup" description="Create PHP_Depend Static Code Analysis report">
<!--
This task runs PHP_Depend on your library. For more on usage, see the
PHP_Depend Documentation at http://pdepend.org/documentation/getting-started.html
-->
<exec executable="pdepend">
<arg line="--jdepend-xml=${build}/logs/jdepend.xml
--jdepend-chart=${build}/pdepend/dependencies.svg
--overview-pyramid=${build}/pdepend/overview-pyramid.svg
." />
</exec>
</target>
<target name="phpmd" depends="setup" description="Generate PHP Mess Detector report">
<!--
This task creates a report by running the PHP Mess Detector package
on the source. For more information on the configuration options
see http://phpmd.org/documentation/index.html
-->
<exec executable="phpmd">
<arg line="${basedir} html codesize,design,naming,unusedcode --reportfile ${build}/phpmd/index.html" />
</exec>
</target>
<target name="phpcpd" depends="setup" description="Generate a PHP Copy/Paste Detection report">
<!--
phpcpd is a light-weight detector of duplicate code. For more information
see the documentation at http://github.com/sebastianbergmann/phpcpd
-->
<exec executable="phpcpd">
<arg line="--log-pmd ${build}/logs/pmd-cpd.xml ${basedir}" />
</exec>
</target>
<target name="phpcs" depends="setup" description="Generate a PHP_CodeSniffer report for coding standards">
<!--
PHP_CodeSniffer detects violations of coding standards. See
http://pear.php.net/package/PHP_CodeSniffer/docs for usage.
-->
<exec executable="phpcs" output="/dev/null">
<arg line="--report=checkstyle
--extensions=php
--ignore=*/tests/*
--report-file=${build}/logs/checkstyle.xml
--standard=Zend
${basedir}" />
</exec>
</target>
<target name="phpdoc" depends="setup" description="Generate programming documentation with PHPDoc">
<!--
PHPDoc generates documentation for your project. See http://www.phpdoc.org for
configuration/usage examples.
To generate different outputs, try any (or all) of the following
-o HTML:frames:earthli,HTML:Smarty:PHP,HTML:frames:phphtmllib,HTML:frames:phpedit,PDF:default:default
-->
<exec executable="phpdoc">
<arg line="-o HTML:frames:earthli -d ${basedir} -t ${build}/api -i tests/,dist/,build/" />
</exec>
</target>
<target name="phpcb" depends="setup" description="Generate the PHPCodeBrowser report">
<!--
Visualize errors in your code from CodeSniffer and PhpUnit
see http://github.com/mayflowergmbh/PHP_CodeBrowser
-->
<exec executable="phpcb">
<arg line="--log ${build}/logs
--source ${basedir}
--output ${build}/code-browser" />
</exec>
</target>
<target name="build" depends="clean, setup, parallelTasks, phpunit, phpcb"
description="Builds the PHP reports" />
<target name="usage">
<echo message="Type ant -p to list all the targets available in this build script." />
</target>
</project>