build.gradle 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. gwt {
  2. gwtVersion='2.8.2' // Should match the gwt version used for building the gwt backend
  3. maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
  4. minHeapSize="1G"
  5. src = files(file("src/")) // Needs to be in front of "modules" below.
  6. modules 'com.pjl.kursovaya.GdxDefinition'
  7. devModules 'com.pjl.kursovaya.GdxDefinitionSuperdev'
  8. project.webAppDirName = 'webapp'
  9. compiler {
  10. strict = true;
  11. disableCastChecking = true;
  12. }
  13. }
  14. import org.wisepersist.gradle.plugins.gwt.GwtSuperDev
  15. import org.akhikhl.gretty.AppBeforeIntegrationTestTask
  16. gretty.httpPort = 8080
  17. gretty.resourceBase = project.buildDir.path + "/gwt/draftOut"
  18. gretty.contextPath = "/"
  19. gretty.portPropertiesFileName = "TEMP_PORTS.properties"
  20. task startHttpServer () {
  21. dependsOn draftCompileGwt
  22. doFirst {
  23. copy {
  24. from "webapp"
  25. into gretty.resourceBase
  26. }
  27. copy {
  28. from "war"
  29. into gretty.resourceBase
  30. }
  31. }
  32. }
  33. task beforeRun(type: AppBeforeIntegrationTestTask, dependsOn: startHttpServer) {
  34. // The next line allows ports to be reused instead of
  35. // needing a process to be manually terminated.
  36. file("build/TEMP_PORTS.properties").delete()
  37. // Somewhat of a hack; uses Gretty's support for wrapping a task in
  38. // a start and then stop of a Jetty server that serves files while
  39. // also running the SuperDev code server.
  40. integrationTestTask 'superDev'
  41. interactive false
  42. }
  43. task superDev (type: GwtSuperDev) {
  44. dependsOn startHttpServer
  45. doFirst {
  46. gwt.modules = gwt.devModules
  47. }
  48. }
  49. task dist(dependsOn: [clean, compileGwt]) {
  50. doLast {
  51. file("build/dist").mkdirs()
  52. copy {
  53. from "build/gwt/out"
  54. into "build/dist"
  55. }
  56. copy {
  57. from "webapp"
  58. into "build/dist"
  59. }
  60. copy {
  61. from "war"
  62. into "build/dist"
  63. }
  64. }
  65. }
  66. task addSource {
  67. doLast {
  68. sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
  69. }
  70. }
  71. tasks.compileGwt.dependsOn(addSource)
  72. tasks.draftCompileGwt.dependsOn(addSource)
  73. sourceCompatibility = 1.7
  74. sourceSets.main.java.srcDirs = [ "src/" ]
  75. eclipse.project.name = appName + "-html"