This repository was archived by the owner on Apr 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.build.xml
More file actions
89 lines (78 loc) · 3.45 KB
/
.build.xml
File metadata and controls
89 lines (78 loc) · 3.45 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
<!--
~ Part of the Codex Project packages.
~
~ License and copyright information bundled with this package in the LICENSE file.
~
~ @author Robin Radic
~ @copyright Copyright 2016 (c) Codex Project
~ @license http://codex-project.ninja/license The MIT License
-->
<project name="codex-core" default="pre-commit">
<property name="buildfile-version" value="1.0.0"/>
<property name="phpdocfile" value="${project.basedir}/docs/structure.xml"/>
<target name="clean" unless="clean.done" description="Cleanup build artifacts">
<delete dir="${project.basedir}/vendor"/>
<delete file="${project.basedir}/composer.lock"/>
<property name="clean.done" value="true"/>
</target>
<target name="pre-commit" unless="pre-commit.done" depends="clean" description="Prepare for build">
<phingcall target="lint"/>
<phingcall target="phpcs"/>
<phingcall target="phpdoc"/>
<phingcall target="theme"/>
<property name="pre-commit.done" value="true"/>
</target>
<target name="post-commit">
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${project.basedir}/src">
<include name="**/*.php"/>
</fileset>
</apply>
</target>
<target name="phpcbf" description="Fixes coding standard violations using PHP_CodeSniffer Fixer">
<exec executable="phpcbf" logoutput="true" passthru="true">
<arg value="--tabWidth=4"/>
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg value="--ignore=autoload.php"/>
<arg path="${project.basedir}/src"/>
</exec>
</target>
<target name="phpcs" depends="phpcbf" description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs" logoutput="true" passthru="true">
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg value="--ignore=autoload.php"/>
<arg path="${project.basedir}/src"/>
</exec>
</target>
<target name="phpdoc" description="Generate phpdoc structure xml and move into docs folder">
<exec executable="phpdoc" dir="${project.basedir}" logoutput="true" passthru="true">
<arg line="-t phpdoc"/>
<arg line="-d src"/>
<arg line="--template=xml"/>
</exec>
</target>
<target name="theme-clean" description="clean the theme files">
<delete dir="${project.basedir}/resources/assets"/>
<delete dir="${project.basedir}/node_modules"/>
</target>
<target name="theme-install" description="install the theme node module">
<exec command="npm install" dir="${project.basedir}" logoutput="true" passthru="true"/>
</target>
<target name="theme-copy" description="copy the theme distribution files to assets">
<copy todir="${project.basedir}/resources/assets">
<fileset dir="${project.basedir}/node_modules/codex-theme/dist/assets">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="theme">
<phingcall target="theme-clean"/>
<phingcall target="theme-install"/>
<phingcall target="theme-copy"/>
</target>
</project>