Makefile 3.57 KB
Newer Older
1
PKG_VERSION = $(shell awk '/version/ { print $$3 }' extension/ext_emconf.php  | sed "s/'//g")
2

3
NIGHTLY_DATE = $(shell date '+%Y%m%d')
4
RELEASE_DATE = $(shell date '+%Y%m%d%H%M')
5

6
7
GIT_REVISION_SHORT = $(shell git rev-parse --short HEAD || true)
GIT_REVISION_LONG = $(shell git rev-parse HEAD || true)
8

9
EXTENSION_CONTENT = Classes Configuration Documentation qfq Resources ext_emconf.php ext_localconf.php ext_tables.php ext_icon.png ext_conf_template.txt config.qfq.example.php RELEASE.txt
10

Rafael Ostertag's avatar
Rafael Ostertag committed
11
DISTDIR=dist
12

13
14
15
# Use by jenkins to separate temp directories used by pip in order to allow concurrent builds
PIP_TMP ?= /tmp

Carsten  Rose's avatar
Carsten Rose committed
16
all: archive t3sphinx
17

Rafael Ostertag's avatar
Rafael Ostertag committed
18
maintainer-clean:
bbaer's avatar
bbaer committed
19
20
	rm -f .doc_plantuml .npmpackages .phpdocinstall .plantuml_install .support .support_plantuml
	rm -rf doc/jsdoc doc/phpdoc doc/plantuml support node_modules .python_virtualenv build-dist
Rafael Ostertag's avatar
Rafael Ostertag committed
21

22
archive: clean qfq.zip
Rafael Ostertag's avatar
Rafael Ostertag committed
23

24
qfq.zip:
25
	cd extension/Resources/Private/vendor/phpoffice; rm -rf phpspreadsheet/{C*,bin,c*,d*,m*,p*,sa*,.g*,.p*,.s*,.t*}
26
	cd extension; zip -r ../$@ $(EXTENSION_CONTENT)
27
	
Rafael Ostertag's avatar
Rafael Ostertag committed
28
clean:
29
	cd doc/diagram ; $(MAKE) $@
Rafael Ostertag's avatar
Rafael Ostertag committed
30

31
32
33
34
35
36
update-qfq-doc: 
	rsync -av --delete --exclude=_make --exclude=_static extension/Documentation/ ../qfq-doc/Documentation/; \
	cd ../qfq-doc/; \
	git commit -a; \
	git push
	
37

Rafael Ostertag's avatar
Rafael Ostertag committed
38
git-revision: make-dist-dir
Rafael Ostertag's avatar
Rafael Ostertag committed
39
	echo $(GIT_REVISION_LONG) > $(DISTDIR)/revision.git
40

Rafael Ostertag's avatar
Rafael Ostertag committed
41
make-dist-dir:
Rafael Ostertag's avatar
Rafael Ostertag committed
42
43
44
45
46
47
48
49
	rm -rf $(DISTDIR)/
	mkdir $(DISTDIR)

dist-move-doc:
	cd $(DISTDIR) ; \
	mkdir Documentation.tmp ;\
	mv Documentation/_make/build/html Documentation.tmp ;\
	rm -rf Documentation ; \
50
51
	mv Documentation.tmp Documentation

Rafael Ostertag's avatar
Rafael Ostertag committed
52
53
54
55
56
57
dist-copy-extension:
	cd extension ; cp -R $(EXTENSION_CONTENT) ../$(DISTDIR)/

build-dist: t3sphinx make-dist-dir dist-copy-extension dist-move-doc git-revision
	echo "Distribution made in $(DIST)"

bbaer's avatar
bbaer committed
58
nightly: basic build-dist
59
	cd $(DISTDIR); zip -r ../qfq_$(VERSION)_$(RELEASE_DATE).zip  $(EXTENSION_CONTENT) revision.git -x config.ini
Rafael Ostertag's avatar
Rafael Ostertag committed
60

bbaer's avatar
bbaer committed
61
snapshot: basic build-dist
62
	cd $(DISTDIR) ; zip -r ../qfq_$(VERSION)_$(RELEASE_DATE).zip $(EXTENSION_CONTENT) revision.git -x config.ini
63

bbaer's avatar
bbaer committed
64
release: basic build-dist
Rafael Ostertag's avatar
Rafael Ostertag committed
65
	if [ -z "$(VERSION)" ] ; then  echo "Set VERSION make variable to the release version (fmt: maj.min.micro)" ; exit 1 ; fi
66
	cd $(DISTDIR) ; zip -r "../qfq_$(VERSION)_$(RELEASE_DATE).zip" $(EXTENSION_CONTENT) revision.git -x config.ini
67

68
69
t3sphinx: .virtual_env
	. .python_virtualenv/bin/activate ; cd extension/Documentation/_make; make html
70

71
72
plantuml:
	cd doc/diagram ; $(MAKE)
73

bbaer's avatar
bbaer committed
74
bootstrap: .npmpackages .plantuml_install .virtual_env
75
	npm update
76
	grunt default
77
	composer update
78
	cd extension/Resources/Private; composer update
79

bbaer's avatar
bbaer committed
80
basic: .npmpackages .virtual_env
bbaer's avatar
bbaer committed
81
82
	npm update
	grunt default
83

84
.plantuml_install: .support_plantuml
85
	wget --no-check-certificate -O support/plantuml/plantuml.jar 'https://downloads.sourceforge.net/project/plantuml/plantuml.jar'
86
87
	touch $@

88
89
90
91
92
.npmpackages: package.json
	npm ls -g grunt-cli 2>/dev/null || { echo "Please install grunt-cli npm package using 'npm install -g grunt-cli'" 1>&2 ; exit 1; }
	npm install
	touch $@

Rafael Ostertag's avatar
Rafael Ostertag committed
93
94
95
.support:
	mkdir -p support
	touch $@
96

Rafael Ostertag's avatar
Rafael Ostertag committed
97
98
99
.support_plantuml: .support
	mkdir -p support/plantuml
	touch $@
100

101
.virtual_env: pip-temp-directory
102
	virtualenv .python_virtualenv
103
	. .python_virtualenv/bin/activate ; TMPDIR="$(PIP_TMP)" pip install --upgrade sphinx==1.5.5
104
105
	touch $@

106
107
108
pip-temp-directory:
	test -d "$(PIP_TMP)" || mkdir -p "$(PIP_TMP)"

109
.PHONY: nightly maintainer-clean snapshot release git-revision t3sphinx build-dist make-dist-dir dist-move-doc dist-copy-extension pip-temp-directory plantuml sonar
110

Carsten  Rose's avatar
Carsten Rose committed
111
copyReleaseNotes:
112
113
114
	cp extension/Documentation/Release.rst extension/RELEASE.txt
	cp extension/Documentation/Release.rst CHANGELOG.md