|
4 | 4 | <property name="apiv2source" value="src" /> |
5 | 5 | <property name="basedir" value="."/> |
6 | 6 |
|
| 7 | +<target name="initialize" description="Do Some initial setup."> |
| 8 | + <exec command="wget https://raw.githubusercontent.com/composer/getcomposer.org/cb19f2aa3aeaa2006c0cd69a7ef011eb31463067/web/installer -O - -q | php -- --quiet" logoutput="true" checkreturn="true" /> |
| 9 | + <exec command="sudo mv composer.phar /usr/bin/composer"/> |
| 10 | + <exec command="composer install"/> |
| 11 | +</target> |
| 12 | + |
| 13 | + |
7 | 14 | <target name="clean" description="Clean up and create artifact directories"> |
8 | 15 | <delete dir="${basedir}/build/api"/> |
9 | 16 | <delete dir="${basedir}/build/coverage"/> |
|
18 | 25 | </target> |
19 | 26 |
|
20 | 27 | <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml"> |
21 | | - <exec command="phpunit -c tests/phpunit.xml" logoutput="true" checkreturn="true" /> |
| 28 | + <exec command="composer test" logoutput="true" checkreturn="true" /> |
22 | 29 | </target> |
23 | 30 |
|
24 | 31 | <target name="buildTasks" description="Run the phpmd, phpcs, phploc and lint tasks."> |
25 | 32 | <phingcall target="phpcs"/> |
26 | | - <phingcall target="phplint"/> |
| 33 | + <phingcall target="lint"/> |
27 | 34 | </target> |
28 | 35 |
|
29 | 36 | <target name="frisby" description="Run API tests in Frisby"> |
|
39 | 46 | </target> |
40 | 47 |
|
41 | 48 | <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer"> |
42 | | - <phpcodesniffer standard="tools/codesniffer/JoindInPSR2/" verbosity="0" haltonerror="true" haltonwarning="true"> |
43 | | - <fileset dir="${apiv2source}"> |
44 | | - <patternset> |
45 | | - <include name="**/*.php"/> |
46 | | - <exclude name="**/config.php" /> |
47 | | - <exclude name="**/database.php" /> |
48 | | - </patternset> |
49 | | - </fileset> |
50 | | - <formatter type="checkstyle" outfile="${basedir}/build/logs/checkstyle.xml" /> |
51 | | - </phpcodesniffer> |
| 49 | + <exec command="composer sniff"/> |
52 | 50 | </target> |
53 | 51 |
|
54 | 52 | <target name="phpcs-human-summary" description="Generate human-readable Codesniffer output"> |
|
77 | 75 | </phpcodesniffer> |
78 | 76 | </target> |
79 | 77 |
|
80 | | - <target name="phplint" description="Run php -l over the fileset"> |
81 | | - <phplint haltonfailure="true"> |
82 | | - <fileset dir="${apiv2source}"> |
83 | | - <patternset> |
84 | | - <include name="**/*.php"/> |
85 | | - </patternset> |
86 | | - </fileset> |
87 | | - </phplint> |
| 78 | + <target name="lint" description="Run linter over the fileset"> |
| 79 | + <exec command="composer lint" logoutput="true" checkreturn="true" /> |
88 | 80 | </target> |
89 | 81 |
|
90 | | - <target name="build" depends="clean,buildTasks,phpunit"/> |
| 82 | + <target name="build" depends="initialize,clean,buildTasks,phpunit"/> |
91 | 83 |
|
92 | 84 | <target name="launch"> |
93 | 85 | <exec command="scripts/jenkinslaunch.sh" checkreturn="true" logoutput="true" /> |
|
0 commit comments