Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.threesixone.gradle.SyncTask
- //apply plugin: 'com.github.robfletcher.compass'
- apply plugin: 'war'
- apply plugin: 'eclipse-wtp'
- apply plugin: 'org.akhikhl.gretty'
- apply plugin: 'rebel'
- dependencies {
- compile project(':core')
- compile project(':payment-alipay')
- compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:$thymeleafLayoutDialectVersion"
- compile "org.broadleafcommerce:broadleaf-framework:$broadleafVersion"
- compile "org.broadleafcommerce:broadleaf-framework-web:$broadleafVersion"
- compile "org.springframework.social:spring-social-web:1.1.0.RELEASE"
- compile "org.springframework.social:spring-social-facebook:1.1.0.RELEASE"
- compile "org.springframework.social:spring-social-twitter:1.1.0.RELEASE"
- compile "org.apache.flume.flume-ng-clients:flume-ng-log4jappender:1.4.0"
- compile 'org.atmosphere:atmosphere-runtime:2.1.0-RC1'
- compile 'org.eclipse.jetty:jetty-websocket:8.1.10.v20130312'
- compile "junit:junit:4.12"
- gretty devEnv?"com.h2database:h2:$h2Version":"mysql:mysql-connector-java:$mysqlVersion"
- gretty "commons-dbcp:commons-dbcp:$dbcpVersion"
- // compass 'rubygems:compass:1.0.3'
- // compass 'rubygems:compass-import-once:1.0.5'
- // compass 'rubygems:chunky_png:1.3.4'
- // compass 'rubygems:sass:3.4.14'
- // compass 'rubygems:rb-fsevent:0.9.5'
- providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
- }
- ext {
- unpackedTomcatPath = "${buildDir}/unpacked/apache-tomcat-$tomcatVersion"
- }
- task (deleteTomcat, type:Delete) {
- delete unpackedTomcatPath
- }
- task (unpackTomcat, type:Copy, dependsOn: deleteTomcat) {
- from zipTree(tomcatBinPath)
- into "${buildDir}/unpacked"
- }
- task (copyTomcatCfg, type:Copy, dependsOn: 'unpackTomcat') {
- from rootProject.fileTree('tomcat')
- into unpackedTomcatPath
- }
- task (copyTomcatLib, type:Copy, dependsOn: 'unpackTomcat') {
- from file(h2Path)
- from file(mysqlJarPath)
- from file(springInstrumentPath)
- into "$unpackedTomcatPath/lib"
- }
- task (cleanWebApps, type:Delete, dependsOn: 'unpackTomcat') {
- delete files("$unpackedTomcatPath/webapps")
- }
- task (copyWar, type:Copy, dependsOn: [war, cleanWebApps]) {
- from zipTree(war.archivePath)
- into "$unpackedTomcatPath/webapps/ROOT"
- }
- task (tomcatBundle, type:Zip, dependsOn: [copyTomcatCfg, copyTomcatLib, copyWar]) {
- from unpackedTomcatPath
- archiveName = "${project.name}-tomcat-${project.version}.zip"
- }
- gretty {
- webappCopy {CopySpec copySpec ->
- copySpec.exclude 'sass/**'
- }
- servletContainer = 'jetty8'
- jvmArgs = jettyJvmArgs
- sslKeyStorePath = keyStorePath
- sslKeyStorePassword = keyStorePass
- httpsEnabled = true
- contextConfigFile = jettyEnvPath
- reloadOnConfigChange=false
- reloadOnClassChange=false
- recompileOnSourceChange=false
- inplaceMode='hard'
- }
- //compass {
- // cssDir = file("$webAppDirName/css")
- // sassDir = file("$webAppDirName/sass")
- // config = file("$rootProject.projectDir.absolutePath/compass.rb")
- // sourcemap = true
- // force = true
- //}
- war {
- it.dependsOn generateRebel
- }
- eclipse {
- wtp {
- component {
- contextPath = '/'
- }
- }
- }
- task syncMsgRes(type: SyncTask, group: 'Development Support') {
- description 'Sync messages files'
- def resPath = "$projectDir.absolutePath/src/main/resources"
- def msgFilePaths = new FileNameFinder().getFileNames(resPath, 'messages*.properties')
- msgFilePaths.each() {
- path it
- }
- callback { path ->
- copy {
- from path
- into "$buildDir.absolutePath/resources"
- }
- }
- doFirst {
- println 'Trying to start syncMsgRes'
- }
- doLast {
- buildscript.addShutdownHook {
- println 'Trying to stop synchronizing messages resources'
- stop()
- println 'Synchronizing messages resources STOPPED'
- }
- }
- }
- afterEvaluate {
- prepareInplaceWebApp.dependsOn generateRebel, rootProject.genKey, rootProject.startH2, syncMsgRes
- // tasks.all {
- // if (name.startsWith('jettyRun')) {
- // it.finalizedBy compassWatchStop
- // }
- // }
- //
- // rootProject.tasks.all {
- // def name = it.name
- // if (name.startsWith('farmRun') || name.startsWith('farmStart')) {
- // it.finalizedBy compassWatchStop
- // }
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement