-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
123 lines (99 loc) · 4.04 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?xml version="1.0" encoding="UTF-8"?>
<project name="Enlighter" default="devcopy" basedir=".">
<!-- ANT-contrib !-->
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<target name="full" depends="dist"/>
<!-- "Compile" po language support files !-->
<target name="languages">
<apply executable="msgfmt" dest="lang" parallel="false">
<srcfile/>
<arg value="-o"/>
<targetfile/>
<fileset dir="lang" includes="*.po"/>
<mapper type="glob" from="*.po" to="*.mo"/>
</apply>
</target>
<!-- beta releases as tar archive !-->
<target name="beta" depends="dist">
<tar destfile=".hidden/enlighter-beta.tar" basedir="dist/"/>
</target>
<!-- Static Code Check !-->
<target name="lint">
<apply executable="php">
<arg value="-l"/>
<fileset dir="." includes="**/*.php" excludes="util/** .wpcontent/**"/>
</apply>
</target>
<!-- run plugin within wordpress wpdev container !-->
<target name="dev" depends="dist">
<!-- Credentials, Host Settings !-->
<loadproperties srcFile=".credentials/wordpress.conf" prefix="WP"/>
<!-- Build Docker Image !-->
<exec executable="podman" failonerror="true">
<arg line="build -t enlighter-test -f Dockerfile ."/>
</exec>
<!-- Run Webserver !-->
<exec executable="podman" failonerror="true">
<arg line="run --name enlighter-test -p 8080:8080 --rm -e WP_DSN=${WP.DSN} -i -v ${basedir}/.wpcontent/themes:/srv/app/public/wp-content/themes enlighter-test"/>
</exec>
</target>
<!-- run plugin within wordpress wpdev container !-->
<target name="dev-mu" depends="dist">
<!-- Credentials, Host Settings !-->
<loadproperties srcFile=".credentials/wordpress-mu.conf" prefix="WP"/>
<!-- Build Docker Image !-->
<exec executable="podman" failonerror="true">
<arg line="build -t enlighter-test -f Dockerfile ."/>
</exec>
<!-- Run Webserver !-->
<exec executable="podman" failonerror="true">
<arg line="run --name enlighter-test -p 8080:8080 --rm -e WP_MU=on -e WP_DSN=${WP.DSN} -i -v ${basedir}/.wpcontent/themes:/srv/app/public/wp-content/themes enlighter-test"/>
</exec>
</target>
<!-- Dist clean !-->
<target name="dist-cleanup">
<!-- cleanup !-->
<delete dir="dist"/>
<mkdir dir="dist"/>
</target>
<!-- Create Dist copy !-->
<target name="dist" depends="dist-cleanup">
<!-- Copy Plugin !-->
<copy todir="dist">
<fileset dir=".">
<include name="cache/**" />
<include name="modules/**" />
<include name="lang/**" />
<include name="resources/**" />
<include name="views/**" />
<include name="Enlighter.php" />
<include name="LICENSE.txt" />
<include name="readme.txt" />
</fileset>
</copy>
</target>
<!-- WP Release Copy !-->
<target name="wp-release" depends="dist">
<input message="Enter release version" addproperty="release.version"/>
<!-- Set Tag path !-->
<property name="svn.tag.path" value="../svn/tags/${release.version}" />
<property name="svn.trunk.path" value="../svn/trunk" />
<if>
<available file="${svn.tag.path}" type="dir"/>
<then>
<fail message="SVN Tag ${release.version} already exists!"/>
</then>
<else>
<echo message="Creating new SVN Tag"/>
<!-- Create Tag !-->
<mkdir dir="${svn.tag.path}"/>
<!-- Copy Tag !-->
<copy todir="${svn.tag.path}">
<fileset dir="dist"/>
</copy>
<!-- copy readme to trunk !-->
<copy file="readme.txt" todir="${svn.trunk.path}" />
</else>
</if>
</target>
</project>