Advertisement
Guest User

siten.build.gradle

a guest
May 27th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. import com.threesixone.gradle.SyncTask
  2.  
  3. //apply plugin: 'com.github.robfletcher.compass'
  4. apply plugin: 'war'
  5. apply plugin: 'eclipse-wtp'
  6. apply plugin: 'org.akhikhl.gretty'
  7. apply plugin: 'rebel'
  8.  
  9. dependencies {
  10. compile project(':core')
  11. compile project(':payment-alipay')
  12. compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:$thymeleafLayoutDialectVersion"
  13. compile "org.broadleafcommerce:broadleaf-framework:$broadleafVersion"
  14. compile "org.broadleafcommerce:broadleaf-framework-web:$broadleafVersion"
  15. compile "org.springframework.social:spring-social-web:1.1.0.RELEASE"
  16. compile "org.springframework.social:spring-social-facebook:1.1.0.RELEASE"
  17. compile "org.springframework.social:spring-social-twitter:1.1.0.RELEASE"
  18. compile "org.apache.flume.flume-ng-clients:flume-ng-log4jappender:1.4.0"
  19. compile 'org.atmosphere:atmosphere-runtime:2.1.0-RC1'
  20. compile 'org.eclipse.jetty:jetty-websocket:8.1.10.v20130312'
  21. compile "junit:junit:4.12"
  22. gretty devEnv?"com.h2database:h2:$h2Version":"mysql:mysql-connector-java:$mysqlVersion"
  23. gretty "commons-dbcp:commons-dbcp:$dbcpVersion"
  24. // compass 'rubygems:compass:1.0.3'
  25. // compass 'rubygems:compass-import-once:1.0.5'
  26. // compass 'rubygems:chunky_png:1.3.4'
  27. // compass 'rubygems:sass:3.4.14'
  28. // compass 'rubygems:rb-fsevent:0.9.5'
  29. providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
  30. }
  31. ext {
  32. unpackedTomcatPath = "${buildDir}/unpacked/apache-tomcat-$tomcatVersion"
  33. }
  34.  
  35. task (deleteTomcat, type:Delete) {
  36. delete unpackedTomcatPath
  37. }
  38.  
  39. task (unpackTomcat, type:Copy, dependsOn: deleteTomcat) {
  40. from zipTree(tomcatBinPath)
  41. into "${buildDir}/unpacked"
  42. }
  43.  
  44. task (copyTomcatCfg, type:Copy, dependsOn: 'unpackTomcat') {
  45. from rootProject.fileTree('tomcat')
  46. into unpackedTomcatPath
  47. }
  48.  
  49. task (copyTomcatLib, type:Copy, dependsOn: 'unpackTomcat') {
  50. from file(h2Path)
  51. from file(mysqlJarPath)
  52. from file(springInstrumentPath)
  53. into "$unpackedTomcatPath/lib"
  54. }
  55.  
  56. task (cleanWebApps, type:Delete, dependsOn: 'unpackTomcat') {
  57. delete files("$unpackedTomcatPath/webapps")
  58. }
  59.  
  60. task (copyWar, type:Copy, dependsOn: [war, cleanWebApps]) {
  61. from zipTree(war.archivePath)
  62. into "$unpackedTomcatPath/webapps/ROOT"
  63. }
  64.  
  65. task (tomcatBundle, type:Zip, dependsOn: [copyTomcatCfg, copyTomcatLib, copyWar]) {
  66. from unpackedTomcatPath
  67. archiveName = "${project.name}-tomcat-${project.version}.zip"
  68. }
  69.  
  70. gretty {
  71. webappCopy {CopySpec copySpec ->
  72. copySpec.exclude 'sass/**'
  73. }
  74. servletContainer = 'jetty8'
  75. jvmArgs = jettyJvmArgs
  76. sslKeyStorePath = keyStorePath
  77. sslKeyStorePassword = keyStorePass
  78. httpsEnabled = true
  79. contextConfigFile = jettyEnvPath
  80. reloadOnConfigChange=false
  81. reloadOnClassChange=false
  82. recompileOnSourceChange=false
  83. inplaceMode='hard'
  84. }
  85.  
  86. //compass {
  87. // cssDir = file("$webAppDirName/css")
  88. // sassDir = file("$webAppDirName/sass")
  89. // config = file("$rootProject.projectDir.absolutePath/compass.rb")
  90. // sourcemap = true
  91. // force = true
  92. //}
  93.  
  94. war {
  95. it.dependsOn generateRebel
  96. }
  97.  
  98. eclipse {
  99. wtp {
  100. component {
  101. contextPath = '/'
  102. }
  103. }
  104. }
  105.  
  106. task syncMsgRes(type: SyncTask, group: 'Development Support') {
  107. description 'Sync messages files'
  108. def resPath = "$projectDir.absolutePath/src/main/resources"
  109. def msgFilePaths = new FileNameFinder().getFileNames(resPath, 'messages*.properties')
  110. msgFilePaths.each() {
  111. path it
  112. }
  113. callback { path ->
  114. copy {
  115. from path
  116. into "$buildDir.absolutePath/resources"
  117. }
  118. }
  119. doFirst {
  120. println 'Trying to start syncMsgRes'
  121. }
  122. doLast {
  123. buildscript.addShutdownHook {
  124. println 'Trying to stop synchronizing messages resources'
  125. stop()
  126. println 'Synchronizing messages resources STOPPED'
  127. }
  128. }
  129. }
  130.  
  131. afterEvaluate {
  132. prepareInplaceWebApp.dependsOn generateRebel, rootProject.genKey, rootProject.startH2, syncMsgRes
  133. // tasks.all {
  134. // if (name.startsWith('jettyRun')) {
  135. // it.finalizedBy compassWatchStop
  136. // }
  137. // }
  138. //
  139. // rootProject.tasks.all {
  140. // def name = it.name
  141. // if (name.startsWith('farmRun') || name.startsWith('farmStart')) {
  142. // it.finalizedBy compassWatchStop
  143. // }
  144. // }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement