Advertisement
lesharb

build.gradle

Feb 3rd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 4.01 KB | None | 0 0
  1. plugins {
  2.   id "java"
  3.   id "eclipse"
  4.   id "groovy"
  5.   id "idea"
  6.   id "war"
  7.   id "org.springframework.boot" version "1.5.9.RELEASE"
  8.   id "com.github.ben-manes.versions" version "0.17.0"
  9.   id "net.ltgt.apt" version "0.13"
  10. }
  11.  
  12. sourceSets {
  13.   main.java.srcDir "src/main/java"
  14.   main.resources.srcDir "src/main/resources"
  15.   test.java.srcDir "src/test/java"
  16.   test.resources.srcDir "src/test/resources"
  17. }
  18.  
  19. dependencies {
  20.   // guava-gwt
  21.   compileOnly("com.google.guava:guava-gwt:$guavaVersion")
  22.   compileOnly("com.google.gwt.inject:gin:$ginVersion")
  23.   compileOnly("com.gwtplatform:gwtp-mvp-client:$gwtpVersion")
  24.   compileOnly("org.fusesource.restygwt:restygwt:$restyGwtVersion")
  25.   compileOnly("org.apache.httpcomponents:httpclient:$httpclientVersion")
  26.   compileOnly("org.apache.httpcomponents:httpmime:$httpmimeVersion")
  27.   compileOnly("org.apache.httpcomponents:httpcore:$httpcoreVersion")
  28.  
  29.   // gwt-material
  30.   compileOnly("com.github.gwtmaterialdesign:gwt-material:$gwtMaterialVersion")
  31.   compileOnly("com.github.gwtmaterialdesign:gwt-material-addins:$gwtMaterialAddinsVersion")
  32.   compileOnly("com.github.gwtmaterialdesign:gwt-material-themes:$gwtMaterialThemesVersion")
  33.   compileOnly("com.github.gwtmaterialdesign:gwt-material-table:$gwtMaterialTableVersion")
  34.   compileOnly("com.googlecode.gwt-charts:gwt-charts:$gwtChartsVersion")
  35.   compileOnly("de.knightsoft-net:gwt-commons-lang3:$gwtCommonsLang3Version")
  36.  
  37.   // GWT framework
  38. //  compileOnly("com.google.gwt:gwt-user:$gwtVersion")
  39. //  compileOnly("com.google.gwt:gwt-dev:$gwtVersion")
  40.   providedCompile("com.google.gwt:gwt-user:$gwtVersion")
  41.   providedCompile("com.google.gwt:gwt-dev:$gwtVersion")
  42.  
  43.  
  44.   compileOnly("org.realityforge.gwt.websockets:gwt-websockets:$gwtWebsocketsVersion")
  45.  
  46.   compileOnly("org.springframework.boot:spring-boot-configuration-processor")
  47.   compile("org.springframework.boot:spring-boot-starter-jetty")
  48.   compile("org.springframework.boot:spring-boot-starter-web") {
  49.     exclude module: "spring-boot-starter-tomcat"
  50.   }
  51.   compile("javax.ws.rs:javax.ws.rs-api:$wsrsapiVersion")
  52.  
  53.   compile("org.projectlombok:lombok:$lombokVersion")
  54.   apt("org.projectlombok:lombok:$lombokVersion")
  55.  
  56.   testCompile("org.springframework.boot:spring-boot-starter-test")
  57. }
  58.  
  59. // copy war file to $rootDir/install folder
  60. def installDir = "$rootDir" + "/install/"
  61. task installWar(type: Copy) {
  62.   delete installDir
  63.   def sourceFolder = "$buildDir" + "/libs"
  64.   from sourceFolder
  65.   into installDir
  66. }
  67.  
  68. clean.doFirst {
  69.   delete "${projectDir}/build"
  70.   delete "${projectDir}/out"
  71.   delete "${projectDir}/war"
  72. }
  73.  
  74. task wrapper(type: Wrapper) {
  75.   gradleVersion = "4.5"
  76. }
  77.  
  78. task compileGwt(dependsOn: classes, type: JavaExec) {
  79.   ext.buildDir = "${project.buildDir}/gwt"
  80.   ext.extraDir = "${project.buildDir}/extra"
  81.  
  82.   inputs.file sourceSets.main.java.srcDirs
  83.   inputs.dir sourceSets.main.output.resourcesDir
  84.   outputs.dir buildDir
  85.  
  86.   doFirst {
  87.     file(buildDir).mkdirs()
  88.   }
  89.  
  90.   main = "com.google.gwt.dev.Compiler"
  91.  
  92.   classpath {
  93.     [
  94.         sourceSets.main.java.srcDirs,           // Java source
  95.         sourceSets.main.output.resourcesDir,    // Generated resources
  96.         sourceSets.main.output.classesDir,      // Generated classes
  97.         sourceSets.main.compileClasspath,       // Deps
  98.     ]
  99.   }
  100.  
  101.   args = [
  102.       "com.test.DeviceManager",
  103.       "-war", buildDir,
  104.       "-logLevel", "INFO",
  105.       "-localWorkers", "4",
  106.       "-compileReport",
  107.       "-extra", extraDir,
  108.       "-style", "OBF",
  109.       "-optimize", "7" // 0=none, 9=max
  110.   ]
  111.  
  112.   maxHeapSize = "4G"
  113. }
  114.  
  115. war.dependsOn compileGwt
  116. war {
  117.   from compileGwt.buildDir
  118. }
  119.  
  120. compileJava.dependsOn(processResources)
  121.  
  122. jar.dependsOn compileGwt
  123. jar {
  124.   baseName = "gwt-material"
  125.   version = "2.0"
  126.  
  127.   into("../webapp") {
  128.     from compileGwt.buildDir
  129.   }
  130. }
  131.  
  132. eclipse {
  133.   classpath {
  134.     containers.remove("org.eclipse.jdt.launching.JRE_CONTAINER")
  135.     containers "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
  136.   }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement