From fbdc0a1ce1a9005125b2d334d761aa66db1d3565 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 2 Aug 2012 14:02:37 +0200 Subject: [PATCH] Clean up and simplify build system --- .gitignore | 4 ++-- Makefile | 44 ++++++++++++----------------------------- ol-api.json | 9 +++++++++ ol.json => ol-base.json | 38 ++++++++++++++++------------------- ol-skeleton-debug.json | 37 ---------------------------------- ol-skeleton-dom.json | 39 ------------------------------------ ol-skeleton-webgl.json | 39 ------------------------------------ ol-skeleton.json | 34 +++---------------------------- 8 files changed, 44 insertions(+), 200 deletions(-) create mode 100644 ol-api.json rename ol.json => ol-base.json (88%) delete mode 100644 ol-skeleton-debug.json delete mode 100644 ol-skeleton-dom.json delete mode 100644 ol-skeleton-webgl.json diff --git a/.gitignore b/.gitignore index 246deeb6b9..799c8c878c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,10 @@ /examples/example-list.js /examples/example-list.xml /jsdoc/ -/ol-skeleton*.js /ol.js +/ol-api.js +/ol-skeleton.js /plovr*.jar -/src/ol/ol.js /tools/*.pyc /tools/closure-compiler.jar /webgl-debug.js diff --git a/Makefile b/Makefile index 9f45b5121c..0db51b0d31 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ PLOVR_JAR=bin/plovr-4b3caf2b7d84.jar -SRC = $(filter-out $(TARGETS),$(shell find externs src/ol -name \*.js)) -TARGETS = src/ol/ol.js +SRC = $(shell find externs src/ol -name \*.js) comma := , empty := space := $(empty) $(empty) @@ -9,39 +8,24 @@ space := $(empty) $(empty) all: build webgl-debug.js .PHONY: build -build: ol.js ol-skeleton.js ol-skeleton-debug.js ol-skeleton-dom.js ol-skeleton-webgl.js +build: ol-api.js ol-skeleton.js -ol.js: $(PLOVR_JAR) $(SRC) src/ol/ol.js +ol-api.js: $(PLOVR_JAR) $(SRC) ol-base.json ol-api.json ol.js java -jar $(PLOVR_JAR) build $(basename $@).json >$@ - @echo $@ "uncompressed:" $(shell wc -c <$@) bytes - @echo $@ " compressed:" $(shell gzip -9 -c <$@ | wc -c) bytes + @echo $@ "uncompressed:" $$(wc -c <$@) bytes + @echo $@ " compressed:" $$(gzip -9 -c <$@ | wc -c) bytes -ol-skeleton.js: $(PLOVR_JAR) $(SRC) skeleton.js +ol-skeleton.js: $(PLOVR_JAR) $(SRC) ol-base.json ol-skeleton.json skeleton.js java -jar $(PLOVR_JAR) build $(basename $@).json >$@ - @echo $@ "uncompressed:" $(shell wc -c <$@) bytes - @echo $@ " compressed:" $(shell gzip -9 -c <$@ | wc -c) bytes - -ol-skeleton-debug.js: $(PLOVR_JAR) $(SRC) skeleton.js - java -jar $(PLOVR_JAR) build $(basename $@).json >$@ - @echo $@ "uncompressed:" $(shell wc -c <$@) bytes - @echo $@ " compressed:" $(shell gzip -9 -c <$@ | wc -c) bytes - -ol-skeleton-dom.js: $(PLOVR_JAR) $(SRC) skeleton.js - java -jar $(PLOVR_JAR) build $(basename $@).json >$@ - @echo $@ "uncompressed:" $(shell wc -c <$@) bytes - @echo $@ " compressed:" $(shell gzip -9 -c <$@ | wc -c) bytes - -ol-skeleton-webgl.js: $(PLOVR_JAR) $(SRC) skeleton.js - java -jar $(PLOVR_JAR) build $(basename $@).json >$@ - @echo $@ "uncompressed:" $(shell wc -c <$@) bytes - @echo $@ " compressed:" $(shell gzip -9 -c <$@ | wc -c) bytes + @echo $@ "uncompressed:" $$(wc -c <$@) bytes + @echo $@ " compressed:" $$(gzip -9 -c <$@ | wc -c) bytes .PHONY: serve serve: $(PLOVR_JAR) - java -jar $(PLOVR_JAR) serve *.json + java -jar $(PLOVR_JAR) serve ol-api.json ol-skeleton.json -src/ol/ol.js: $(SRC) - ( echo "goog.provide('ol');" && echo && find src/ol -name \*.js -not -path $@ | xargs grep -rh ^goog.provide | sort | uniq | sed -e 's/provide/require/g' ) > $@ +ol.js: $(SRC) + ( find src/ol -name \*.js | xargs grep -rh ^goog.provide | sort | uniq | sed -e 's/provide/require/g' ) > $@ .PHONY: lint lint: @@ -54,11 +38,9 @@ $(PLOVR_JAR): curl http://plovr.googlecode.com/files/$(notdir $@) > $@ clean: - rm -f src/ol/ol.js + rm -f ol.js + rm -f ol-api.js rm -f ol-skeleton.js - rm -f ol-skeleton-debug.js - rm -f ol-skeleton-dom.js - rm -f ol-skeleton-webgl.js reallyclean: clean rm -f $(PLOVR_JAR) diff --git a/ol-api.json b/ol-api.json new file mode 100644 index 0000000000..86b6ef73cc --- /dev/null +++ b/ol-api.json @@ -0,0 +1,9 @@ +{ + + "id": "ol-api", + + "inherits": "ol-base.json", + + "inputs": "ol.js" + +} diff --git a/ol.json b/ol-base.json similarity index 88% rename from ol.json rename to ol-base.json index 88f6305272..b3d4ffe18d 100644 --- a/ol.json +++ b/ol-base.json @@ -1,24 +1,4 @@ { - "id": "ol", - - "inputs": "src/ol/ol.js", - - "paths": [ - "src" - ], - - "define": { - "goog.dom.ASSUME_STANDARDS_MODE": true, - "goog.DEBUG": false - }, - - "externs": [ - "externs/bingmaps.js", - "externs/webgl-debug.js" - ], - - "mode": "ADVANCED", - "level": "VERBOSE", "checks": { "accessControls": "ERROR", @@ -32,6 +12,22 @@ "missingProperties": "ERROR", "nonStandardJsDocs": "ERROR", "undefinedVars": "ERROR" - } + }, + + "define": { + "goog.dom.ASSUME_STANDARDS_MODE": true, + "goog.DEBUG": false + }, + + "externs": [ + "externs/bingmaps.js", + "externs/webgl-debug.js" + ], + + "level": "VERBOSE", + + "mode": "ADVANCED", + + "paths": "src" } diff --git a/ol-skeleton-debug.json b/ol-skeleton-debug.json deleted file mode 100644 index 32a3179c14..0000000000 --- a/ol-skeleton-debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "id": "ol-skeleton-debug", - - "inputs": "skeleton.js", - - "paths": [ - "src" - ], - - "define": { - "goog.dom.ASSUME_STANDARDS_MODE": true, - "goog.DEBUG": true - }, - - "externs": [ - "externs/bingmaps.js", - "externs/webgl-debug.js" - ], - - "mode": "ADVANCED", - "level": "VERBOSE", - - "checks": { - "accessControls": "ERROR", - "visibility": "ERROR", - "checkTypes": "ERROR", - "checkRegExp": "ERROR", - "checkVars": "ERROR", - "deprecated": "ERROR", - "fileoverviewTags": "ERROR", - "invalidCasts": "ERROR", - "missingProperties": "ERROR", - "nonStandardJsDocs": "ERROR", - "undefinedVars": "ERROR" - } - -} diff --git a/ol-skeleton-dom.json b/ol-skeleton-dom.json deleted file mode 100644 index 71511e4a99..0000000000 --- a/ol-skeleton-dom.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "ol-skeleton-dom", - - "inputs": "skeleton.js", - - "paths": [ - "src" - ], - - "define": { - "goog.dom.ASSUME_STANDARDS_MODE": true, - "ol.ENABLE_DOM": true, - "ol.ENABLE_WEBGL": false, - "goog.DEBUG": false - }, - - "externs": [ - "externs/bingmaps.js", - "externs/webgl-debug.js" - ], - - "mode": "ADVANCED", - "level": "VERBOSE", - - "checks": { - "accessControls": "ERROR", - "visibility": "ERROR", - "checkTypes": "ERROR", - "checkRegExp": "ERROR", - "checkVars": "ERROR", - "deprecated": "ERROR", - "fileoverviewTags": "ERROR", - "invalidCasts": "ERROR", - "missingProperties": "ERROR", - "nonStandardJsDocs": "ERROR", - "undefinedVars": "ERROR" - } - -} diff --git a/ol-skeleton-webgl.json b/ol-skeleton-webgl.json deleted file mode 100644 index 9b2f18718d..0000000000 --- a/ol-skeleton-webgl.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "ol-skeleton-webgl", - - "inputs": "skeleton.js", - - "paths": [ - "src" - ], - - "define": { - "goog.dom.ASSUME_STANDARDS_MODE": true, - "ol.ENABLE_DOM": false, - "ol.ENABLE_WEBGL": true, - "goog.DEBUG": false - }, - - "externs": [ - "externs/bingmaps.js", - "externs/webgl-debug.js" - ], - - "mode": "ADVANCED", - "level": "VERBOSE", - - "checks": { - "accessControls": "ERROR", - "visibility": "ERROR", - "checkTypes": "ERROR", - "checkRegExp": "ERROR", - "checkVars": "ERROR", - "deprecated": "ERROR", - "fileoverviewTags": "ERROR", - "invalidCasts": "ERROR", - "missingProperties": "ERROR", - "nonStandardJsDocs": "ERROR", - "undefinedVars": "ERROR" - } - -} diff --git a/ol-skeleton.json b/ol-skeleton.json index 13302ded66..dcee805a21 100644 --- a/ol-skeleton.json +++ b/ol-skeleton.json @@ -1,37 +1,9 @@ { + "id": "ol-skeleton", - "inputs": "skeleton.js", + "inherits": "ol-base.json", - "paths": [ - "src" - ], - - "define": { - "goog.dom.ASSUME_STANDARDS_MODE": true, - "goog.DEBUG": false - }, - - "externs": [ - "externs/bingmaps.js", - "externs/webgl-debug.js" - ], - - "mode": "ADVANCED", - "level": "VERBOSE", - - "checks": { - "accessControls": "ERROR", - "visibility": "ERROR", - "checkTypes": "ERROR", - "checkRegExp": "ERROR", - "checkVars": "ERROR", - "deprecated": "ERROR", - "fileoverviewTags": "ERROR", - "invalidCasts": "ERROR", - "missingProperties": "ERROR", - "nonStandardJsDocs": "ERROR", - "undefinedVars": "ERROR" - } + "inputs": "skeleton.js" }