2011-05-13 13:04:18 +08:00
|
|
|
/*
|
2011-07-07 18:09:34 +08:00
|
|
|
* Copyright (c) 2011 Haulmont Technology Ltd. All Rights Reserved.
|
|
|
|
* Haulmont Technology proprietary and confidential.
|
|
|
|
* Use is subject to license terms.
|
|
|
|
*/
|
2011-05-13 13:04:18 +08:00
|
|
|
|
|
|
|
allprojects {
|
|
|
|
artifactGroup = 'com.haulmont.cuba'
|
2011-09-19 19:10:02 +08:00
|
|
|
artifactVersion = '3.1'
|
2011-05-13 13:04:18 +08:00
|
|
|
isSnapshot = true
|
|
|
|
//tomcatDir = rootDir.absolutePath + '/../tomcat'
|
|
|
|
}
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials(
|
|
|
|
'Sonatype Nexus Repository Manager',
|
|
|
|
'repository.haulmont.com',
|
|
|
|
System.getenv('HAULMONT_REPOSITORY_USER'),
|
|
|
|
System.getenv('HAULMONT_REPOSITORY_PASSWORD')
|
|
|
|
)
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
2011-11-10 21:35:45 +08:00
|
|
|
mavenRepo(url: "http://repository.haulmont.com:8587/nexus/content/groups/work")
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
dependencies {
|
2011-11-10 21:35:45 +08:00
|
|
|
classpath group: 'com.haulmont.gradle', name: 'cuba-plugin', version: '1.1-SNAPSHOT'
|
2011-05-13 13:04:18 +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 webToolkitModule = project(':cuba-web-toolkit')
|
|
|
|
def webModule = project(':cuba-web')
|
|
|
|
def desktopModule = project(':cuba-desktop')
|
2011-07-11 20:20:09 +08:00
|
|
|
def uiTestModule = project(':cuba-test-ui')
|
2011-05-13 13:04:18 +08:00
|
|
|
|
|
|
|
def servletApi = [group: 'org.apache.tomcat', name: 'servlet-api', version: '6.0.20']
|
2011-07-11 18:21:32 +08:00
|
|
|
def vaadin = [group: 'com.haulmont.thirdparty', name: 'vaadin', version: '6.6.1.91']
|
2011-05-13 13:04:18 +08:00
|
|
|
def popupbutton = [group: 'com.haulmont.thirdparty', name: 'popupbutton', version: '1.0.0']
|
2011-07-01 13:59:04 +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']
|
2011-06-08 19:56:44 +08:00
|
|
|
def groovyArtifact = [group: 'com.haulmont.thirdparty', name: 'groovy', version: '1.7.5.20101124']
|
|
|
|
def asm = [group: 'asm', name: 'asm', version: '3.2']
|
2011-08-30 19:58:09 +08:00
|
|
|
def poi = [group: 'com.haulmont.thirdparty', name: 'poi', version: '3.7.20110830']
|
2011-05-13 13:04:18 +08:00
|
|
|
def postgres = [group: 'postgresql', name: 'postgresql', version: '8.3-603.jdbc4']
|
|
|
|
def hsqldb = [group: 'hsqldb', name: 'hsqldb', version: '1.8.0.10']
|
|
|
|
|
|
|
|
configure([sharedLibModule, globalModule, coreModule, clientModule, guiModule, webToolkitModule,
|
2011-07-11 20:20:09 +08:00
|
|
|
webModule, desktopModule, uiTestModule]) {
|
2011-05-13 13:04:18 +08:00
|
|
|
apply(plugin: 'java')
|
|
|
|
apply(plugin: 'idea')
|
|
|
|
apply(plugin: 'maven')
|
2011-09-21 16:23:23 +08:00
|
|
|
apply(plugin: 'code-quality')
|
2011-05-13 13:04:18 +08:00
|
|
|
apply(plugin: 'cuba')
|
|
|
|
|
|
|
|
dependencies {
|
2011-09-19 19:10:02 +08:00
|
|
|
compile(group: 'com.haulmont.bali', name: 'bali', version: '3.1-SNAPSHOT')
|
|
|
|
compile(group: 'com.haulmont.chile', name: 'chile-core', version: '3.1-SNAPSHOT')
|
|
|
|
compile(group: 'com.haulmont.chile', name: 'chile-jpa', version: '3.1-SNAPSHOT')
|
2011-07-11 20:18:07 +08:00
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
compile(group: 'antlr', name: 'antlr', version: '2.7.7')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'aopalliance', name: 'aopalliance', version: '1.0')
|
2011-06-08 19:56:44 +08:00
|
|
|
compile(asm)
|
2011-05-13 13:04:18 +08:00
|
|
|
compile(group: 'com.google.guava', name: 'guava', version: 'r07')
|
2011-08-01 17:09:09 +08:00
|
|
|
compile(group: 'org.apache.openjpa', name: 'openjpa', version: '2.1.1')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'commons-cli', name: 'commons-cli', version: '1.2')
|
2011-05-30 22:29:15 +08:00
|
|
|
compile(group: 'commons-pool', name: 'commons-pool', version: '1.5.1')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'net.sourceforge.serp', name: 'serp', version: '1.13.1')
|
|
|
|
compile(group: 'org.antlr', name: 'antlr-runtime', version: '3.2')
|
|
|
|
compile(group: 'org.freemarker', name: 'freemarker', version: '2.3.16')
|
2011-05-13 13:04:18 +08:00
|
|
|
compile(group: 'org.perf4j', name: 'perf4j', version: '0.9.10')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'org.springframework', name: 'spring-beans', version: '3.0.5.RELEASE')
|
|
|
|
compile(group: 'org.springframework', name: 'spring-context', version: '3.0.5.RELEASE')
|
|
|
|
compile(group: 'org.springframework', name: 'spring-web', version: '3.0.5.RELEASE')
|
2011-07-13 19:45:48 +08:00
|
|
|
compile(group: 'org.springframework', name: 'spring-orm', version: '3.0.5.RELEASE')
|
2011-05-13 13:04:18 +08:00
|
|
|
|
2011-09-19 20:04:32 +08:00
|
|
|
testCompile(group: 'com.haulmont.thirdparty', name: 'jmockit', version: '0.999.10')
|
2011-05-13 13:04:18 +08:00
|
|
|
testCompile(group: 'junit', name: 'junit', version: '4.5')
|
|
|
|
}
|
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
from file('src')
|
|
|
|
classifier = 'sources'
|
2011-07-11 20:18:07 +08:00
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourceJar
|
|
|
|
}
|
2011-09-21 16:23:23 +08:00
|
|
|
|
|
|
|
String checkstyleConfigDir = '../../config/checkstyle'
|
|
|
|
checkstyleConfigFileName = "$checkstyleConfigDir/checkstyle.xml"
|
|
|
|
checkstyleProperties.checkstyleConfigDir = checkstyleConfigFile.parentFile // Required for suppressions.xml linking
|
|
|
|
checkstyleMain << {
|
|
|
|
def checkstyleDir = "${project.buildDir}/checkstyle".toString()
|
2011-09-21 18:17:01 +08:00
|
|
|
ant.xslt('in': "$checkstyleDir/main.xml", out: "$checkstyleDir/$project.name-checkstyle.html", style: "$checkstyleConfigDir/checkstyle.xsl")
|
2011-09-21 16:23:23 +08:00
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(sharedLibModule) {
|
|
|
|
dependencies {
|
|
|
|
jdbc(postgres)
|
|
|
|
jdbc(hsqldb)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(globalModule) {
|
2011-11-15 16:52:40 +08:00
|
|
|
task enhance(type: CubaEnhancing) {
|
2011-05-13 13:04:18 +08:00
|
|
|
persistenceXml = "$globalModule.projectDir/src/cuba-persistence.xml"
|
|
|
|
}
|
2011-11-15 16:52:40 +08:00
|
|
|
compileJava << {
|
|
|
|
enhance.execute()
|
|
|
|
|
2011-07-07 18:09:34 +08:00
|
|
|
Date releaseDate = new Date()
|
|
|
|
String timeStamp = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(releaseDate)
|
|
|
|
|
|
|
|
File releaseFile = new File("$buildDir/classes/main/com/haulmont/cuba/core/global/release.timestamp")
|
|
|
|
releaseFile.delete()
|
|
|
|
releaseFile.write(timeStamp)
|
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(coreModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(sharedLibModule)
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'ooo-bootstrapconnector', version: '3.0.0')
|
2011-06-23 20:25:08 +08:00
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'xstream', version: '1.3.1.20100706')
|
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'core-renderer', version: 'R8')
|
2011-05-24 21:17:31 +08:00
|
|
|
runtime(group: 'xpp3', name: 'xpp3_min', version: '1.1.4c')
|
2011-07-05 14:16:35 +08:00
|
|
|
compile(group: 'com.lowagie', name: 'itext', version: '2.1.0') {
|
|
|
|
exclude(group: 'bouncycastle', module: 'bcmail-jdk14')
|
|
|
|
exclude(group: 'bouncycastle', module: 'bcprov-jdk14')
|
|
|
|
}
|
2011-08-05 21:26:41 +08:00
|
|
|
compile(group: 'org.jgroups', name: 'jgroups', version: '2.12.1.Final')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'org.apache.commons', name: 'commons-compress', version: '1.1')
|
2011-06-08 19:56:44 +08:00
|
|
|
compile(poi)
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'org.aspectj', name: 'aspectjrt', version: '1.6.6')
|
|
|
|
compile(group: 'org.aspectj', name: 'aspectjweaver', version: '1.6.6')
|
2011-05-13 13:04:18 +08:00
|
|
|
compile(group: 'org.mybatis', name: 'mybatis', version: '3.0.4')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'org.mybatis', name: 'mybatis-spring', version: '1.0.0')
|
2011-05-27 23:55:36 +08:00
|
|
|
compile(group: 'org.json', name: 'json', version: '20090211')
|
|
|
|
compile(group: 'org.openoffice', name: 'juh', version: '3.0.0')
|
2011-07-11 20:18:07 +08:00
|
|
|
compile(group: 'org.openoffice', name: 'ridl', version: '3.0.0')
|
|
|
|
compile(group: 'org.openoffice', name: 'unoil', version: '3.0.0')
|
|
|
|
compile(group: 'org.springframework', name: 'spring-context-support', version: '3.0.5.RELEASE')
|
2011-05-19 22:47:16 +08:00
|
|
|
compile(group: 'org.springframework', name: 'spring-tx', version: '3.0.5.RELEASE')
|
|
|
|
compile(group: 'org.springframework', name: 'spring-webmvc', version: '3.0.5.RELEASE')
|
2011-05-13 13:04:18 +08:00
|
|
|
|
|
|
|
provided(servletApi)
|
|
|
|
|
|
|
|
jdbc(postgres)
|
|
|
|
jdbc(hsqldb)
|
2011-07-05 16:59:35 +08:00
|
|
|
|
|
|
|
testRuntime(servletApi)
|
|
|
|
testRuntime(hsqldb)
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['**/*Test.class']
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task testsJar(dependsOn: testClasses, type: Jar) {
|
2011-11-10 21:35:45 +08:00
|
|
|
from sourceSets.main.output.classesDir
|
|
|
|
from sourceSets.test.output.classesDir
|
2011-11-11 16:26:22 +08:00
|
|
|
from sourceSets.main.output.resourcesDir
|
|
|
|
from sourceSets.test.output.resourcesDir
|
2011-05-13 13:04:18 +08:00
|
|
|
classifier = 'tests'
|
|
|
|
}
|
|
|
|
|
|
|
|
assembleDbScripts << {
|
|
|
|
copy {
|
2011-07-05 13:34:27 +08:00
|
|
|
from new File(projectDir, 'db')
|
2011-05-13 13:04:18 +08:00
|
|
|
into "$buildDir/db/10-cuba"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives testsJar
|
|
|
|
}
|
|
|
|
|
|
|
|
task deploy(dependsOn: assemble, type: CubaDeployment) {
|
|
|
|
appName = 'cuba-core'
|
|
|
|
appJars('bali', 'chile-core', 'chile-jpa', 'cuba-global', 'cuba-core')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(clientModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
}
|
2011-09-19 21:32:12 +08:00
|
|
|
|
|
|
|
task testsJar(dependsOn: testClasses, type: Jar) {
|
2011-11-10 21:35:45 +08:00
|
|
|
from sourceSets.main.output.classesDir
|
|
|
|
from sourceSets.test.output.classesDir
|
2011-09-19 21:32:12 +08:00
|
|
|
classifier = 'tests'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives testsJar
|
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(guiModule) {
|
|
|
|
apply(plugin: 'groovy')
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
groovy { srcDir 'src' }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(clientModule)
|
2011-06-08 19:56:44 +08:00
|
|
|
compile(poi)
|
2011-07-04 22:52:40 +08:00
|
|
|
compile(group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.0.1')
|
2011-06-08 19:56:44 +08:00
|
|
|
groovy(groovyArtifact)
|
|
|
|
groovy(asm)
|
2011-11-11 15:06:36 +08:00
|
|
|
|
|
|
|
testCompile(clientModule.sourceSets.test.output)
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
2011-07-11 20:18:07 +08:00
|
|
|
|
2011-07-05 16:59:35 +08:00
|
|
|
test {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['**/*Test.class']
|
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(webToolkitModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(vaadin)
|
|
|
|
compile(popupbutton)
|
|
|
|
|
|
|
|
provided(gwtUser)
|
|
|
|
provided(gwtDev)
|
2011-07-01 13:59:04 +08:00
|
|
|
provided(gwtServlets)
|
|
|
|
provided(validationApi)
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes("Vaadin-Widgetsets": "com.haulmont.cuba.toolkit.gwt.WidgetSet")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(webModule) {
|
2011-07-01 13:59:04 +08:00
|
|
|
configurations {
|
|
|
|
gwtBuilding
|
|
|
|
}
|
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
dependencies {
|
|
|
|
compile(sharedLibModule)
|
|
|
|
compile(globalModule)
|
|
|
|
compile(clientModule)
|
|
|
|
compile(guiModule)
|
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'jespa', version: '1.0.7')
|
|
|
|
compile(group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2.2')
|
|
|
|
compile(group: 'org.jasig.cas', name: 'cas-client-core', version: '3.1.10')
|
|
|
|
compile(group: 'org.springframework', name: 'spring-webmvc', version: '3.0.5.RELEASE')
|
|
|
|
compile(vaadin)
|
|
|
|
compile(popupbutton)
|
|
|
|
|
|
|
|
runtime(group: 'com.haulmont.thirdparty', name: 'jcifs', version: '1.3.10')
|
|
|
|
|
|
|
|
provided(webToolkitModule)
|
|
|
|
provided(gwtUser)
|
|
|
|
provided(gwtDev)
|
2011-07-01 13:59:04 +08:00
|
|
|
provided(gwtServlets)
|
|
|
|
provided(validationApi)
|
2011-05-13 13:04:18 +08:00
|
|
|
provided(servletApi)
|
2011-07-11 20:18:07 +08:00
|
|
|
|
2011-07-01 13:59:04 +08:00
|
|
|
gwtBuilding(validationApi + [classifier: 'sources'])
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes("Vaadin-Widgetsets": "com.haulmont.cuba.toolkit.gwt.WidgetSet")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task buildThemes(dependsOn: compileJava) << {
|
|
|
|
File outDir = new File("$buildDir/web/VAADIN/themes")
|
|
|
|
outDir.mkdirs()
|
|
|
|
copy {
|
|
|
|
from 'css/VAADIN/themes'
|
|
|
|
into outDir
|
2011-10-21 22:35:08 +08:00
|
|
|
// include 'blacklabel/**'
|
2011-05-13 13:04:18 +08:00
|
|
|
include 'peyto/**'
|
|
|
|
}
|
|
|
|
|
|
|
|
ant.taskdef(name: 'buildTheme', classname: 'com.haulmont.cuba.ant.BuildThemeTask', classpath: configurations.provided.asPath)
|
2011-10-21 22:35:08 +08:00
|
|
|
// ant.buildTheme(themeDir: new File(outDir, '/blacklabel'), destFile: 'styles-include.css')
|
2011-05-13 13:04:18 +08:00
|
|
|
ant.buildTheme(themeDir: new File(outDir, '/peyto'), destFile: 'styles-include.css')
|
|
|
|
}
|
|
|
|
|
|
|
|
File webOutDir = new File("$buildDir/web")
|
|
|
|
|
|
|
|
task buildGwt(dependsOn: buildThemes) << {
|
|
|
|
File widgetsetsDir = new File(webOutDir, "VAADIN/widgetsets")
|
|
|
|
File webToolkitSrcDir = new File(webToolkitModule.projectDir, 'src')
|
2011-07-11 20:18:07 +08:00
|
|
|
|
2011-07-01 13:59:04 +08:00
|
|
|
def gwtBuildingArtifacts = configurations.gwtBuilding.resolvedConfiguration.getResolvedArtifacts()
|
|
|
|
File validationSrcDir = gwtBuildingArtifacts.find { a-> a.name == 'validation-api' }.file
|
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
if (!widgetsetsDir.exists()) {
|
|
|
|
javaexec {
|
|
|
|
main = 'com.google.gwt.dev.Compiler'
|
2011-11-10 21:35:45 +08:00
|
|
|
classpath(validationSrcDir, webToolkitSrcDir, webToolkitModule.sourceSets.main.output.classesDir, sourceSets.main.compileClasspath, sourceSets.main.output.classesDir)
|
2011-05-13 13:04:18 +08:00
|
|
|
args('-war', widgetsetsDir.absolutePath, '-style', 'OBF', 'com.haulmont.cuba.toolkit.gwt.WidgetSet')
|
|
|
|
jvmArgs('-Xmx512m', '-Xss8m', '-XX:MaxPermSize=256m', '-Djava.awt.headless=true')
|
|
|
|
}
|
2011-08-16 21:18:27 +08:00
|
|
|
ant.delete(dir: new File(widgetsetsDir, 'WEB-INF'))
|
2011-05-13 13:04:18 +08:00
|
|
|
} else {
|
|
|
|
println "Widgetsets dir exists, skip build GWT"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assemble.dependsOn buildGwt
|
|
|
|
|
|
|
|
task webArchive(dependsOn: buildGwt, type: Zip) {
|
|
|
|
from file('web')
|
|
|
|
from webOutDir
|
|
|
|
exclude '**/web.xml', '**/app.properties'
|
|
|
|
classifier = 'web'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives webArchive
|
|
|
|
}
|
|
|
|
|
|
|
|
task deploy(dependsOn: assemble, type: CubaDeployment) {
|
|
|
|
appName = 'cuba'
|
|
|
|
appJars('bali', 'chile-core', 'chile-jpa', 'cuba-global', 'cuba-client', 'cuba-gui', 'cuba-web')
|
|
|
|
}
|
|
|
|
deploy << {
|
|
|
|
delete {
|
|
|
|
"$tomcatDir/webapps/cuba/VAADIN/widgetsets"
|
|
|
|
}
|
|
|
|
copy {
|
|
|
|
from "$buildDir/web"
|
|
|
|
into "$tomcatDir/webapps/cuba"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(desktopModule) {
|
2011-07-13 18:56:24 +08:00
|
|
|
apply(plugin: 'application')
|
|
|
|
mainClassName = 'com.haulmont.cuba.desktop.App'
|
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(clientModule)
|
|
|
|
compile(guiModule)
|
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'miglayout', version: '3.7.4')
|
2011-08-01 15:58:54 +08:00
|
|
|
compile(group: 'com.haulmont.thirdparty', name: 'glazedlists', version: '1.9.20110801')
|
2011-06-06 17:39:06 +08:00
|
|
|
compile(group: 'org.swinglabs', name: 'swingx-core', version: '1.6.2-2')
|
2011-05-19 22:47:16 +08:00
|
|
|
runtime(group: 'org.springframework', name: 'spring-tx', version: '3.0.5.RELEASE')
|
2011-07-13 18:56:24 +08:00
|
|
|
|
|
|
|
assemble.dependsOn = [ classes ]
|
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-11 20:20:09 +08:00
|
|
|
configure(uiTestModule) {
|
2011-07-11 20:18:07 +08:00
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
task restart(dependsOn: ['stop', ':cuba-core:deploy', ':cuba-web:deploy'], description: 'Redeploys applications and restarts local Tomcat') << {
|
|
|
|
ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
|
|
|
|
not {
|
|
|
|
socket(server: 'localhost', port: '8787')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
start.execute()
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************** Database related stuff *****************************/
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
jdbc
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
jdbc(hsqldb)
|
|
|
|
}
|
|
|
|
|
|
|
|
def dbName = 'cubadb'
|
|
|
|
def File dbDataDir = file('data')
|
2011-07-05 13:34:27 +08:00
|
|
|
def File dbSqlDir = file('modules/core/db/init/sql')
|
2011-05-13 13:04:18 +08:00
|
|
|
def dbClasspath = configurations.jdbc.fileCollection{ true }.asPath
|
|
|
|
|
|
|
|
task startDb(description: 'Starts local HSQLDB server') << {
|
|
|
|
dbDataDir.mkdirs()
|
2011-05-18 16:17:55 +08:00
|
|
|
if ('linux'.equalsIgnoreCase(System.getProperty('os.name'))) {
|
|
|
|
ant.exec(dir: dbDataDir.absolutePath, executable: '/bin/sh', spawn: true) {
|
2011-07-05 13:34:27 +08:00
|
|
|
arg(line: "$projectDir/modules/core/db/run-hsqldb.sh $dbClasspath $dbName")
|
2011-05-18 16:17:55 +08:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ant.exec(dir: dbDataDir.absolutePath, executable: 'cmd.exe', spawn: true) {
|
2011-07-05 13:34:27 +08:00
|
|
|
arg(line: "/c start $projectDir/modules/core/db/run-hsqldb.bat $dbClasspath $dbName")
|
2011-05-18 16:17:55 +08:00
|
|
|
}
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
2011-07-05 17:19:01 +08:00
|
|
|
Thread.sleep(1000)
|
2011-05-13 13:04:18 +08:00
|
|
|
}
|
|
|
|
|
2011-07-05 16:59:35 +08:00
|
|
|
task stopDb(description: 'Stops local HSQLDB server') << {
|
|
|
|
try {
|
|
|
|
ant.sql(classpath: dbClasspath, delimiter: ";",
|
|
|
|
driver: 'org.hsqldb.jdbcDriver',
|
|
|
|
url: "jdbc:hsqldb:hsql://localhost/$dbName",
|
|
|
|
userid: 'sa', password: '',
|
|
|
|
autocommit: true,
|
|
|
|
'shutdown'
|
|
|
|
)
|
|
|
|
Thread.sleep(1000)
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.warn(">>> error stopping local HSQLDB server: $e")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-13 13:04:18 +08:00
|
|
|
task removeDb(description: 'Removes local HSQL database') << {
|
|
|
|
delete {
|
|
|
|
dbDataDir
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task createDb(description: 'Creates local HSQL database') << {
|
|
|
|
ant.sql(classpath: dbClasspath, src: "$dbSqlDir/create-db.sql", delimiter: ";",
|
|
|
|
driver: 'org.hsqldb.jdbcDriver',
|
|
|
|
url: "jdbc:hsqldb:hsql://localhost/$dbName",
|
|
|
|
userid: 'sa', password: '',
|
|
|
|
autocommit: true
|
|
|
|
)
|
2011-05-18 16:17:55 +08:00
|
|
|
}
|