forked from AKSW/OntoWiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
244 lines (199 loc) · 8.73 KB
/
Makefile
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
ZENDVERSION=1.11.5
default:
@echo "Typical targets you could want to reach:"
@echo ""
@echo "--> make deploy ............... Install OntoWiki <-- in doubt, use this"
@echo " (use this for server installations)"
@echo ""
@echo " make install .............. Install OntoWiki for developer"
@echo ""
@echo " make help ................. Show more (developer related) make targets"
@echo ""
@echo " make help-cs .............. Show code sniffing targets"
help:
@echo "Please use: (e.g. make deploy)"
@echo " deploy ..................... Runs everything which is needed for a deployment"
@echo " install .................... Make directories, zend and libraries"
@echo " directories ................ Create cache/log dir and chmod environment"
@echo " zend ....................... Download and install Zend under libraries"
@echo " libraries .................. 'git clone' all subrepos - in case submodules do not work"
@echo " erfurt ..................... Clone under libraries for development"
@echo " (you will need wwh github access for the module for this)"
@echo " rdfauthor .................. Clone under libraries for development"
@echo " (you will need ssh github access for the module for this)"
@echo " pull ....................... 'git pull' for all repos"
@echo " Keep in mind that you might have to incorporate changes"
@echo " from upstream using some variant of 'git pull upstream develop"
@echo " if you are working on a fork."
@echo " status ..................... 'git status' for all repos"
@echo " branch-check ............... 'git rev-parse' for all repos"
@echo " clean ...................... Deletes all log and cache files"
@echo " install-test-environment ... Install neccessary software (PHPUnit,...))"
@echo " test ....................... Executes OntoWiki's TestSuite"
@echo " test-erfurt ................ Executes Erfurts TestSuite"
@echo " test-extension ............. Executes TestSuites of each extension, if available"
@echo " test-all ................... Executes PHPUnit TestSuites (OW, Ext) and CodeSniffer"
help-cs:
@echo "Please use: (e.g. make cs-install)"
@echo " cs-install ............................ Install CodeSniffer"
@echo " cs-uninstall .......................... Uninstall CodeSniffer)"
@echo " cs-install-submodule MPATH=<path> ..... Install CodeSniffer on a submodule,"
@echo " <path> must by the relativ path to the submodule"
@echo " cs-uninstall-submodule MPATH=<path> ... Uninstall CodeSniffer on a submodule,"
@echo " <path> must by the relativ path to the submodule"
@echo " cs-enable ............................. Enable CodeSniffer to check code before every commit"
@echo " cs-disable ............................ Disable CodeSniffer code checking"
@echo " cs-check-commit ....................... Run pre-commit code checking manually"
@echo " cs-check-commit-emacs ................. Same as cs-check-commit with emacs output)"
@echo " cs-check-commit-intensive ............. Run pre-commit code checking"
@echo " manually with stricter coding standard"
@echo " cs-check .............................. Run complete code checking"
@echo " cs-check-full ......................... Run complete code checking with detailed output"
@echo " cs-check-emacs ........................ Run complete code checking with with emacs output"
@echo " cs-check-blame ........................ Run complete code checking with blame list output"
@echo " cs-check-intensive .................... Run complete code checking with"
@echo " stricter coding standard"
@echo " cs-check-intensive-full ............... Run complete code checking with"
@echo " stricter coding standard and detailed output"
@echo " possible Parameter:"
@echo " > FPATH=<path> ................. Run code checking on specific relative path"
@echo " > SNIFFS=<sniff 1>,<sniff 2> ... Run code checking on specific sniffs"
@echo " > OPTIONS=<option> ............. Run code checking with specific CodeSniffer options"
# top level target
deploy: directories clean zend
@echo
rm -rf libraries/RDFauthor
@echo 'Cloning RDFauthor into libraries/RDFauthor ...'
git clone git://github.com/AKSW/RDFauthor.git libraries/RDFauthor
rm -rf libraries/Erfurt
@echo 'Cloning Erfurt into libraries/Erfurt ...'
git clone git://github.com/AKSW/Erfurt.git libraries/Erfurt
install: directories libraries
clean:
rm -rf cache/* logs/*
directories: clean
mkdir -p logs cache
chmod 777 logs cache extensions
libraries: zend submodules
submodules:
git submodule init
git submodule update
# developer targets
pull:
git pull
git submodule foreach git pull
fetch:
git fetch
git submodule foreach git fetch
info:
@git --no-pager log -1 --oneline --decorate
@git submodule foreach git --no-pager log -1 --oneline --decorate
status:
git status -sb
git submodule foreach git status -sb
branch-check:
@git rev-parse --abbrev-ref HEAD
@git submodule foreach git rev-parse --abbrev-ref HEAD
# libraries
zend:
rm -rf libraries/Zend
curl -# -O http://framework.zend.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz || wget http://framework.zend.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz
tar xzf ZendFramework-${ZENDVERSION}-minimal.tar.gz
mv ZendFramework-${ZENDVERSION}-minimal/library/Zend libraries
rm -rf ZendFramework-${ZENDVERSION}-minimal.tar.gz ZendFramework-${ZENDVERSION}-minimal
rdfauthor:
rm -rf libraries/RDFauthor
@echo 'Cloning RDFauthor into libraries/RDFauthor ...'
git clone git://github.com:AKSW/RDFauthor.git libraries/RDFauthor
test:
phpunit
test-extensions:
phpunit --stderr extensions
test-all:
@make test
@echo ""
@echo "-----------------------------------"
@echo ""
@make test-extensions
@echo ""
@echo "-----------------------------------"
@echo ""
@make cs-check
install-test-environment:
sudo apt-get install php-pear
sudo pear config-set auto_discover 1
sudo pear channel-update pear.php.net
sudo pear upgrade pear
sudo pear install -a pear.phpunit.de/PHPUnit
sudo pear install phpunit/PHPUnit_Selenium
sudo pear install phpunit/DbUnit
erfurt:
rm -rf libraries/Erfurt
@echo 'Cloning Erfurt into libraries/Erfurt ...'
git clone git://github.com:AKSW/Erfurt.git libraries/Erfurt
test-erfurt:
cd libraries/Erfurt && phpunit && cd ../../..
# packaging
debianize:
rm extensions/markdown/parser/License.text
rm extensions/markdown/parser/PHP_Markdown_Readme.txt
rm extensions/markdown/parser/markdown.php
rm extensions/queries/resources/codemirror/LICENSE
rm extensions/themes/silverblue/scripts/libraries/jquery.js
rm libraries/RDFauthor/libraries/jquery.js
rm Makefile
@echo "now do: cp -R application/scripts/debian debian"
# coding standard
# #### config ####
# cs-script path
CSSPATH = application/tests/CodeSniffer/
# ignore pattern
IGNOREPATTERN = */libraries/*,pclzip.lib
# Parameter check
ifndef FPATH
FPATH = "./"
endif
ifdef SNIFFS
SNIFFSTR = "--sniffs="$(SNIFFS)
else
SNIFFSTR =
endif
REQUESTSTR = --ignore=$(IGNOREPATTERN) $(OPTIONS) $(SNIFFSTR) $(FPATH)
cs-default:
chmod ugo+x "$(CSSPATH)cs-scripts.sh"
cs-install: cs-default
$(CSSPATH)cs-scripts.sh -i
cs-install-submodule: cs-submodule-check cs-default
$(CSSPATH)cs-scripts.sh -f $(CSSPATH) -m $(MPATH)
cs-uninstall-submodule: cs-submodule-check cs-default
$(CSSPATH)cs-scripts.sh -n $(MPATH)
cs-uninstall: cs-default
$(CSSPATH)cs-scripts.sh -u
cs-enable: cs-default
$(CSSPATH)cs-scripts.sh -f $(CSSPATH) -e
cs-disable: cs-default
$(CSSPATH)cs-scripts.sh -d
cs-check-commit:
$(CSSPATH)cs-scripts.sh -p ""
cs-check-commit-emacs:
$(CSSPATH)cs-scripts.sh -p "-remacs"
cs-check-commit-intensive:
$(CSSPATH)cs-scripts.sh -p "-s"
cs-check:
$(CSSPATH)cs-scripts.sh -c "-s --report=summary $(REQUESTSTR)"
cs-check-intensive:
$(CSSPATH)cs-scripts.sh -s -c "-s --report=summary $(REQUESTSTR)"
cs-check-intensive-full:
$(CSSPATH)cs-scripts.sh -s -c "-s --report=full $(REQUESTSTR)"
cs-check-full:
$(CSSPATH)cs-scripts.sh -c "-s --report=full $(REQUESTSTR)"
cs-check-emacs:
$(CSSPATH)cs-scripts.sh -c "--report=emacs $(REQUESTSTR)"
cs-check-blame:
$(CSSPATH)cs-scripts.sh -s -c "--report=gitblame $(REQUESTSTR)"
cs-submodule-check:
ifndef MPATH
@echo "You must Set a path to the submodule."
@echo "Example: MPATH=path/to/the/submodule/"
@exit 1
endif