|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 | 2 |
|
3 | 3 | <project name="php_lib" default="build">
|
4 |
| - <target name="build" depends="clean,prepare,lint,phploc,code_sniff,phpcpd,pdepend,doxygen,phpcb,test" /> |
| 4 | + <target name="build" depends="clean,prepare,php-eval,lint,phploc,code_sniff,phpcpd,pdepend,doxygen,phpcb,test,cc-process,cc-export" /> |
5 | 5 |
|
6 | 6 | <target name="clean" description="Cleanup build artifacts">
|
7 | 7 | <delete dir="${basedir}/build/test" />
|
8 | 8 | <delete dir="${basedir}/build/logs" />
|
9 | 9 | <delete dir="${basedir}/build/pdepend" />
|
10 | 10 | <delete dir="${basedir}/build/api" />
|
11 | 11 | <delete dir="${basedir}/build/code-browser" />
|
| 12 | + <delete dir="${basedir}/build/code_coverage" /> |
12 | 13 | </target>
|
13 | 14 |
|
14 | 15 | <target name="prepare" description="Prepares workspace for artifacts" >
|
|
17 | 18 | <mkdir dir="${basedir}/build/pdepend" />
|
18 | 19 | <mkdir dir="${basedir}/build/api" />
|
19 | 20 | <mkdir dir="${basedir}/build/code-browser" />
|
| 21 | + <mkdir dir="${basedir}/build/code_coverage" /> |
| 22 | + </target> |
| 23 | + |
| 24 | + <target name="php-eval" description="Use php-eval to set the code_coverage_filter_files variable"> |
| 25 | + <exec executable="drush"> |
| 26 | + <arg line="php-eval "variable_set('code_coverage_files', array('sites/all/modules/php_lib/php_lib.module', 'sites/all/modules/php_lib/All.inc', 'sites/all/modules/php_lib/Array.inc', 'sites/all/modules/php_lib/Backtrace.inc', 'sites/all/modules/php_lib/DOMHelpers.inc', 'sites/all/modules/php_lib/DrupalFormHelpers.inc', 'sites/all/modules/php_lib/Enum.inc', 'sites/all/modules/php_lib/File.inc', 'sites/all/modules/php_lib/LazyMembers.inc', 'sites/all/modules/php_lib/Members.inc', 'sites/all/modules/php_lib/Misc.inc', 'sites/all/modules/php_lib/PackedArray.inc', 'sites/all/modules/php_lib/ReadOnlyMembers.inc', 'sites/all/modules/php_lib/ReadOnlyPrivateMembers.inc', 'sites/all/modules/php_lib/ReadOnlyProtectedMembers.inc', 'sites/all/modules/php_lib/ReflectionHelpers.inc', 'sites/all/modules/php_lib/String.inc', 'sites/all/modules/php_lib/xml/EACCPFDocument.inc', 'sites/all/modules/php_lib/xml/XMLDocument.inc')); variable_set('code_coverage_modules', array());""/> |
| 27 | + </exec> |
20 | 28 | </target>
|
21 | 29 |
|
22 | 30 | <target name="lint" description="Perform syntax check of sourcecode files">
|
|
81 | 89 | <arg line='-c "php ../../../../scripts/run-tests.sh --xml ${basedir}/build/test PHP\ Lib"' />
|
82 | 90 | </exec>
|
83 | 91 | </target>
|
| 92 | + |
| 93 | + <target name="cc-process" description="Processes the code coverage output so it can be exported"> |
| 94 | + <exec executable="drush"> |
| 95 | + <arg line="cc-process all"/> |
| 96 | + </exec> |
| 97 | + </target> |
| 98 | + |
| 99 | + <target name="cc-export" description="Generate a code coverage report for the simpletest run"> |
| 100 | + <exec executable="drush"> |
| 101 | + <arg line="cc-export latest --html --csv --tag-html --generate-index --path=${basedir}/build/code_coverage"/> |
| 102 | + </exec> |
| 103 | + </target> |
84 | 104 |
|
85 | 105 | </project>
|
0 commit comments