Index: trunk/extensions/UsabilityInitiative/Makefile |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | # |
3 | 3 | # Handy makefile to combine and minify css and javascript files |
4 | 4 | # |
| 5 | +SHELL := /bin/bash |
5 | 6 | |
6 | 7 | CSS := \ |
7 | 8 | css/suggestions.css\ |
— | — | @@ -57,15 +58,31 @@ |
58 | 59 | Vector/Modules/FooterCleanup/FooterCleanup.js\ |
59 | 60 | Vector/Modules/SimpleSearch/SimpleSearch.js |
60 | 61 | |
61 | | -all: \ |
| 62 | +USABILITYINITIATIVE_HOOKS := \ |
62 | 63 | css/combined.css\ |
63 | 64 | css/combined.min.css\ |
| 65 | + $(CSS)\ |
64 | 66 | js/plugins.combined.js\ |
65 | 67 | js/plugins.combined.min.js\ |
| 68 | + $(PLUGINS) |
| 69 | + |
| 70 | +WIKIEDITOR_HOOKS := \ |
| 71 | + $(WIKIEDITOR_MODULES)\ |
66 | 72 | WikiEditor/WikiEditor.combined.js\ |
67 | | - WikiEditor/WikiEditor.combined.min.js\ |
| 73 | + WikiEditor/WikiEditor.combined.min.js |
| 74 | + |
| 75 | +VECTOR_HOOKS := \ |
| 76 | + $(VECTOR_MODULES)\ |
68 | 77 | Vector/Vector.combined.js\ |
69 | 78 | Vector/Vector.combined.min.js |
| 79 | + |
| 80 | +all: \ |
| 81 | + $(USABILITYINITIATIVE_HOOKS)\ |
| 82 | + $(WIKIEDITOR_HOOKS)\ |
| 83 | + UsabilityInitiative.hooks.php\ |
| 84 | + WikiEditor/WikiEditor.hooks.php\ |
| 85 | + Vector/Vector.hooks.php\ |
| 86 | + |
70 | 87 | |
71 | 88 | # JavaScript Combination |
72 | 89 | |
— | — | @@ -108,6 +125,16 @@ |
109 | 126 | jsmin: |
110 | 127 | type -P jsmin &>/dev/null || ( wget http://www.crockford.com/javascript/jsmin.c; gcc jsmin.c -o jsmin ) |
111 | 128 | |
| 129 | +# Simple incrementer of versions |
| 130 | + |
| 131 | +UsabilityInitiative.hooks.php: $(USABILITYINITIATIVE_HOOKS) |
| 132 | +WikiEditor/WikiEditor.hooks.php: $(WIKIEDITOR_HOOKS) |
| 133 | +Vector/Vector.hooks.php: $(VECTOR_HOOKS) |
| 134 | + |
| 135 | +%.hooks.php: $(WIKIEDITOR_HOOKS) |
| 136 | + for file in $?; do basefile="$${file#$(shell echo $* | sed "s/\([^\/]*\/\).*/\\1/")}"; sed -i -e "s/\(.*'src' => '$${basefile//\//\\/}', 'version' => \)\([0-9+]*\)\(.*\)/\\1\\2+1\\3/" $@; \ |
| 137 | + for i in $$(grep --only-matching -P " ([0-9]+(\+[0-9]))+ " $@); do sed -i -e "s/ $$i / $$(bc <<< $$i) /" $@; done; done |
| 138 | + |
112 | 139 | # Actions |
113 | 140 | |
114 | 141 | distclean: clean |