summaryrefslogtreecommitdiffstats
path: root/html/build.gradle
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-06-26 02:06:32 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-06-26 02:06:32 +0200
commitccbec710375ddab05e60d893851e57f7ee743d19 (patch)
treed22eb9f39093e4a15113b4f29ff7eaf8f4562cfb /html/build.gradle
downloadgdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.zip
gdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.tar.gz
bare bone libgdx project
generated with https://libgdx.badlogicgames.com/nightlies/dist/gdx-setup.jar
Diffstat (limited to 'html/build.gradle')
-rw-r--r--html/build.gradle85
1 files changed, 85 insertions, 0 deletions
diff --git a/html/build.gradle b/html/build.gradle
new file mode 100644
index 0000000..efe8bc3
--- /dev/null
+++ b/html/build.gradle
@@ -0,0 +1,85 @@
+gwt {
+ gwtVersion='2.8.0' // Should match the gwt version used for building the gwt backend
+ maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
+ minHeapSize="1G"
+
+ src = files(file("src/")) // Needs to be in front of "modules" below.
+ modules 'ch.asynk.zproject.GdxDefinition'
+ devModules 'ch.asynk.zproject.GdxDefinitionSuperdev'
+ project.webAppDirName = 'webapp'
+
+ compiler {
+ strict = true;
+ disableCastChecking = true;
+ }
+}
+
+import org.wisepersist.gradle.plugins.gwt.GwtSuperDev
+
+def HttpFileServer server = null
+def httpFilePort = 8080
+
+task startHttpServer () {
+ dependsOn draftCompileGwt
+
+ String output = project.buildDir.path + "/gwt/draftOut"
+
+ doLast {
+ copy {
+ from "webapp"
+ into output
+ }
+
+ copy {
+ from "war"
+ into output
+ }
+
+ server = new SimpleHttpFileServerFactory().start(new File(output), httpFilePort)
+
+ println "Server started in directory " + server.getContentRoot() + ", http://localhost:" + server.getPort()
+ }
+}
+
+task superDev (type: GwtSuperDev) {
+ dependsOn startHttpServer
+ doFirst {
+ gwt.modules = gwt.devModules
+ }
+}
+
+
+task dist(dependsOn: [clean, compileGwt]) {
+ doLast {
+ file("build/dist").mkdirs()
+ copy {
+ from "build/gwt/out"
+ into "build/dist"
+ }
+ copy {
+ from "webapp"
+ into "build/dist"
+ }
+ copy {
+ from "war"
+ into "build/dist"
+ }
+ }
+}
+
+task addSource {
+ doLast {
+ sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
+ }
+}
+
+tasks.compileGwt.dependsOn(addSource)
+tasks.draftCompileGwt.dependsOn(addSource)
+
+sourceCompatibility = 1.6
+sourceSets.main.java.srcDirs = [ "src/" ]
+
+
+eclipse.project {
+ name = appName + "-html"
+}