-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
77 lines (66 loc) · 3.17 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="html-go" basedir="." default="minimum">
<property name="build.dir" value="${basedir}/build" />
<property name="sys.dir" value="${basedir}/system" />
<property name="src.dir" value="${sys.dir}/core" />
<property name="vendor.dir" value="${sys.dir}/vendor" />
<property name="vendor.bin.dir" value="${vendor.dir}/bin" />
<condition property="stdout" value="System.out" else="/dev/null">
<os family="windows" />
</condition>
<target name="prepare">
<mkdir dir="${build.dir}/logs" />
<delete dir="${basedir}/cache/indexes" />
<delete dir="${basedir}/content/user-data/@testuser" />
<delete dir="${basedir}/tests/test-data/cache/indexes" />
<delete file="${basedir}/tests/test-data/content/user-data/@testuser/posts/harvesting/regular/2021010100000__s.md" />
<delete file="${basedir}/tests/test-data/content/user-data/@testuser/posts/harvesting/regular/20210101000000_wibble.md" />
</target>
<target name="minimum" depends="prepare, php-lint, phpstan, phpcs, phpunit, cleanup">
<delete file="${basedir}/System.out" />
</target>
<target name="php-lint" description="Check for syntax errors">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${src.dir}">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phpcs" description="DEV: Code Sniff">
<exec executable="${vendor.bin.dir}/phpcs.bat" failonerror="false">
<arg value="--report-checkstyle" />
<arg value="--report-file=${build.dir}/logs/checkstyle.xml" />
<arg value="--standard=${build.dir}/phpcs.xml" />
<arg path="${src.dir}" />
</exec>
</target>
<target name="phpstan" description="DEV: PHP Static Analysis Tool">
<exec executable="${vendor.bin.dir}/phpstan.bat">
<arg value="analyse" />
<arg value="-c" />
<arg path="${build.dir}/phpstan.neon" />
<arg value="--memory-limit" />
<arg value="128M" />
</exec>
</target>
<target name="phpunit" description="Perform unit tests">
<exec executable="${vendor.bin.dir}/phpunit.bat" failonerror="true">
<env key="XDEBUG_MODE" value="coverage"/>
</exec>
</target>
<target name="tailwindcss" description="Tailwind CLI">
<exec executable="npx.cmd">
<arg line="tailwindcss -i ${build.dir}/styles.css -o ${basedir}/themes/twig/default/css/main.css"/>
</exec>
</target>
<target name="cleanup" description="Clean up cache">
<delete file="${basedir}/cache/installedVersion.json"/>
<!-- delete dir="${basedir}/cache/indexes" />
<delete dir="${basedir}/tests/test-data/cache/indexes" /-->
<delete file="${basedir}/tests/test-data/content/user-data/@testuser/posts/harvesting/regular/2021010100000__s.md" />
<delete file="${basedir}/tests/test-data/content/user-data/@testuser/posts/harvesting/regular/20210101000000_wibble.md" />
</target>
</project>