This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
154 lines (127 loc) · 4.95 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
PHPUNIT = ./vendor/bin/phpunit
PHPCS = ./vendor/bin/phpcs
PHPCBF = ./vendor/bin/phpcbf
# Get calid composer executable
COMPOSER = $(shell which composer)
ifeq ($(findstring composer, $(COMPOSER)), )
COMPOSER = $(shell which composer.phar)
ifeq ($(findstring composer.phar, $(COMPOSER)), )
ifneq ($(wildcard composer.phar), )
COMPOSER = php composer.phar
else
COMPOSER =
endif
endif
endif
default:
@echo "Typical targets your could want to reach:"
@echo ""
@echo "--> make deploy ............... Install OntoWiki <-- in doubt, use this"
@echo " make install .............. deploy and install are equivalent"
@echo ""
@echo " make help ................. Show more (developer related) make targets"
@echo ""
@echo " make help-cs .............. Show help for code sniffing targets"
@echo ""
@echo " make help-test ............ Show help for test related targets"
help:
@echo "Please use: (e.g. make deploy)"
@echo " deploy ..................... Runs everything which is needed for a deployment"
@echo " install .................... Equivalent to deploy"
@echo " help ....................... This help screen"
@echo " help-cs .................... Show help for code sniffing targets"
@echo " help-test .................. Show help for test related targets"
@echo " -------------------------------------------------------------------"
@echo " directories ................ Create cache/log dir and chmod environment"
@echo " clean ...................... Deletes all log and cache files"
@echo " odbctest ................... Executes some tests to check the Virtuoso connection"
help-cs:
@echo "Please use: (e.g. make codesniffer)"
@echo " codesniffer ............................ Run CodeSniffer except for the FileCommentSniff"
@echo " codesniffer_year ....................... Run CodeSniffer including the FileCommentSniff"
@echo " codebeautifier ......................... Run CodeBeautifier"
help-test:
@echo " test ......................... Execute unit, integration and extension tests"
@echo " test-unit .................... Run OntoWiki unit tests"
@echo " test-integration-virtuoso .... Run OntoWiki integration tests with virtuoso"
@echo " test-integration-mysql ....... Run OntoWiki integration tests with mysql"
@echo " test-extensions .............. Run tests for extensions"
getcomposer:
curl -o composer.phar "https://getcomposer.org/composer.phar"
php composer.phar self-update
install: deploy
ifdef COMPOSER
deploy: directories clean composer-install
else
deploy: getcomposer
make deploy
endif
clean:
rm -rf cache/* logs/* libraries/*
directories: clean
mkdir -p logs cache
chmod 777 logs cache extensions
ifdef COMPOSER
composer-install: #add difference for user and dev (with phpunit etc and without)
$(COMPOSER) install
else
composer-install:
@echo
@echo
@echo "!!! make $@ failed !!!"
@echo
@echo "Sorry, there doesn't seem to be a PHP composer (dependency manager for PHP) on your system!"
@echo "Please have a look at http://getcomposer.org/ for further information,"
@echo "or just run 'make getcomposer' to download the composer locally"
@echo "and run 'make $@' again"
endif
# test stuff
devenv:
git clone "https://github.com/pfrischmuth/ontowiki-devenv.git" devenv
cp -i devenv/config.ini.dist ./config.ini
cp -i devenv/config-test.ini.dist ./application/tests/config.ini
test-directories:
rm -rf application/tests/cache application/tests/unit/cache application/tests/integration/cache
mkdir -p application/tests/cache application/tests/unit/cache application/tests/integration/cache
test-unit: test-directories
$(PHPUNIT) --testsuite "OntoWiki Unit Tests"
test-integration-virtuoso: test-directories
EF_STORE_ADAPTER=virtuoso $(PHPUNIT) --testsuite "OntoWiki Virtuoso Integration Tests"
test-integration-mysql: test-directories
EF_STORE_ADAPTER=zenddb $(PHPUNIT) --testsuite "OntoWiki Virtuoso Integration Tests"
test-extensions: #directories
$(PHPUNIT) --testsuite "OntoWiki Extensions Tests"
test:
make test-unit
@echo ""
@echo "-----------------------------------"
@echo ""
make test-integration-virtuoso
@echo ""
@echo "-----------------------------------"
@echo ""
make test-integration-mysql
@echo ""
@echo "-----------------------------------"
@echo ""
make test-extensions
odbctest:
@application/scripts/odbctest.php
# 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-1.9.1.js
rm libraries/RDFauthor/libraries/jquery.js
rm Makefile
@echo "now do: cp -R application/scripts/debian debian"
# #### config ####
codesniffer:
$(PHPCS) -p
codebeautifier:
$(PHPCBF)
# other stuff
list-events:
@grep -R "new Erfurt_Event" * 2> /dev/null | sed "s/.*new Erfurt_Event('//;s/');.*//" | sort -u