From b32692942f23efb8deca1f76a7424ea4c00544dc Mon Sep 17 00:00:00 2001 From: Emux Date: Sat, 18 Mar 2017 19:05:01 +0200 Subject: [PATCH] Gretty plugin (Gradle) at web modules, closes #338 --- docs/Changelog.md | 2 ++ docs/web.md | 4 ++-- vtm-web-app/build.gradle | 17 +++++++++-------- vtm-web-js/build.gradle | 16 +++++++++------- vtm-web/build.gradle | 2 -- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 805c5628..dff32919 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -11,6 +11,7 @@ - OkHttp external cache [#135](https://github.com/mapsforge/vtm/issues/135) - Texture atlas improvements [#301](https://github.com/mapsforge/vtm/pull/301) [#304](https://github.com/mapsforge/vtm/pull/304) - vtm-ios-example module [#326](https://github.com/mapsforge/vtm/issues/326) +- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0) @@ -61,5 +62,6 @@ - Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41) - LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129) - SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165) +- Available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0) diff --git a/docs/web.md b/docs/web.md index 9b83d57f..a364f0ad 100644 --- a/docs/web.md +++ b/docs/web.md @@ -1,7 +1,7 @@ ### Web implementation -`./gradlew :vtm-web-app:jettyDraftWar` will run standalone Jetty server at port 8080. +`./gradlew :vtm-web-app:farmRun` will run standalone web server at port 8080. -Then go to `http://localhost:8080/vtm-web-app` in the web browser to see the map. +Then go to [http://localhost:8080/vtm-web-app](http://localhost:8080/vtm-web-app) in the web browser to see the map. Hold right mouse button to change view direction. diff --git a/vtm-web-app/build.gradle b/vtm-web-app/build.gradle index 8001bdb7..53972c81 100644 --- a/vtm-web-app/build.gradle +++ b/vtm-web-app/build.gradle @@ -4,15 +4,15 @@ buildscript { } dependencies { classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' + classpath 'org.akhikhl.gretty:gretty:1.4.2' } } -apply plugin: 'war' -apply plugin: 'jetty' apply plugin: 'gwt' +apply plugin: 'war' +apply plugin: 'org.akhikhl.gretty' sourceSets { - //main.java.srcDirs = ['src', 'src/org/oscim/gdx/emu'] main.java.srcDirs = ['src'] } @@ -55,11 +55,12 @@ gwt { src += files(project(':vtm-web').sourceSets.main.allJava.srcDirs) } -// Run jetty with draft compiled war -task jettyDraftWar(type: JettyRunWar) { - dependsOn draftWar - dependsOn.remove('war') - webApp = draftWar.archivePath +farm { + webapp draftWar.archivePath, contextPath: "/$name" +} + +project.afterEvaluate { + farmRun.dependsOn draftWar } task copyThemeAssets(type: Copy) { diff --git a/vtm-web-js/build.gradle b/vtm-web-js/build.gradle index c42af7f0..e97ebd53 100644 --- a/vtm-web-js/build.gradle +++ b/vtm-web-js/build.gradle @@ -4,12 +4,13 @@ buildscript { } dependencies { classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' + classpath 'org.akhikhl.gretty:gretty:1.4.2' } } -apply plugin: 'war' -apply plugin: 'jetty' apply plugin: 'gwt' +apply plugin: 'war' +apply plugin: 'org.akhikhl.gretty' sourceSets { main.java.srcDirs = ['src'] @@ -56,11 +57,12 @@ gwt { src += files(project(':vtm-web').sourceSets.main.allJava.srcDirs) } -// Run jetty with draft compiled war -task jettyDraftWar(type: JettyRunWar) { - dependsOn draftWar - //dependsOn.remove('war') - webApp = draftWar.archivePath +farm { + webapp draftWar.archivePath, contextPath: "/$name" +} + +project.afterEvaluate { + farmRun.dependsOn draftWar } task copyThemeAssets(type: Copy) { diff --git a/vtm-web/build.gradle b/vtm-web/build.gradle index 073ed933..4d2d7239 100644 --- a/vtm-web/build.gradle +++ b/vtm-web/build.gradle @@ -7,8 +7,6 @@ buildscript { } } -//apply plugin: 'war' -//apply plugin: 'jetty' apply plugin: 'java' apply plugin: 'maven' apply plugin: 'gwt-base'