build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. apply plugin: "java"
  2. apply plugin: 'kotlin'
  3. apply plugin: "jetty"
  4. gwt {
  5. gwtVersion='2.8.0' // Should match the gwt version used for building the gwt backend
  6. maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
  7. minHeapSize="1G"
  8. src = files(file("src/")) // Needs to be in front of "modules" below.
  9. modules 'info.raa0121.duelsimulation.GdxDefinition'
  10. devModules 'info.raa0121.duelsimulation.GdxDefinitionSuperdev'
  11. project.webAppDirName = 'webapp'
  12. compiler {
  13. strict = true;
  14. disableCastChecking = true;
  15. }
  16. }
  17. task draftRun(type: JettyRunWar) {
  18. dependsOn draftWar
  19. dependsOn.remove('war')
  20. webApp=draftWar.archivePath
  21. daemon=true
  22. }
  23. task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) {
  24. dependsOn draftRun
  25. doFirst {
  26. gwt.modules = gwt.devModules
  27. }
  28. }
  29. task dist(dependsOn: [clean, compileGwt]) {
  30. doLast {
  31. file("build/dist").mkdirs()
  32. copy {
  33. from "build/gwt/out"
  34. into "build/dist"
  35. }
  36. copy {
  37. from "webapp"
  38. into "build/dist"
  39. }
  40. copy {
  41. from "war"
  42. into "build/dist"
  43. }
  44. }
  45. }
  46. draftWar {
  47. from "war"
  48. }
  49. task addSource << {
  50. sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
  51. }
  52. tasks.compileGwt.dependsOn(addSource)
  53. tasks.draftCompileGwt.dependsOn(addSource)
  54. sourceCompatibility = 1.6
  55. sourceSets.main.java.srcDirs = [ "src/" ]
  56. eclipse.project {
  57. name = appName + "-html"
  58. }
  59. buildscript {
  60. ext.kotlin_version = '1.2.21'
  61. repositories {
  62. mavenCentral()
  63. }
  64. dependencies {
  65. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  66. }
  67. }
  68. repositories {
  69. mavenCentral()
  70. }
  71. dependencies {
  72. compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
  73. }
  74. compileKotlin {
  75. kotlinOptions {
  76. jvmTarget = "1.8"
  77. }
  78. }
  79. compileTestKotlin {
  80. kotlinOptions {
  81. jvmTarget = "1.8"
  82. }
  83. }