From 4ff89a0e4a10b8d4f5a8832063de06c5b582db40 Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Mon, 15 May 2017 12:28:57 +0200 Subject: [PATCH 1/3] Fixes #1808: added CesiumJS support for projects --- project/index.html | 3 ++- project/static/checkCesium.js | 7 ++++++ project/web/pom.xml | 44 ++++++++++++++++++++++++++++++++++- projectScripts.json | 1 + 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 project/static/checkCesium.js diff --git a/project/index.html b/project/index.html index 4045f1002c..8721f93925 100644 --- a/project/index.html +++ b/project/index.html @@ -15,7 +15,8 @@ - + +
diff --git a/project/static/checkCesium.js b/project/static/checkCesium.js new file mode 100644 index 0000000000..1988b94e6c --- /dev/null +++ b/project/static/checkCesium.js @@ -0,0 +1,7 @@ +var existsFile = require('exists-file'); + +var exists = existsFile('./libs/Cesium/Build/Cesium/Cesium.js'); +if (!exists) { + process.exit(0); +} +process.exit(1); \ No newline at end of file diff --git a/project/web/pom.xml b/project/web/pom.xml index 28c2792f6a..0cf5266ba9 100644 --- a/project/web/pom.xml +++ b/project/web/pom.xml @@ -59,7 +59,33 @@ __PROJECTNAME__ - + + org.apache.maven.plugins + maven-antrun-plugin + 1.6 + + + download-files + compile + + run + + + + + + + + + + + + + maven-resources-plugin 2.6 @@ -166,6 +192,22 @@ + + CesiumJS + process-classes + + copy-resources + + + ${basedir}/target/mapstore/libs/Cesium + UTF-8 + + + ${basedir}/libs/Cesium + + + + diff --git a/projectScripts.json b/projectScripts.json index 3d20e41412..ab199b7c90 100644 --- a/projectScripts.json +++ b/projectScripts.json @@ -2,6 +2,7 @@ "clean": "rimraf dist", "compile": "npm run clean && mkdirp ./dist && webpack --config prod-webpack.config.js", "start": "webpack-dev-server --progress --colors --port 8081 --hot --inline --content-base .", + "postinstall": "node checkCesium.js && mkdirp ./libs/Cesium && download --extract --out ./libs/Cesium https://cesiumjs.org/releases/Cesium-1.17.zip || echo Cesium already installed", "test": "karma start ./karma.conf.single-run.js", "continuoustest": "karma start ./karma.conf.continuous-test.js", "mvntest": "karma start ./karma.conf.single-run.js --reporters junit,dots,coverage", From e1846aecad19caa5443dc0f651fc8433422876e0 Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Tue, 16 May 2017 17:17:36 +0200 Subject: [PATCH 2/3] Added support for 3d navigation tools --- project/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/index.html b/project/index.html index 8721f93925..69beb50485 100644 --- a/project/index.html +++ b/project/index.html @@ -17,6 +17,8 @@ + +
From 9c09a74cccd8f7951fd7b139214944bb9bc856ca Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Wed, 17 May 2017 17:19:06 +0200 Subject: [PATCH 3/3] Updated pom to copy navigation tools --- project/web/pom.xml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/project/web/pom.xml b/project/web/pom.xml index 0cf5266ba9..40652b8966 100644 --- a/project/web/pom.xml +++ b/project/web/pom.xml @@ -199,7 +199,7 @@ copy-resources - ${basedir}/target/mapstore/libs/Cesium + ${basedir}/target/__PROJECTNAME__/libs/Cesium UTF-8 @@ -208,6 +208,22 @@ + + CesiumJS-navigation + process-classes + + copy-resources + + + ${basedir}/target/__PROJECTNAME__/libs/cesium-navigation + UTF-8 + + + ${basedir}/../MapStore2/web/client/libs/cesium-navigation + + + +