cuba/build.gradle

721 lines
22 KiB
Groovy
Raw Normal View History

2011-12-07 19:01:29 +08:00
/*
2013-09-24 19:00:49 +08:00
* Copyright (c) 2008-2013 Haulmont. All rights reserved.
* Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/
2011-11-17 16:31:31 +08:00
allprojects {
ext.artifactGroup = 'com.haulmont.cuba'
2013-09-24 19:00:49 +08:00
ext.artifactVersion = cubaVersion.replace('-SNAPSHOT', '')
ext.isSnapshot = cubaVersion.endsWith('-SNAPSHOT')
ext.vcs = 'svn'
//ext.tomcatDir = rootDir.absolutePath + '/../tomcat'
2011-11-17 16:31:31 +08:00
}
buildscript {
2014-11-27 18:32:41 +08:00
ext.cubaVersion = '5.4-SNAPSHOT'
2013-09-24 19:00:49 +08:00
ext.cubaVersion = rootProject.hasProperty('buildVersion') ? rootProject['buildVersion'] : cubaVersion
println("CUBA Platform Version ${ext.cubaVersion}")
println("")
2011-11-17 16:31:31 +08:00
repositories {
mavenLocal()
maven {
credentials {
username System.getenv('HAULMONT_REPOSITORY_USER')
password System.getenv('HAULMONT_REPOSITORY_PASSWORD')
}
url "http://repository.haulmont.com:8587/nexus/content/groups/work"
}
}
dependencies {
2013-09-24 19:00:49 +08:00
classpath group: 'com.haulmont.gradle', name: 'cuba-plugin', version: cubaVersion
2011-11-17 16:31:31 +08:00
}
}
2012-02-21 16:18:28 +08:00
apply(plugin: 'base')
2012-03-07 22:30:40 +08:00
apply(plugin: 'maven')
2011-11-17 16:31:31 +08:00
apply(plugin: 'idea')
apply(plugin: 'cuba')
def sharedLibModule = project(':cuba-shared-lib')
def globalModule = project(':cuba-global')
def coreModule = project(':cuba-core')
def clientModule = project(':cuba-client')
def guiModule = project(':cuba-gui')
def desktopModule = project(':cuba-desktop')
def portalModule = project(':cuba-portal')
def webAuthModule = project(':cuba-web-auth')
2013-10-19 18:40:54 +08:00
def webToolkitModule = project(':cuba-web-toolkit')
def webModule = project(':cuba-web')
def webLegacyModule = project(':cuba-web6')
def webToolkitLegacyModule = project(':cuba-web6-toolkit')
2011-11-17 16:31:31 +08:00
def webModuleThemes = project(':cuba-web-themes')
def webLegacyModuleThemes = project(':cuba-web6-themes')
apply from: "$rootProject.projectDir/lib.gradle"
def vaadinLegacyVersion = '6.6.1.162'
2014-04-02 18:59:48 +08:00
def springVersion = '3.2.8.RELEASE'
def springSecurityVersion = '3.2.3.RELEASE'
2013-02-06 23:14:40 +08:00
2014-05-27 18:07:40 +08:00
def servletApi = [group: 'org.apache.tomcat', name: 'tomcat-servlet-api', version: '7.0.53']
2013-08-15 22:39:37 +08:00
def groovyArtifact = [group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.1.6']
2013-03-28 23:23:13 +08:00
def asm = [group: 'asm', name: 'asm', version: '3.3.1']
2013-06-27 21:11:23 +08:00
def poi = [group: 'com.haulmont.thirdparty', name: 'poi', version: '3.9.20130515']
2012-04-28 19:07:00 +08:00
def postgres = [group: 'postgresql', name: 'postgresql', version: '9.1-901.jdbc4']
def hsqldb = [group: 'org.hsqldb', name: 'hsqldb', version: '2.2.9']
2011-11-17 16:31:31 +08:00
2013-10-19 18:40:54 +08:00
/* Legacy dependencies */
def vaadinLegacy = [group: 'com.haulmont.thirdparty', name: 'vaadin', version: vaadinLegacyVersion]
def popupButtonLegacy = [group: 'com.haulmont.thirdparty', name: 'popupbutton', version: '1.0.0']
def appletIntegrationLegacy = [group: 'com.haulmont.thirdparty', name: 'appletintegration', version: '1.1.4']
2013-10-19 18:40:54 +08:00
def gwtUser = [group: 'com.google.gwt', name: 'gwt-user', version: '2.3.0']
def gwtDev = [group: 'com.google.gwt', name: 'gwt-dev', version: '2.3.0']
def gwtServlets = [group: 'com.google.gwt', name: 'gwt-servlet', version: '2.3.0']
def validationApi = [group: 'javax.validation', name: 'validation-api', version: '1.0.0.GA']
/* Shared web dependencies */
def commonsUpload = [group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2.2']
def casClient = [group: 'org.jasig.cas', name: 'cas-client-core', version: '3.1.10']
configure([sharedLibModule, globalModule, coreModule, clientModule, guiModule,
webModule, desktopModule, portalModule, webAuthModule, webLegacyModule]) {
2011-11-17 16:31:31 +08:00
apply(plugin: 'java')
apply(plugin: 'idea')
apply(plugin: 'maven')
2013-12-23 16:25:49 +08:00
apply(plugin: 'checkstyle')
2013-12-24 18:36:16 +08:00
apply(plugin: 'findbugs')
2011-11-17 16:31:31 +08:00
apply(plugin: 'cuba')
dependencies {
compile(group: 'commons-logging', name: 'commons-logging', version: '1.1.1')
2013-03-28 23:23:13 +08:00
compile(group: 'commons-lang', name: 'commons-lang', version: '2.6')
compile(group: 'commons-collections', name: 'commons-collections', version: '3.2.1')
compile(group: 'commons-io', name: 'commons-io', version: '1.4')
2013-02-06 23:32:13 +08:00
compile(group: 'commons-codec', name: 'commons-codec', version: '1.6')
compile(group: 'commons-cli', name: 'commons-cli', version: '1.2')
compile(group: 'commons-pool', name: 'commons-pool', version: '1.5.1')
2013-03-28 23:23:13 +08:00
compile(group: 'org.apache.commons', name: 'commons-compress', version: '1.1')
compile(group: 'dom4j', name: 'dom4j', version: '1.6.1')
2014-04-30 19:43:45 +08:00
compile(group: 'com.sun.mail', name: 'javax.mail', version: '1.5.1')
compile(group: 'log4j', name: 'log4j', version: '1.2.16')
2013-02-19 22:51:49 +08:00
compile(group: 'org.perf4j', name: 'perf4j', version: '0.9.16')
compile(group: 'com.google.code.findbugs', name: 'jsr305', version: '2.0.3')
compile(group: 'com.haulmont.thirdparty', name: 'javaee-api', version: '6.0.20091228')
compile(group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.1.6')
2011-11-17 16:31:31 +08:00
compile(group: 'antlr', name: 'antlr', version: '2.7.7')
compile(asm)
2014-06-09 15:05:04 +08:00
compile(group: 'com.google.guava', name: 'guava', version: '16.0.1')
2014-12-30 18:51:44 +08:00
compile(group: 'org.apache.openjpa', name: 'openjpa', version: '2.3.0') {
exclude(group: 'junit', module: 'junit')
}
compile(group: 'org.antlr', name: 'antlr-runtime', version: '3.2')
compile(group: 'org.freemarker', name: 'freemarker', version: '2.3.16')
compile(group: 'aopalliance', name: 'aopalliance', version: '1.0')
2013-10-19 18:40:54 +08:00
compile(group: 'org.springframework', name: 'spring-core', version: springVersion)
compile(group: 'org.springframework', name: 'spring-beans', version: springVersion)
compile(group: 'org.springframework', name: 'spring-context', version: springVersion)
compile(group: 'org.springframework', name: 'spring-web', version: springVersion)
2011-11-17 16:31:31 +08:00
testCompile(group: 'org.jmockit', name: 'jmockit', version: '1.14')
2011-11-17 16:31:31 +08:00
testCompile(group: 'junit', name: 'junit', version: '4.5')
}
task sourceJar(type: Jar) {
from file('src')
exclude "com/haulmont/cuba/security/app/UserSessions.java"
2011-11-17 16:31:31 +08:00
classifier = 'sources'
}
artifacts {
archives sourceJar
}
2013-12-23 16:25:49 +08:00
String checkstyleConfigDir = "${rootProject.projectDir}/config/checkstyle"
checkstyle {
configFile = new File("${checkstyleConfigDir}/checkstyle.xml".toString())
configProperties = [
'checkstyleConfigDir' : checkstyleConfigDir
]
reportsDir = new File("${buildDir}/checkstyle".toString())
}
2011-11-17 16:31:31 +08:00
checkstyleMain << {
def checkstyleDir = "${project.buildDir}/checkstyle".toString()
2013-12-23 16:25:49 +08:00
ant.xslt('in': "$checkstyleDir/main.xml",
out: "$checkstyleDir/$project.name-checkstyle.html",
style: "$checkstyleConfigDir/checkstyle.xsl")
2011-11-17 16:31:31 +08:00
}
2013-12-24 18:36:16 +08:00
2014-08-20 14:00:57 +08:00
findbugs {
toolVersion = "2.0.3"
2014-08-20 14:00:57 +08:00
ignoreFailures = true
omitVisitors = ['FindDoubleCheck']
2014-08-20 14:00:57 +08:00
}
2013-12-24 18:36:16 +08:00
findbugsMain {
reports {
xml.enabled = false
html {
enabled = true
2014-08-20 14:00:57 +08:00
destination "${project.buildDir}/findbugs/$project.name-findbugs.html"
2013-12-24 18:36:16 +08:00
}
}
}
2011-11-17 16:31:31 +08:00
}
// configure web toolkit modules
configure([webToolkitModule, webToolkitLegacyModule]) {
apply(plugin: 'java')
apply(plugin: 'idea')
apply(plugin: 'maven')
apply(plugin: 'cuba')
task sourceJar(type: Jar) {
from file('src')
exclude "com/haulmont/cuba/security/app/UserSessions.java"
classifier = 'sources'
}
artifacts {
archives sourceJar
}
}
2011-11-17 16:31:31 +08:00
configure(sharedLibModule) {
dependencies {
jdbc(postgres)
jdbc(hsqldb)
}
}
configure(globalModule) {
2011-11-22 19:42:09 +08:00
dependencies {
2012-09-06 23:18:15 +08:00
provided(servletApi)
2011-11-22 19:42:09 +08:00
}
task generateReleaseTimestamp(type: CubaReleaseTimeStamp) {
releaseTimeStampPath = "$buildDir/classes/main/com/haulmont/cuba/core/global/release.timestamp"
releaseNumberPath = "$buildDir/classes/main/com/haulmont/cuba/core/global/release.number"
2011-11-17 16:31:31 +08:00
}
2013-04-09 18:15:55 +08:00
task enhance(type: CubaEnhancing) {
2013-04-09 18:15:55 +08:00
persistenceXml = "$globalModule.projectDir/src/cuba-persistence.xml"
}
task enhanceTransient(type: CubaEnhanceTransient) {
metadataXml = "$globalModule.projectDir/src/cuba-metadata.xml"
}
2011-11-17 16:31:31 +08:00
}
configure(coreModule) {
configurations {
dbscripts
}
2011-11-17 16:31:31 +08:00
dependencies {
compile(globalModule)
compile(sharedLibModule)
compile(group: 'com.haulmont.thirdparty', name: 'xstream', version: '1.4.2.20120702')
2011-11-17 16:31:31 +08:00
runtime(group: 'xpp3', name: 'xpp3_min', version: '1.1.4c')
runtime(group: 'xmlpull', name: 'xmlpull', version: '1.1.3.1')
2015-01-30 21:04:29 +08:00
compile(group: 'org.jgroups', name: 'jgroups', version: '3.6.1.Final')
2015-02-20 22:59:00 +08:00
compile(group: 'org.aspectj', name: 'aspectjrt', version: '1.8.4')
compile(group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.4')
2014-07-29 15:54:58 +08:00
compile(group: 'org.mybatis', name: 'mybatis', version: '3.2.7')
compile(group: 'org.mybatis', name: 'mybatis-spring', version: '1.2.2')
2013-10-19 18:40:54 +08:00
compile(group: 'org.springframework', name: 'spring-context-support', version: springVersion)
compile(group: 'org.springframework', name: 'spring-orm', version: springVersion)
compile(group: 'org.springframework', name: 'spring-tx', version: springVersion)
compile(group: 'org.springframework', name: 'spring-webmvc', version: springVersion)
compile(poi) // POI is actually not required by core, but remains here to simplify dependencies for reports project
2011-11-17 16:31:31 +08:00
provided(servletApi)
jdbc(postgres)
jdbc(hsqldb)
testCompile(group: 'commons-dbcp', name: 'commons-dbcp', version: '1.4')
2011-11-17 16:31:31 +08:00
testRuntime(servletApi)
testRuntime(hsqldb)
testRuntime(postgres)
2011-11-17 16:31:31 +08:00
}
task recompileNoDebug(type: JavaCompile) {
source = sourceSets.main.java
classpath = sourceSets.main.compileClasspath
destinationDir = new File(buildDir, 'nodebug-classes')
options.debug = false
}
jar {
exclude { details ->
return details.file == new File("${sourceSets.main.output.classesDir}/com/haulmont/cuba/security/app/UserSessions.class")
}
from("$buildDir/nodebug-classes") {
include "com/haulmont/cuba/security/app/UserSessions.class"
}
}
jar.dependsOn(recompileNoDebug)
2011-11-17 16:31:31 +08:00
test {
scanForTestClasses = false
includes = ['**/*Test.class']
jvmArgs '-XX:-UseSplitVerifier'
2011-11-17 16:31:31 +08:00
}
task testsJar(dependsOn: testClasses, type: Jar) {
from sourceSets.test.output.classesDir
from sourceSets.test.output.resourcesDir
2013-03-28 23:23:13 +08:00
include 'com/haulmont/cuba/core/CubaTestCase*.class'
include 'com/haulmont/cuba/testsupport/*'
include '*'
includeEmptyDirs = false
2011-11-17 16:31:31 +08:00
classifier = 'tests'
}
assembleDbScripts {
moduleAlias = '10-cuba'
2011-11-17 16:31:31 +08:00
}
artifacts {
archives testsJar
}
task deploy(dependsOn: assemble, type: CubaDeployment) {
appName = 'cuba-core'
appJars('cuba-global', 'cuba-core')
2011-11-17 16:31:31 +08:00
}
def hsqlDbName = 'cubadb'
task startDb(description: 'Starts local HSQLDB server', type: CubaHsqlStart) {
dbName = hsqlDbName
}
task stopDb(description: 'Stops local HSQLDB server', type: CubaHsqlStop) {
dbName = hsqlDbName
}
task removeDb(description: 'Removes local HSQL database', type: Delete) {
delete new File("$rootProject.projectDir/data")
}
task killDb(description: 'Kill local HSQLDB server process running on port 9001', type: CubaKillProcess) {
port = 9001
}
task createDb(dependsOn: assembleDbScripts, description: 'Creates local HSQL database', type: CubaDbCreation) {
dbms = 'hsql'
dbName = hsqlDbName
dbUser = 'sa'
dbPassword = ''
}
2011-11-17 16:31:31 +08:00
}
configure(clientModule) {
dependencies {
compile(globalModule)
compile(group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.2.2')
2011-11-17 16:31:31 +08:00
}
task testsJar(dependsOn: testClasses, type: Jar) {
from sourceSets.test.output.classesDir
classifier = 'tests'
}
artifacts {
archives testsJar
}
}
configure(guiModule) {
apply(plugin: 'groovy')
sourceSets {
main {
groovy { srcDir 'src' }
}
}
dependencies {
compile(clientModule)
compile(poi)
compile(groovyArtifact)
compile(asm)
2011-11-17 16:31:31 +08:00
testCompile(clientModule.sourceSets.test.output)
}
task enhanceTransient(type: CubaEnhanceTransient) {
metadataXml = "$guiModule.projectDir/src/cuba-gui-metadata.xml"
2013-04-09 18:15:55 +08:00
}
2011-11-17 16:31:31 +08:00
test {
scanForTestClasses = false
includes = ['**/*Test.class']
2014-12-12 22:58:30 +08:00
exclude 'com/haulmont/cuba/gui/components/**'
2011-11-17 16:31:31 +08:00
}
}
configure(webModule) {
dependencies {
compile(sharedLibModule)
compile(guiModule)
compile(webAuthModule)
2013-02-06 23:14:40 +08:00
2013-10-19 18:40:54 +08:00
compile(commonsUpload)
compile(casClient)
compile(group: 'org.springframework', name: 'spring-webmvc', version: springVersion)
2014-06-09 15:05:04 +08:00
compile(group: 'org.json', name: 'json', version: '20090211')
2011-11-17 16:31:31 +08:00
compile(vaadinServer) {
2014-06-09 15:05:04 +08:00
exclude(group: 'com.vaadin', module: 'vaadin-sass-compiler')
}
2014-10-13 22:36:40 +08:00
// compile(group: 'com.vaadin', name: 'vaadin-themes', version: vaadinVersion)
2013-10-19 18:40:54 +08:00
/* Vaadin addons */
compile(group: 'com.haulmont.thirdparty', name: 'appletintegration', version: '1.2.10')
compile(group: 'com.haulmont.thirdparty', name: 'popupbutton', version: '2.5.1')
2014-04-08 21:32:28 +08:00
compile(group: 'org.vaadin.addons', name: 'aceeditor', version: '0.8.11')
2011-11-17 16:31:31 +08:00
2013-02-06 23:14:40 +08:00
provided(servletApi)
2014-12-05 19:56:06 +08:00
2014-12-05 19:47:32 +08:00
testCompile(clientModule.sourceSets.test.output)
2014-12-08 16:45:59 +08:00
testCompile(guiModule.sourceSets.test.output)
testRuntime(servletApi)
2011-11-17 16:31:31 +08:00
}
task enhanceTransient(type: CubaEnhanceTransient) {
metadataXml = "$webModule.projectDir/src/cuba-web-metadata.xml"
}
jar {
from sourceSets.main.allJava
}
task buildScssThemes(type: CubaWebScssThemeCreation) {
2014-10-13 22:36:40 +08:00
themes = ['halo', 'havana']
2014-10-15 17:43:55 +08:00
// compress = true
// sprites = true
// cleanup = true
2014-10-13 22:36:40 +08:00
}
task buildHalo(type: CubaWebScssThemeCreation) {
themes = ['halo']
2014-10-15 17:43:55 +08:00
// compress = true
// sprites = true
// cleanup = true
2014-10-13 22:36:40 +08:00
}
task deployHalo(type: Copy, dependsOn: buildHalo) {
from file("$webModule.buildDir/web/VAADIN/themes/halo")
into "${project.tomcatDir}/webapps/cuba/VAADIN/themes/halo"
exclude '**/web.xml'
2011-11-17 16:31:31 +08:00
}
2013-02-06 23:14:40 +08:00
def webOutDir = file("$buildDir/web")
task webArchive(dependsOn: buildScssThemes, type: Zip) {
2011-11-17 16:31:31 +08:00
from file('web')
from webOutDir
exclude '**/web.xml', '**/app.properties'
classifier = 'web'
}
artifacts {
archives webArchive
}
task deploy(dependsOn: assemble, type: CubaDeployment) {
appName = 'cuba'
2013-10-19 18:40:54 +08:00
appJars('cuba-global', 'cuba-client', 'cuba-gui', 'cuba-web', 'cuba-web-auth',
2014-10-13 22:36:40 +08:00
'vaadin-server', 'vaadin-shared-deps', 'vaadin-shared', 'vaadin-themes',
'aceeditor', 'popupbutton', 'appletintegration')
2011-11-17 16:31:31 +08:00
}
2013-02-06 23:14:40 +08:00
2011-11-17 16:31:31 +08:00
deploy << {
2013-02-06 23:14:40 +08:00
copy {
from "$buildDir/web"
into "$tomcatDir/webapps/cuba"
}
}
}
configure(webModuleThemes) {
apply(plugin: 'java')
apply(plugin: 'maven')
apply(plugin: 'cuba')
buildDir = file('../build/scss-themes')
sourceSets {
main {
java {
srcDir '.'
}
resources {
srcDir '.'
}
}
}
}
configure(webAuthModule) {
dependencies {
compile(globalModule)
2014-08-25 19:14:57 +08:00
compile(group: 'org.springframework', name: 'spring-tx', version: springVersion)
compile(group: 'org.springframework.ldap', name: 'spring-ldap-core', version: '2.0.2.RELEASE') {
exclude(group: 'org.slf4j', module: 'jcl-over-slf4j') // removed because it defines its own Log4j LogFactory via JDK services mechanism
}
compile(group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5')
2014-08-25 19:14:57 +08:00
provided(servletApi)
}
}
2013-02-06 23:14:40 +08:00
configure(webToolkitModule) {
dependencies {
compile(webModule)
compile(vaadinClient)
compile(vaadinCompiler)
// Uncomment for SuperDevMode debug
// compile(servletApi)
2013-02-06 23:14:40 +08:00
}
task buildWidgetSet(type: CubaWidgetSetBuilding) {
widgetSetClass = 'com.haulmont.cuba.web.toolkit.ui.WidgetSet'
// Debug flags:
// draft = true
// compilerArgs = ['-style': 'DETAILED']
// Performance and widgetset size:
// disableCastChecking = true
}
jar {
from sourceSets.main.allJava
2013-02-06 23:14:40 +08:00
}
task webArchive(dependsOn: buildWidgetSet, type: Zip) {
from file("$buildDir/web")
2013-02-06 23:14:40 +08:00
classifier = 'web'
}
artifacts {
archives webArchive
}
task deploy(dependsOn: buildWidgetSet) << {
2011-11-17 16:31:31 +08:00
delete {
"$tomcatDir/webapps/cuba/VAADIN/widgetsets"
}
copy {
from "$buildDir/web"
into "$tomcatDir/webapps/cuba"
}
}
}
configure(desktopModule) {
apply(plugin: 'application')
mainClassName = 'com.haulmont.cuba.desktop.App'
dependencies {
compile(guiModule)
2012-02-16 21:42:05 +08:00
compile(group: 'com.miglayout', name: 'miglayout-swing', version: '4.2')
2011-11-17 16:31:31 +08:00
compile(group: 'com.haulmont.thirdparty', name: 'glazedlists', version: '1.9.20110801')
compile(group: 'com.haulmont.thirdparty', name: 'swingx-core', version: '1.6.5-1')
2011-11-17 16:31:31 +08:00
2012-01-19 18:52:03 +08:00
assemble.dependsOn = [classes]
2014-12-08 16:45:59 +08:00
testCompile(clientModule.sourceSets.test.output)
testCompile(guiModule.sourceSets.test.output)
testRuntime(servletApi)
2011-11-17 16:31:31 +08:00
}
installApp {
into("$buildDir/app/" + applicationName)
}
task desktopInstall(dependsOn: assemble) << {
jar.execute()
startScripts.execute()
installApp.execute()
}
task desktopDist(dependsOn: assemble) << {
distZip.execute()
}
task desktopStart(dependsOn: desktopInstall) << {
run.execute()
}
}
configure(portalModule) {
apply(plugin: 'groovy')
sourceSets {
main {
groovy { srcDir 'src' }
}
}
dependencies {
compile(globalModule)
compile(clientModule)
compile(sharedLibModule)
provided(servletApi)
compile(group: 'org.springframework', name: 'spring-webmvc', version: springVersion)
compile(group: 'org.springframework.security', name: 'spring-security-core', version: springSecurityVersion)
compile(group: 'org.springframework.security', name: 'spring-security-web', version: springSecurityVersion)
compile(group: 'org.springframework.security', name: 'spring-security-config', version: springSecurityVersion)
compile(group: 'org.springframework.security', name: 'spring-security-taglibs', version: springSecurityVersion)
2013-01-15 23:51:34 +08:00
compile(group: 'org.json', name: 'json', version: '20090211')
compile(groovyArtifact)
compile(asm)
2013-10-19 18:40:54 +08:00
compile(group: 'org.springframework', name: 'spring-tx', version: springVersion)
compile(group: 'org.springframework', name: 'spring-jdbc', version: springVersion)
testCompile(clientModule.sourceSets.test.output)
}
test {
scanForTestClasses = false
includes = ['**/*Test.class']
}
}
2013-10-19 18:40:54 +08:00
configure(webLegacyModule) {
dependencies {
compile(sharedLibModule)
compile(guiModule)
compile(webAuthModule)
compile(commonsUpload)
compile(casClient)
compile(group: 'org.springframework', name: 'spring-webmvc', version: springVersion)
compile(vaadinLegacy)
compile(popupButtonLegacy)
compile(appletIntegrationLegacy)
2013-10-19 18:40:54 +08:00
provided(webToolkitLegacyModule)
provided(servletApi)
2014-12-08 16:45:59 +08:00
testCompile(clientModule.sourceSets.test.output)
testCompile(guiModule.sourceSets.test.output)
testRuntime(servletApi)
2013-10-19 18:40:54 +08:00
}
task enhanceTransient(type: CubaEnhanceTransient) {
metadataXml = "$webLegacyModule.projectDir/src/cuba-web-metadata.xml"
}
task buildScssThemes(type: CubaWebScssThemeCreation) {
themes = ['havana']
destDir = "${project.buildDir}/web/VAADIN/themes"
// compress = true
sprites = false
// cleanup = true
}
2013-10-19 18:40:54 +08:00
File webOutDir = new File("$buildDir/web")
task buildWidgetSet(dependsOn: compileJava, type: CubaVaadinLegacyBuilding) {
widgetSetsDir = "$webOutDir/VAADIN/widgetsets"
widgetSetModules = [webToolkitLegacyModule]
widgetSetClass = 'com.haulmont.cuba.toolkit.gwt.WidgetSet'
// jvmArgs('-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000')
// compilerArgs = ['-style' : 'PRETTY', '-localWorkers' : '2']
}
task webArchive(dependsOn: [buildWidgetSet, buildScssThemes], type: Zip) {
2013-10-19 18:40:54 +08:00
from file('web')
from webOutDir
exclude '**/web.xml', '**/app.properties'
classifier = 'web'
}
artifacts {
archives webArchive
}
task deploy(dependsOn: assemble, type: CubaDeployment) {
appName = 'cuba6'
appJars('cuba-global', 'cuba-client', 'cuba-gui', 'cuba-web-auth', 'cuba-web6',
'vaadin', 'popupbutton', 'appletintegration')
2013-10-19 18:40:54 +08:00
}
deploy << {
delete {
"$tomcatDir/webapps/cuba6/VAADIN/widgetsets"
2013-10-19 18:40:54 +08:00
}
copy {
from "$buildDir/web"
into "$tomcatDir/webapps/cuba6"
2013-10-19 18:40:54 +08:00
}
}
jar {
manifest {
attributes("Vaadin-Widgetsets": "com.haulmont.cuba.toolkit.gwt.WidgetSet")
}
}
}
configure(webLegacyModuleThemes) {
apply(plugin: 'java')
apply(plugin: 'maven')
apply(plugin: 'cuba')
buildDir = file('../build/scss-themes')
sourceSets {
main {
java {
srcDir '.'
}
resources {
srcDir '.'
}
}
}
}
2013-10-19 18:40:54 +08:00
configure(webToolkitLegacyModule) {
dependencies {
compile(vaadinLegacy)
compile(popupButtonLegacy)
compile(appletIntegrationLegacy)
2013-10-19 18:40:54 +08:00
compile(gwtUser)
compile(gwtDev)
compile(gwtServlets)
compile(validationApi)
compile(validationApi + ['classifier' : 'sources'])
2013-10-19 18:40:54 +08:00
}
jar {
manifest {
attributes("Vaadin-Widgetsets": "com.haulmont.cuba.toolkit.gwt.WidgetSet")
}
}
}
task restart(dependsOn: ['stop', ':cuba-core:deploy', ':cuba-web:deploy', ':cuba-web6:deploy'], description: 'Redeploys applications and restarts local Tomcat') << {
2011-11-17 16:31:31 +08:00
ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
not {
socket(server: 'localhost', port: '8787')
}
}
start.execute()
}