forked from aimeos/aimeos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
201 lines (169 loc) · 8.59 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0" encoding="UTF-8"?>
<project name="Aimeos" default="all">
<property name="coredir" value="${project.basedir}" override="false" />
<property name="extdir" value="${project.basedir}/ext" override="false" />
<property name="bindir" value="${project.basedir}/vendor/bin/" override="false" />
<target name="setup" description="Sets up database incl. unit test data">
<echo msg="Setting up test database" />
<exec command="php ${coredir}/setup.php unittest unittest" checkreturn="true" logoutput="true"/>
</target>
<target name="setupperf" description="Sets up database incl. performance test data">
<echo msg="Setting up performance data" />
<exec command="php ${coredir}/setup.php unitperf unitperf" checkreturn="true" logoutput="true"/>
</target>
<target name="coverage" description="Creates coverage reports">
<phing target="coverage" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="coverage" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="coverageext" description="Creates coverage report for specific extension directory">
<phing target="coverage" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="test" description="Executes unit tests">
<phing target="test" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="test" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="test" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="test" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="test" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="testext" description="Executes tests of specific extension directory">
<phing target="test" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="testperf" description="Executes performance tests">
<phing target="testperf" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="testperf" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="testperf" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="check" description="Executes all checks">
<property name="codestddir" value="${project.basedir}/misc/coding" override="true" />
<phing target="check" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="check" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="check" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="check" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="check" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="checkext" description="Executes checks of specific extension directory">
<property name="codestddir" value="${project.basedir}/misc/coding" override="true" />
<phing target="check" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="doc" description="Generates the documentation" depends="test">
<taskdef name="confdoc" classname="MShopConfigDocTask" classpath="${coredir}/misc/phing" />
<mkdir dir="${coredir}/misc/confdoc/" />
<echo msg="Generating config documentation" />
<confdoc keyprefix="controller/common" wikiprefix="Configuration/Core" keyparts="0"
optfile="${coredir}/controller/common/tests/confdoc.ser"
outfile="${coredir}/misc/confdoc/core-controller-common.wiki">
<fileset dir="${coredir}/controller/common/src" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
<confdoc keyprefix="madmin" wikiprefix="Configuration/Core" keyparts="1"
optfile="${coredir}/lib/mshoplib/tests/confdoc.ser"
outfile="${coredir}/misc/confdoc/core-madmin.wiki">
<fileset dir="${coredir}/lib/mshoplib/src/MAdmin" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
<confdoc keyprefix="mshop" wikiprefix="Configuration/Core" keyparts="1"
optfile="${coredir}/lib/mshoplib/tests/confdoc.ser"
outfile="${coredir}/misc/confdoc/core-mshop.wiki">
<fileset dir="${coredir}/lib/mshoplib/src/MShop" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
</target>
<target name="api" description="Generates the API documentation">
<delete dir="${coredir}/misc/apidoc" quiet="true" failonerror="false" />
<exec command="php ${coredir}/vendor/bin/apigen generate --template-theme=bootstrap
--title='Aimeos Core API documentation' --tree --no-source-code -d misc/apidoc
-s admin/jqadm/src/ -s client/html/src/ -s controller/common/src/
-s controller/frontend/src/ -s controller/jobs/src/ -s controller/jsonadm/src/
-s lib/mshoplib/src/ -s lib/mwlib/src/" checkreturn="true" logoutput="true"/>
</target>
<target name="clean" description="Cleans up temporary files">
<delete dir="${coredir}/misc/apidoc" quiet="true" failonerror="false" />
<phing target="clean" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="clean" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="clean" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="clean" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="clean" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="i18n" description="Creates all translation files">
<phing target="i18n" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="i18n" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="i18n" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="i18n" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="build" description="Creates all files to be generated" >
<exec command="tx pull -a -f" checkreturn="true" logoutput="true" />
<phing target="build" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="build" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="build" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="build" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="release" description="Creates new release" depends="build">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<exec command="git branch ${version}" checkreturn="true" logoutput="true" />
<exec command="git tag -a ${version}.1 -m 'Release ${version}.1'" checkreturn="true" logoutput="true" />
<exec command="git push origin ${version}" checkreturn="true" logoutput="true" />
<exec command="git push --tags" checkreturn="true" logoutput="true" />
</target>
<target name="releaseext" description="Creates new releases of the extensions">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<phing target="release">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<include name="**/phing.xml" />
</fileset>
</phing>
</target>
<target name="createext" description="Creates new extension">
<propertyprompt propertyName="extname" promptText="Enter extension name (only A-Z, a-z, 0-9 and -)" promptCharacter=":" useExistingValue="true"/>
<copy todir="${extdir}/${extname}" >
<fileset dir="${coredir}/misc/ext-template">
<exclude name="**/.gitkeep" />
<include name="**" />
</fileset>
</copy>
<reflexive>
<fileset dir="${extdir}/${extname}">
<include name="**" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<extname>" replace="${extname}"/>
</replaceregexp>
</filterchain>
</reflexive>
</target>
<target name="all" depends="setup,test,check" description="Executes all essential targets for testing" />
</project>