aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--[-rwxr-xr-x]Makefile213
1 files changed, 41 insertions, 172 deletions
diff --git a/Makefile b/Makefile
index cc002c540..a4ddad238 100755..100644
--- a/Makefile
+++ b/Makefile
@@ -1,186 +1,55 @@
-VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')
+src = lib background content_scripts pages popup
+ts = $(shell git ls-files $(src) | grep '\.tsx\?$$')
+poname = taler-wallet-webex
-define BANNER
-/*
- * SystemJS v$(VERSION)
- */
-endef
-export BANNER
+gulp = node_modules/gulp/bin/gulp.js
+tsc = node_modules/typescript/bin/tsc
+po2json = node_modules/po2json/bin/po2json
-define POLYFILLS_BANNER
-/*
- * SystemJS Promise Polyfill
- */
-endef
-export POLYFILLS_BANNER
+.PHONY: pogen i18n/strings.js
-define STANDARD_VERSION
+package-stable: tsc i18n
+ $(gulp) package-stable
-System.version = '$(VERSION) Standard';
-endef
-export STANDARD_VERSION
+package-unstable: tsc i18n
+ $(gulp) package-unstable
-define REGISTER_VERSION
+tsc: tsconfig.json
+ $(tsc)
-System.version = '$(VERSION) Register Only';
-endef
-export REGISTER_VERSION
+tsconfig.json: gulpfile.js
+ $(gulp) tsconfig
-define CSP_VERSION
+i18n: pogen msgmerge i18n/strings.js
-System.version = '$(VERSION) CSP';
-endef
-export CSP_VERSION
+pogen/pogen.js: pogen/pogen.ts pogen/tsconfig.json
+ cd pogen; ../$(tsc)
-compile: clean-compile dist/system.src.js dist/system.perf.js dist/system-csp-production.src.js dist/system-register-only.src.js
-build: clean dist/system.js dist/system-csp-production.js dist/system-register-only.js dist/system-polyfills.js
+pogen: $(ts) pogen/pogen.js
+ find $(src) \( -name '*.ts' -or -name '*.tsx' \) ! -name '*.d.ts' \
+ | xargs node pogen/pogen.js \
+ | msguniq \
+ | msgmerge i18n/poheader - \
+ > i18n/$(poname).pot
-version:
- @echo $(VERSION)
+msgmerge:
+ @for pofile in i18n/*.po; do \
+ echo merging $$pofile; \
+ msgmerge -o $$pofile $$pofile i18n/$(poname).pot; \
+ done; \
-footprint: build
- @cat dist/system.js | gzip -9f | wc -c
- @cat dist/system-csp-production.js | gzip -9f | wc -c
- @cat dist/system-register-only.js | gzip -9f | wc -c
- @cat dist/system-polyfills.js | gzip -9f | wc -c
+dist:
+ $(gulp) srcdist
-clean-compile:
- @rm -f dist/system.src.js dist/system.perf.js dist/system-csp-production.src.js
+appdist:
+ $(gulp) appdist
-clean:
- @rm -f dist/*
+i18n/strings.js: # $(ts)
+ cp i18n/strings-prelude.js i18n/strings.js
+ for pofile in i18n/*.po; do \
+ b=`basename $$pofile`; \
+ lang=$${b%%.po}; \
+ $(po2json) -F -f jed1.x -d $$lang $$pofile $$pofile.json; \
+ (echo -n "i18n.strings['$$lang'] = "; cat $$pofile.json; echo ';') >> $@; \
+ done
-test: compile
- open test/test-traceur.html test/test-traceur-runtime.html
- sleep 0.1
- open test/test-babel.html test/test-babel-runtime.html
- sleep 0.1
- open test/test-typescript.html
- sleep 0.1
- open test/test-csp.html test/test-tracer.html
-
-dist/system-polyfills.js: dist/system-polyfills.src.js
- cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --preamble "$$POLYFILLS_BANNER" --mangle --source-map system-polyfills.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
-
-dist/%.js: dist/%.src.js
- cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --preamble "$$BANNER" --mangle --source-map $*.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
-
-dist/system.src.js: lib/*.js
- ( echo "$$BANNER"; \
- cat \
- lib/wrapper-start.js \
- lib/url-polyfill.js \
- lib/loader-wrapper-start.js \
- lib/system-fetch.js \
- lib/legacy-transpiler.js \
- lib/proto.js \
- lib/global-eval.js \
- lib/core.js \
- lib/package.js \
- lib/scriptLoader.js \
- lib/register.js \
- lib/esm.js \
- lib/global.js \
- lib/global-helpers.js \
- lib/cjs.js \
- lib/cjs-helpers.js \
- lib/amd-helpers.js \
- lib/amd.js \
- lib/plugins.js \
- lib/conditionals.js \
- lib/alias.js \
- lib/meta.js \
- lib/bundles.js \
- lib/depCache.js \
- lib/createSystem.js \
- ; echo "$$STANDARD_VERSION" ; cat \
- lib/loader-wrapper-end.js \
- lib/wrapper-end.js \
- ) > $@;
-
-dist/system.perf.js: lib/*.js
- ( echo "$$BANNER"; \
- cat \
- lib/wrapper-start.js \
- lib/url-polyfill.js \
- lib/loader-wrapper-start.js \
- lib/legacy-transpiler.js \
- lib/proto.js \
- lib/perf.js \
- lib/global-eval.js \
- lib/core.js \
- lib/package.js \
- lib/scriptLoader.js \
- lib/register.js \
- lib/esm.js \
- lib/global.js \
- lib/global-helpers.js \
- lib/cjs.js \
- lib/cjs-helpers.js \
- lib/amd-helpers.js \
- lib/amd.js \
- lib/plugins.js \
- lib/conditionals.js \
- lib/alias.js \
- lib/meta.js \
- lib/bundles.js \
- lib/depCache.js \
- lib/createSystem.js \
- ; echo "$$STANDARD_VERSION" ; cat \
- lib/loader-wrapper-end.js \
- lib/wrapper-end.js \
- ) > $@;
-
-dist/system-csp-production.src.js: lib/*.js
- ( echo "$$BANNER"; \
- cat \
- lib/wrapper-start.js \
- lib/url-polyfill.js \
- lib/loader-wrapper-start.js \
- lib/proto.js \
- lib/system-fetch.js \
- lib/core.js \
- lib/package.js \
- lib/scriptLoader.js \
- lib/register.js \
- lib/global-helpers.js \
- lib/cjs-helpers.js \
- lib/amd-helpers.js \
- lib/plugins.js \
- lib/conditionals.js \
- lib/alias.js \
- lib/meta.js \
- lib/bundles.js \
- lib/depCache.js \
- lib/scriptOnly.js \
- lib/createSystem.js \
- ; echo "$$CSP_VERSION" ; cat \
- lib/loader-wrapper-end.js \
- lib/wrapper-end.js \
- ) > $@;
-
-dist/system-register-only.src.js: lib/*.js
- ( echo "$$BANNER"; \
- cat \
- lib/url-polyfill.js \
- lib/loader-wrapper-start.js \
- lib/proto.js \
- lib/system-only-resolve.js \
- lib/scriptLoader.js \
- lib/register.js \
- lib/bundles.js \
- lib/scriptOnly.js \
- lib/createSystem.js \
- ; echo "$$REGISTER_VERSION" ; cat \
- lib/loader-wrapper-end.js \
- ) > $@;
-
-dist/system-polyfills.src.js: lib/*.js
- ( echo "$$POLYFILLS_BANNER"; \
- echo "(function(define) {"; \
- echo ""; \
- cat \
- node_modules/when/es6-shim/Promise.js \
- lib/polyfills-bootstrap.js; \
- echo "})();" \
- ) > $@; \ No newline at end of file