Home | History | Annotate | Download | only in gdx-tests-gwt
      1 /*
      2  * Copyright 2011 See AUTHORS file.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *  http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  *  Unless required by applicable law or agreed to in writing, software
     11  *  distributed under the License is distributed on an "AS IS" BASIS,
     12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  *  See the License for the specific language governing permissions and
     14  *  limitations under the License.
     15  */
     16 
     17 apply plugin: "java"
     18 apply plugin: "jetty"
     19 
     20 gwt {
     21     gwtVersion='2.6.0' // Should match the gwt version used for building the gwt backend
     22     maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
     23     minHeapSize="1G"
     24 
     25     src = files(file("src/")) // Needs to be in front of "modules" below.
     26     modules 'com.badlogic.gdx.tests.gwt.GdxTestsGwt'
     27     devModules 'com.badlogic.gdx.tests.gwt.GdxTestsGwt'
     28     project.webAppDirName = 'webapp'
     29 
     30     compiler {
     31         strict = true;
     32         enableClosureCompiler = true;
     33         disableCastChecking = true;
     34     }
     35 }
     36 
     37 task draftRun(type: JettyRunWar) {
     38     dependsOn draftWar
     39     dependsOn.remove('war')
     40     webApp=draftWar.archivePath
     41     daemon=true
     42 }
     43 
     44 task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) {
     45     dependsOn draftRun
     46     doFirst {
     47         gwt.modules = gwt.devModules
     48     }
     49 }
     50 
     51 
     52 draftWar {
     53     from "war"
     54 }
     55 
     56 task addSource << {
     57     sourceSets.main.compileClasspath += files(project(':tests:gdx-tests').sourceSets.main.allJava.srcDirs)
     58     sourceSets.main.compileClasspath += files(project(':backends:gdx-backends-gwt').sourceSets.main.allJava.srcDirs)
     59     sourceSets.main.compileClasspath += files(project(':extensions:gdx-box2d:gdx-box2d-gwt').sourceSets.main.allJava.srcDirs)
     60     sourceSets.main.compileClasspath += files(project(':extensions:gdx-controllers:gdx-controllers-gwt').sourceSets.main.allJava.srcDirs)
     61     sourceSets.main.compileClasspath += files(project(':gdx').sourceSets.main.allJava.srcDirs)
     62 }
     63 
     64 tasks.compileGwt.dependsOn(addSource)
     65 tasks.draftCompileGwt.dependsOn(addSource)
     66 
     67 sourceCompatibility = 1.6
     68 sourceSets.main.java.srcDirs = [ "src/" ]
     69