-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tactics
committed
Aug 29, 2017
1 parent
fd4b73e
commit e1ec7ce
Showing
3 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0"?> | ||
<project name="openxbl/openxbl" default="all"> | ||
<property name="base" value="${project.basedir}/" /> | ||
<property environment="env" /> | ||
|
||
<if> | ||
<available file="${base}build.properties" property="" /> | ||
<then> | ||
<property file="${base}build.properties" override="true" /> | ||
</then> | ||
</if> | ||
|
||
<!--##########################################################################################################--> | ||
<target name="help"> | ||
<echo message="${phing.project.name} on [${git.branch}]" /> | ||
<echo message=" Available commands are:" /> | ||
<echo message=" test -> Run unit tests" /> | ||
<echo message=" clean -> Clean current environment" /> | ||
<echo message=" server -> Launch PHP built-in server" /> | ||
<echo message=" watch -> Run precommit task on every file changed" /> | ||
<echo message=" precommit -> Source code validation before commit" /> | ||
<echo message=" Specific tools tasks:" /> | ||
<echo message=" phpcs -> Run PHP Code Sniffer" /> | ||
<echo message=" phplint -> Run PHP Lint" /> | ||
<echo message=" phpdocs -> Run PHP Documentor" /> | ||
<echo message=" phpunit -> Run PHPUnit" /> | ||
</target> | ||
<!--##########################################################################################################--> | ||
<target name="test" description="Run unit tests"> | ||
<phingcall target="phpunit" /> | ||
</target> | ||
<target name="clean" description="Clean current environment"> | ||
<delete dir="docs" includeemptydirs="true" verbose="true" failonerror="true" /> | ||
</target> | ||
<target name="precommit" description="Source code validation before commit"> | ||
<phingcall target="phplint" /> | ||
<phingcall target="phpcs" /> | ||
<phingcall target="phpunit" /> | ||
</target> | ||
<target name="all" description="Make a full integration check"> | ||
<phingcall target="phplint" /> | ||
<phingcall target="phpcs" /> | ||
<phingcall target="phpunit" /> | ||
<phingcall target="phpdocs" /> | ||
</target> | ||
<!--##########################################################################################################--> | ||
<target name="phpcs" description="Run PHP Code Sniffer"> | ||
<phpcodesniffer | ||
standard="PSR2" | ||
format="summary" | ||
> | ||
<fileset dir="."> | ||
<include name="src/**/*.php"/> | ||
<include name="test/**/*.php"/> | ||
</fileset> | ||
</phpcodesniffer> | ||
</target> | ||
<target name="phpcbf" description="Run PHP Code Sniffer"> | ||
<exec command="vendor/bin/phpcbf --standard=PSR2 src" logoutput="true" /> | ||
</target> | ||
<target name="phplint" description="Run PHP Lint"> | ||
<phplint deprecatedAsError="true"> | ||
<fileset dir="."> | ||
<include name="src/**/*.php"/> | ||
<include name="test/**/*.php"/> | ||
</fileset> | ||
</phplint> | ||
</target> | ||
<target name="phpdocs" description="Run PHP Documentor" depends="clean"> | ||
<if> | ||
<not><available file="docs" /></not> | ||
<then> | ||
<mkdir dir="docs" /> | ||
</then> | ||
</if> | ||
|
||
<phpdoc2 destdir="docs"> | ||
<fileset dir="src"> | ||
<include name="**/*.php" /> | ||
</fileset> | ||
</phpdoc2> | ||
</target> | ||
<target name="phpunit" description="Run PHPUnit"> | ||
<if> | ||
<and> | ||
<isset property="only.units" /> | ||
<equals arg1="${only.units}" arg2="true" /> | ||
</and> | ||
<then> | ||
<fileset dir="tests" id="tests"> | ||
<include name="ApiTest.php"/> | ||
</fileset> | ||
</then> | ||
<else> | ||
<fileset dir="tests" id="tests"> | ||
<include name="**/*.php"/> | ||
</fileset> | ||
</else> | ||
</if> | ||
|
||
<phpunit | ||
haltonfailure="true" | ||
haltonerror="true" | ||
bootstrap="tests/bootstrap.php" | ||
printsummary="true" | ||
> | ||
<formatter type="plain" usefile="false"/> | ||
<batchtest> | ||
<fileset refid="tests" /> | ||
</batchtest> | ||
</phpunit> | ||
</target> | ||
<!--##########################################################################################################--> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit colors="true" bootstrap="tests/bootstrap.php"> | ||
<testsuites> | ||
<testsuite name="OpenXBL Wrapper"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="API_KEY" value=""/> | ||
</php> | ||
<filter> | ||
<whitelist> | ||
<directory>src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
# Copyright (c) xTACTICSx | ||
# OpenXBL, https://xbl.io | ||
# | ||
# OpenXBL is an unofficial Xbox Live API that provides | ||
# user-friendly documentation, support and examples. | ||
# | ||
# | ||
require __DIR__ . '/../vendor/autoload.php'; |