Makefile 3.84 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
update-qfq-doc: 
	rsync -av --delete --exclude=_make --exclude=_static extension/Documentation/ ../qfq-doc/Documentation/; \
	cd ../qfq-doc/; \
	git commit -a; \
	git push
36
	wget -O /dev/null https://docs.typo3.org/~mbless/github.com/T3DocumentationStarter/Public-Info-053.git.make/request_rebuild.php
37
	
38

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

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

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

Rafael Ostertag's avatar
Rafael Ostertag committed
53
54
55
56
57
58
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
59
nightly: basic build-dist
60
	cd $(DISTDIR); zip -r ../qfq_$(VERSION)_$(RELEASE_DATE).zip  $(EXTENSION_CONTENT) revision.git -x config.ini
Rafael Ostertag's avatar
Rafael Ostertag committed
61

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

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

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

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

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

bbaer's avatar
bbaer committed
81
basic: .npmpackages .virtual_env
bbaer's avatar
bbaer committed
82
83
	npm update
	grunt default
84
	cd extension/Resources/Private; composer update; cd vendor/phpoffice/phpspreadsheet; rm -rf .github bin docs samples .g* .s* .t* C* c* m* p*
85

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

90
91
92
93
94
.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
95
96
97
.support:
	mkdir -p support
	touch $@
98

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

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

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

111
.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
112

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