2011-12-07 19:01:29 +08:00
|
|
|
/*
|
2016-03-16 21:26:06 +08:00
|
|
|
* Copyright (c) 2008-2016 Haulmont.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*
|
2013-09-24 19:00:49 +08:00
|
|
|
*/
|
2013-01-11 23:19:15 +08:00
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
buildscript {
|
2018-05-31 19:26:30 +08:00
|
|
|
ext.cubaVersion = '7.0-SNAPSHOT'
|
2013-09-24 19:00:49 +08:00
|
|
|
ext.cubaVersion = rootProject.hasProperty('buildVersion') ? rootProject['buildVersion'] : cubaVersion
|
2018-09-15 03:29:33 +08:00
|
|
|
|
2013-09-24 19:00:49 +08:00
|
|
|
println("CUBA Platform Version ${ext.cubaVersion}")
|
|
|
|
println("")
|
2018-09-15 03:29:33 +08:00
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
maven {
|
|
|
|
credentials {
|
2016-03-24 17:39:31 +08:00
|
|
|
username System.getenv('HAULMONT_REPOSITORY_USER') ?: 'cuba'
|
|
|
|
password System.getenv('HAULMONT_REPOSITORY_PASSWORD') ?: 'cuba123'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2017-05-12 17:50:08 +08:00
|
|
|
url System.getenv('HAULMONT_REPOSITORY_URL') ?: 'https://repo.cuba-platform.com/content/groups/work'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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: 'cuba')
|
|
|
|
|
2017-03-10 16:00:30 +08:00
|
|
|
bom.load file('modules/global/src/com/haulmont/cuba/bom.properties')
|
|
|
|
|
2015-09-23 16:13:28 +08:00
|
|
|
cuba {
|
|
|
|
artifact {
|
|
|
|
group = 'com.haulmont.cuba'
|
2015-09-23 18:14:05 +08:00
|
|
|
version = project.cubaVersion.replace('-SNAPSHOT', '')
|
|
|
|
isSnapshot = project.cubaVersion.endsWith('-SNAPSHOT')
|
2015-09-23 16:13:28 +08:00
|
|
|
}
|
|
|
|
|
2018-08-03 18:38:25 +08:00
|
|
|
ide {
|
|
|
|
vcs = 'Git'
|
|
|
|
copyright = '''Copyright (c) 2008-$today.year Haulmont.
|
2016-03-16 19:16:50 +08:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
2018-08-03 18:38:25 +08:00
|
|
|
limitations under the License.'''
|
2015-09-23 16:13:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
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')
|
2012-08-23 18:47:25 +08:00
|
|
|
def portalModule = project(':cuba-portal')
|
2016-03-14 17:01:52 +08:00
|
|
|
def restApiModule = project(':cuba-rest-api')
|
2018-03-07 21:24:37 +08:00
|
|
|
def webWidgetsModule = project(':cuba-web-widgets')
|
2013-10-19 18:40:54 +08:00
|
|
|
def webToolkitModule = project(':cuba-web-toolkit')
|
|
|
|
def webModule = project(':cuba-web')
|
2017-03-29 15:34:56 +08:00
|
|
|
def uberJarModule = project(':cuba-uberjar')
|
2017-07-07 20:06:17 +08:00
|
|
|
def frontModule = project(':cuba-front')
|
2011-11-17 16:31:31 +08:00
|
|
|
|
2015-09-23 21:25:50 +08:00
|
|
|
def coreTestsModule = project(':cuba-core-tests')
|
|
|
|
def clientTestsModule = project(':cuba-client-tests')
|
2013-10-29 22:13:13 +08:00
|
|
|
|
2013-10-24 19:31:20 +08:00
|
|
|
configure([sharedLibModule, globalModule, coreModule, clientModule, guiModule,
|
2018-09-11 18:14:12 +08:00
|
|
|
webModule, desktopModule, portalModule, restApiModule, uberJarModule, frontModule]) {
|
2011-11-17 16:31:31 +08:00
|
|
|
apply(plugin: 'java')
|
2017-09-19 14:07:44 +08:00
|
|
|
apply(plugin: 'groovy')
|
2011-11-17 16:31:31 +08:00
|
|
|
apply(plugin: 'maven')
|
2018-03-02 18:05:29 +08:00
|
|
|
apply(plugin: 'cuba')
|
|
|
|
|
|
|
|
// code quality
|
2017-05-16 15:35:49 +08:00
|
|
|
apply(plugin: 'findbugs')
|
|
|
|
apply(plugin: 'pmd')
|
2011-11-17 16:31:31 +08:00
|
|
|
|
|
|
|
dependencies {
|
2016-11-09 18:38:05 +08:00
|
|
|
testCompile(bom['org.jmockit:jmockit'])
|
|
|
|
testCompile(bom['junit:junit'])
|
2017-09-19 14:07:44 +08:00
|
|
|
testCompile(bom['org.spockframework:spock-core']) {
|
|
|
|
exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
test {
|
2017-11-24 16:44:36 +08:00
|
|
|
java {
|
|
|
|
include '**/testmodel/**'
|
|
|
|
}
|
2017-09-19 14:07:44 +08:00
|
|
|
groovy {
|
2017-11-24 16:44:36 +08:00
|
|
|
exclude '**/testmodel/**'
|
2017-09-19 14:07:44 +08:00
|
|
|
srcDir 'test'
|
|
|
|
}
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
from file('src')
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourceJar
|
|
|
|
}
|
2013-08-15 19:23:20 +08:00
|
|
|
|
2015-09-14 16:06:15 +08:00
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes("Implementation-Version": cubaVersion)
|
|
|
|
}
|
|
|
|
}
|
2016-12-09 21:21:56 +08:00
|
|
|
|
|
|
|
test {
|
|
|
|
maxHeapSize = '256m'
|
2018-05-23 19:52:31 +08:00
|
|
|
systemProperties = [
|
2018-08-16 03:00:27 +08:00
|
|
|
'jdk.attach.allowAttachSelf' : 'true'
|
2018-05-23 19:52:31 +08:00
|
|
|
]
|
2018-08-16 03:00:27 +08:00
|
|
|
|
|
|
|
if (System.getProperty('logback.configurationFile')) {
|
|
|
|
systemProperty 'logback.configurationFile', System.getProperty('logback.configurationFile')
|
|
|
|
}
|
2016-12-09 21:21:56 +08:00
|
|
|
}
|
2017-01-27 19:09:47 +08:00
|
|
|
|
|
|
|
javadoc {
|
|
|
|
// move to plugin ?
|
|
|
|
options.addStringOption("sourcepath", "")
|
|
|
|
}
|
2017-05-16 15:35:49 +08:00
|
|
|
|
|
|
|
findbugs {
|
|
|
|
toolVersion = "3.0.1"
|
2017-05-18 15:24:39 +08:00
|
|
|
ignoreFailures = false
|
2017-05-16 15:35:49 +08:00
|
|
|
omitVisitors = ['FindDoubleCheck']
|
|
|
|
excludeFilter = rootProject.file("findbugs/exclude-filter.xml")
|
|
|
|
effort = "max"
|
|
|
|
reportLevel = "high"
|
|
|
|
}
|
|
|
|
|
|
|
|
findbugsMain {
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html {
|
|
|
|
enabled = true
|
|
|
|
stylesheet = rootProject.resources.text.fromFile("findbugs/fancy-hist.xsl")
|
2017-10-01 02:56:00 +08:00
|
|
|
destination file("${project.buildDir}/reports/findbugs/${project.name}.html")
|
2017-05-16 15:35:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
findbugsTest {
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html {
|
|
|
|
enabled = true
|
|
|
|
stylesheet = rootProject.resources.text.fromFile("findbugs/fancy-hist.xsl")
|
2017-10-01 02:56:00 +08:00
|
|
|
destination file("${project.buildDir}/reports/findbugs/test-${project.name}.html")
|
2017-05-16 15:35:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pmd {
|
|
|
|
ignoreFailures = true
|
|
|
|
sourceSets = [sourceSets.main]
|
|
|
|
reportsDir = file("${project.buildDir}/reports/pmd")
|
|
|
|
ruleSets = [
|
|
|
|
"java-basic",
|
|
|
|
"java-braces",
|
|
|
|
"java-design",
|
|
|
|
"java-unusedcode"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
pmdMain {
|
|
|
|
excludes = [
|
|
|
|
"**/JPAParser.java",
|
|
|
|
"**/JPA2Parser.java"
|
|
|
|
]
|
|
|
|
reports {
|
|
|
|
xml.enabled = true
|
|
|
|
html.enabled = false
|
|
|
|
}
|
|
|
|
source project.fileTree("src")
|
|
|
|
}
|
|
|
|
|
|
|
|
task pmdReport(dependsOn: pmdMain, group: 'verification', description:
|
2017-05-17 16:40:25 +08:00
|
|
|
'Generates a HTML report after executing PMD checks.') {
|
|
|
|
doLast {
|
|
|
|
ant.xslt(
|
2018-08-10 19:41:06 +08:00
|
|
|
'in': "${project.buildDir}/reports/pmd/main.xml",
|
|
|
|
'style': "${rootDir}/findbugs/pmd-nicerhtml.xsl",
|
|
|
|
'out': "${project.buildDir}/reports/pmd/main.html")
|
2017-05-17 16:40:25 +08:00
|
|
|
}
|
2017-05-16 15:35:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
check {
|
|
|
|
dependsOn += ['pmdReport']
|
|
|
|
}
|
2018-03-02 18:28:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Jacoco
|
2018-05-23 19:52:31 +08:00
|
|
|
//configure([sharedLibModule, globalModule, coreModule, clientModule, guiModule, webModule]) {
|
|
|
|
// apply(plugin: 'jacoco')
|
|
|
|
//
|
|
|
|
// jacoco {
|
|
|
|
// toolVersion = "0.8.0"
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// jacocoTestReport {
|
|
|
|
// reports {
|
|
|
|
// xml.enabled = true
|
|
|
|
// html.enabled = true
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// afterEvaluate {
|
|
|
|
// // without enhanced-classes output
|
|
|
|
// classDirectories = files(new File(project.buildDir, 'classes/java/main'))
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (rootProject.hasProperty('jacocoTeamcity')) {
|
|
|
|
// jacocoTestReport.doLast {
|
|
|
|
// println "##teamcity[jacocoReport dataPath='modules/${project.projectDir.name}/build/jacoco/test.exec' " +
|
|
|
|
// "includes='com.haulmont.cuba.*' " +
|
|
|
|
// "classpath='+:modules/${project.projectDir.name}/build/classes/java/main/**']"
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
2011-11-17 16:31:31 +08:00
|
|
|
|
2016-11-09 18:38:05 +08:00
|
|
|
// configure web toolkit module
|
2018-03-07 21:24:37 +08:00
|
|
|
configure([webWidgetsModule, webToolkitModule]) {
|
2013-10-24 19:31:20 +08:00
|
|
|
apply(plugin: 'java')
|
|
|
|
apply(plugin: 'maven')
|
|
|
|
apply(plugin: 'cuba')
|
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
from file('src')
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourceJar
|
|
|
|
}
|
2017-01-27 19:09:47 +08:00
|
|
|
|
|
|
|
javadoc {
|
|
|
|
// move to plugin ?
|
|
|
|
options.addStringOption("sourcepath", "")
|
|
|
|
}
|
2013-10-24 19:31:20 +08:00
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
configure(sharedLibModule) {
|
|
|
|
dependencies {
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['ch.qos.logback:logback-classic'])
|
|
|
|
compile(bom['org.slf4j:log4j-over-slf4j'])
|
|
|
|
|
|
|
|
jdbc(bom['org.postgresql:postgresql'])
|
|
|
|
jdbc(bom['org.hsqldb:hsqldb'])
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(globalModule) {
|
2011-11-22 19:42:09 +08:00
|
|
|
dependencies {
|
2018-08-02 18:39:21 +08:00
|
|
|
compile(bom['org.codehaus.groovy:groovy'])
|
|
|
|
compile(bom['org.codehaus.groovy:groovy-templates'])
|
|
|
|
compile(bom['org.codehaus.groovy:groovy-sql'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2018-04-04 04:21:57 +08:00
|
|
|
compile(bom['org.apache.commons:commons-lang3']) // simplify version management with reports and bpm
|
2017-08-04 23:37:59 +08:00
|
|
|
compile(bom['org.apache.commons:commons-collections4'])
|
2018-06-15 23:27:24 +08:00
|
|
|
compile(bom['org.apache.commons:commons-text'])
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['commons-io:commons-io'])
|
|
|
|
compile(bom['commons-cli:commons-cli'])
|
2017-08-05 20:24:04 +08:00
|
|
|
compile(bom['commons-codec:commons-codec'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.apache.httpcomponents:httpclient']) // simplify version management for selenium
|
|
|
|
compile(bom['org.apache.commons:commons-pool2'])
|
|
|
|
compile(bom['org.apache.commons:commons-compress'])
|
|
|
|
|
2018-05-23 19:52:31 +08:00
|
|
|
compile(bom['org.dom4j:dom4j'])
|
2018-04-04 04:21:57 +08:00
|
|
|
compile(bom['xml-apis:xml-apis']) // simplify version management with core
|
|
|
|
compile(bom['javax.activation:activation']) // simplify version management with core
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['com.sun.mail:javax.mail'])
|
|
|
|
compile(bom['ch.qos.logback:logback-classic'])
|
|
|
|
compile(bom['org.slf4j:log4j-over-slf4j'])
|
|
|
|
compile(bom['org.perf4j:perf4j'])
|
|
|
|
compile(bom['com.google.code.findbugs:jsr305'])
|
|
|
|
compile(bom['javax:javaee-api'])
|
2018-05-23 19:52:31 +08:00
|
|
|
compile(bom['javax.xml.bind:jaxb-api'])
|
|
|
|
compile(bom['org.glassfish.jaxb:jaxb-runtime'])
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['antlr:antlr'])
|
|
|
|
compile(bom['org.antlr:antlr-runtime'])
|
|
|
|
compile(bom['com.google.guava:guava'])
|
|
|
|
|
2018-05-23 19:52:31 +08:00
|
|
|
compile(bom['org.eclipse.persistence:org.eclipse.persistence.jpa'])
|
|
|
|
compile(bom['org.eclipse.persistence:org.eclipse.persistence.oracle'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.freemarker:freemarker'])
|
|
|
|
compile(bom['org.springframework:spring-core'])
|
|
|
|
compile(bom['org.springframework:spring-beans'])
|
|
|
|
compile(bom['org.springframework:spring-context'])
|
|
|
|
compile(bom['org.springframework:spring-web'])
|
|
|
|
|
|
|
|
compile(bom['com.esotericsoftware:kryo-shaded'])
|
|
|
|
compile(bom['de.javakaffee:kryo-serializers']) {
|
|
|
|
exclude(group: 'com.esotericsoftware', module: 'kryo')
|
|
|
|
}
|
|
|
|
|
|
|
|
compile(bom['org.json:json'])
|
|
|
|
compile(bom['com.google.code.gson:gson'])
|
2016-11-25 21:26:57 +08:00
|
|
|
compile(bom['org.hibernate:hibernate-validator'])
|
|
|
|
compile(bom['org.glassfish.web:javax.el'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2011-11-22 19:42:09 +08:00
|
|
|
}
|
|
|
|
|
2013-04-12 18:51:30 +08:00
|
|
|
task generateReleaseTimestamp(type: CubaReleaseTimeStamp) {
|
2018-03-29 15:28:32 +08:00
|
|
|
releaseTimeStampPath = "$buildDir/release-number/com/haulmont/cuba/core/global/release.timestamp"
|
|
|
|
releaseNumberPath = "$buildDir/release-number/com/haulmont/cuba/core/global/release.number"
|
|
|
|
}
|
|
|
|
// do not use classes directory, because it will break Gradle task UP-TO-DATE caching
|
|
|
|
jar {
|
|
|
|
from new File(project.buildDir, 'release-number')
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2013-04-09 18:15:55 +08:00
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
entitiesEnhancing {
|
|
|
|
main {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
}
|
2015-08-18 12:53:23 +08:00
|
|
|
|
|
|
|
task filterDummyEntities {
|
2016-07-19 22:23:11 +08:00
|
|
|
ext.srcFile1 = file('src/base-persistence.xml')
|
|
|
|
ext.srcFile2 = file('src/cuba-persistence.xml')
|
2015-08-18 12:53:23 +08:00
|
|
|
ext.dstDir = file("$buildDir/tmp/filtered")
|
2016-07-19 22:23:11 +08:00
|
|
|
ext.dstFile1 = new File(ext.dstDir, "base-persistence.xml")
|
|
|
|
ext.dstFile2 = new File(ext.dstDir, "cuba-persistence.xml")
|
|
|
|
inputs.file srcFile1
|
|
|
|
inputs.file srcFile2
|
|
|
|
outputs.file dstFile1
|
|
|
|
outputs.file dstFile2
|
2015-08-18 12:53:23 +08:00
|
|
|
doLast {
|
|
|
|
dstDir.mkdirs()
|
2016-07-19 22:23:11 +08:00
|
|
|
dstFile1.write(srcFile1.readLines().findAll{ !it.contains('.entity.dummy.') }.join('\n'))
|
|
|
|
dstFile2.write(srcFile2.readLines().findAll{ !it.contains('.entity.dummy.') }.join('\n'))
|
2015-08-18 12:53:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
exclude '**/entity/dummy/*'
|
2016-07-19 22:23:11 +08:00
|
|
|
exclude { it.file == file("$buildDir/resources/main/base-persistence.xml") }
|
2015-08-18 12:53:23 +08:00
|
|
|
exclude { it.file == file("$buildDir/resources/main/cuba-persistence.xml") }
|
|
|
|
from "$buildDir/tmp/filtered"
|
2016-06-21 21:59:41 +08:00
|
|
|
|
|
|
|
manifest {
|
2016-06-24 14:07:30 +08:00
|
|
|
attributes('App-Component-Id': cuba.artifact.group)
|
2016-06-21 21:59:41 +08:00
|
|
|
attributes('App-Component-Version': cubaVersion)
|
|
|
|
}
|
2015-08-18 12:53:23 +08:00
|
|
|
}
|
|
|
|
jar.dependsOn filterDummyEntities
|
|
|
|
|
|
|
|
sourceJar {
|
|
|
|
exclude '**/entity/dummy/*'
|
|
|
|
exclude {
|
2017-10-09 14:18:04 +08:00
|
|
|
(it.file.name == 'base-persistence.xml' || it.file.name == 'cuba-persistence.xml') && sourceSets.main.java.srcDirs.contains(it.file.parentFile)
|
2015-08-18 12:53:23 +08:00
|
|
|
}
|
|
|
|
from "$buildDir/tmp/filtered"
|
|
|
|
}
|
|
|
|
sourceJar.dependsOn filterDummyEntities
|
2017-05-18 15:24:39 +08:00
|
|
|
|
|
|
|
findbugsMain {
|
|
|
|
classes = classes.filter {
|
|
|
|
!it.path.contains(new File("com/haulmont/cuba/core/global/release.").path)
|
|
|
|
}
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(coreModule) {
|
2014-05-23 19:32:42 +08:00
|
|
|
configurations {
|
|
|
|
dbscripts
|
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(sharedLibModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['javax.validation:validation-api'])
|
2017-11-14 21:14:59 +08:00
|
|
|
compile(bom['com.thoughtworks.xstream:xstream'])
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['org.jgroups:jgroups'])
|
|
|
|
compile(bom['org.aspectj:aspectjrt'])
|
|
|
|
compile(bom['org.aspectj:aspectjweaver'])
|
|
|
|
compile(bom['org.mybatis:mybatis'])
|
|
|
|
compile(bom['org.mybatis:mybatis-spring'])
|
|
|
|
|
|
|
|
compile(bom['org.springframework:spring-context-support'])
|
|
|
|
compile(bom['org.springframework:spring-orm'])
|
|
|
|
compile(bom['org.springframework:spring-tx'])
|
|
|
|
compile(bom['org.springframework:spring-webmvc'])
|
|
|
|
|
2016-12-02 17:03:40 +08:00
|
|
|
compile(bom['org.apache.poi:poi']) // POI is actually not required by core, but remains here to simplify dependencies for reports project
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.jsoup:jsoup']) // simplify version management for fts
|
|
|
|
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
jdbc(bom['org.postgresql:postgresql'])
|
|
|
|
jdbc(bom['org.hsqldb:hsqldb'])
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(coreTestsModule)
|
2018-06-05 21:48:37 +08:00
|
|
|
testCompile(bom['org.hsqldb:hsqldb'])
|
2018-08-02 18:53:43 +08:00
|
|
|
|
|
|
|
testCompile(bom['org.codehaus.groovy:groovy-json'])
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
entitiesEnhancing {
|
|
|
|
test {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
}
|
2016-06-28 14:38:26 +08:00
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
test {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['**/*Test.class']
|
2016-11-18 18:17:43 +08:00
|
|
|
|
|
|
|
systemProperties = [
|
2018-05-23 19:52:31 +08:00
|
|
|
'jdk.attach.allowAttachSelf' : 'true'
|
2016-11-18 18:17:43 +08:00
|
|
|
]
|
2018-08-16 03:00:27 +08:00
|
|
|
|
|
|
|
if (System.getProperty('logback.configurationFile')) {
|
|
|
|
systemProperty 'logback.configurationFile', System.getProperty('logback.configurationFile')
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2016-06-28 14:38:26 +08:00
|
|
|
task testEntityCache(type: Test) {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['com/haulmont/cuba/entity_cache/EntityCacheTestSuite.class']
|
2018-07-26 22:31:49 +08:00
|
|
|
|
2018-08-16 03:00:27 +08:00
|
|
|
if (System.getProperty('logback.configurationFile')) {
|
|
|
|
systemProperty 'logback.configurationFile', System.getProperty('logback.configurationFile')
|
|
|
|
}
|
2016-06-28 14:38:26 +08:00
|
|
|
}
|
|
|
|
|
2018-07-31 16:37:27 +08:00
|
|
|
task testJoinedComposition(type: Test) {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['spec/cuba/core/composition/joined_composition/JoinedCompositionTestClass.class']
|
|
|
|
}
|
|
|
|
|
|
|
|
test.finalizedBy testJoinedComposition
|
|
|
|
|
2014-05-23 19:32:42 +08:00
|
|
|
assembleDbScripts {
|
|
|
|
moduleAlias = '10-cuba'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task deploy(dependsOn: assemble, type: CubaDeployment) {
|
|
|
|
appName = 'cuba-core'
|
2012-07-17 20:57:53 +08:00
|
|
|
appJars('cuba-global', 'cuba-core')
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2013-06-11 20:40:01 +08:00
|
|
|
|
|
|
|
def hsqlDbName = 'cubadb'
|
2017-07-07 19:36:40 +08:00
|
|
|
def hsqlPort = 9111
|
2013-06-11 20:40:01 +08:00
|
|
|
|
|
|
|
task startDb(description: 'Starts local HSQLDB server', type: CubaHsqlStart) {
|
2017-07-07 19:36:40 +08:00
|
|
|
dbPort = hsqlPort
|
2013-06-11 20:40:01 +08:00
|
|
|
dbName = hsqlDbName
|
|
|
|
}
|
|
|
|
|
|
|
|
task stopDb(description: 'Stops local HSQLDB server', type: CubaHsqlStop) {
|
2017-07-07 19:36:40 +08:00
|
|
|
dbPort = hsqlPort
|
2013-06-11 20:40:01 +08:00
|
|
|
dbName = hsqlDbName
|
|
|
|
}
|
|
|
|
|
|
|
|
task removeDb(description: 'Removes local HSQL database', type: Delete) {
|
|
|
|
delete new File("$rootProject.projectDir/data")
|
|
|
|
}
|
|
|
|
|
2017-07-07 19:36:40 +08:00
|
|
|
task killDb(description: "Kill local HSQLDB server process running on port $hsqlPort", type: CubaKillProcess) {
|
|
|
|
port = hsqlPort
|
2013-06-11 20:40:01 +08:00
|
|
|
}
|
|
|
|
|
2014-12-15 18:54:56 +08:00
|
|
|
task createDb(dependsOn: assembleDbScripts, description: 'Creates local HSQL database', type: CubaDbCreation) {
|
2013-06-11 20:40:01 +08:00
|
|
|
dbms = 'hsql'
|
2017-07-07 19:36:40 +08:00
|
|
|
host = "localhost:$hsqlPort"
|
2013-06-11 20:40:01 +08:00
|
|
|
dbName = hsqlDbName
|
|
|
|
dbUser = 'sa'
|
|
|
|
dbPassword = ''
|
|
|
|
}
|
2016-06-28 14:38:26 +08:00
|
|
|
|
|
|
|
task createTestDb(dependsOn: assembleDbScripts, description: 'Creates local HSQL database', type: CubaDbCreation) {
|
|
|
|
dbms = 'hsql'
|
2017-07-07 19:36:40 +08:00
|
|
|
host = "localhost:$hsqlPort"
|
2016-06-28 14:38:26 +08:00
|
|
|
dbName = hsqlDbName
|
|
|
|
dbUser = 'sa'
|
|
|
|
dbPassword = ''
|
|
|
|
auxiliaryScript = file('test/com/haulmont/cuba/testmodel/create-db.sql')
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2015-09-23 21:25:50 +08:00
|
|
|
configure(coreTestsModule) {
|
|
|
|
apply(plugin: 'java')
|
|
|
|
apply(plugin: 'maven')
|
|
|
|
apply(plugin: 'cuba')
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile(coreModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.apache.commons:commons-dbcp2'])
|
|
|
|
compile(bom['org.jmockit:jmockit'])
|
|
|
|
compile(bom['junit:junit'])
|
2015-09-23 21:25:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
2018-06-05 21:05:08 +08:00
|
|
|
from file('src')
|
2015-09-23 21:25:50 +08:00
|
|
|
include 'com/haulmont/cuba/core/CubaTestCase*.class'
|
|
|
|
include 'com/haulmont/cuba/core/CubaTestCase*.java'
|
|
|
|
include 'com/haulmont/cuba/testsupport/*'
|
|
|
|
include '*'
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourceJar
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
configure(clientModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.jsoup:jsoup']) // simplify version management for fts
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2015-09-23 21:25:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(clientTestsModule) {
|
|
|
|
apply(plugin: 'java')
|
|
|
|
apply(plugin: 'maven')
|
|
|
|
apply(plugin: 'cuba')
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile(clientModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.jmockit:jmockit'])
|
|
|
|
compile(bom['junit:junit'])
|
2015-09-23 21:25:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
2018-06-05 21:05:08 +08:00
|
|
|
from file('src')
|
2015-09-23 21:25:50 +08:00
|
|
|
classifier = 'sources'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
2015-09-23 21:25:50 +08:00
|
|
|
archives sourceJar
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(guiModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(clientModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2016-12-02 17:11:16 +08:00
|
|
|
compile(bom['org.apache.poi:poi'])
|
2011-11-17 16:31:31 +08:00
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(clientTestsModule)
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
entitiesEnhancing {
|
|
|
|
main {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
2015-05-22 21:52:44 +08:00
|
|
|
exclude 'com/haulmont/cuba/gui/components/*ComponentTest.class'
|
|
|
|
exclude 'com/haulmont/cuba/gui/components/*FieldTest.class'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 21:24:37 +08:00
|
|
|
configure(webWidgetsModule) {
|
|
|
|
dependencies {
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['org.apache.tomcat:tomcat-servlet-api'])
|
2018-03-07 21:24:37 +08:00
|
|
|
|
2018-06-14 16:16:03 +08:00
|
|
|
compile(bom['org.apache.commons:commons-lang3'])
|
2018-06-07 00:09:42 +08:00
|
|
|
compile(bom['com.google.guava:guava'])
|
2018-03-07 21:24:37 +08:00
|
|
|
compile(bom['com.google.code.findbugs:jsr305'])
|
|
|
|
compile(bom['org.apache.commons:commons-collections4'])
|
|
|
|
compile(bom['org.slf4j:slf4j-api'])
|
|
|
|
|
|
|
|
/* Vaadin */
|
|
|
|
compile(bom['com.vaadin:vaadin-server']) {
|
|
|
|
exclude(group: 'com.vaadin', module: 'vaadin-sass-compiler')
|
|
|
|
}
|
|
|
|
compile(bom['com.vaadin:vaadin-compatibility-server']) {
|
|
|
|
exclude(group: 'com.vaadin', module: 'vaadin-sass-compiler')
|
|
|
|
}
|
2018-03-07 23:15:35 +08:00
|
|
|
compile(bom['com.vaadin:vaadin-push'])
|
2018-03-07 21:24:37 +08:00
|
|
|
|
|
|
|
/* Vaadin addons */
|
2018-06-18 18:49:41 +08:00
|
|
|
/* The following add-ons are embedded into Platform
|
|
|
|
com.vaadin:vaadin-context-menu:2.1.0
|
|
|
|
org.vaadin.addons:aceeditor:0.8.15
|
|
|
|
org.vaadin.addons:popupbutton:3.0.0
|
|
|
|
org.vaadin.addons:dragdroplayouts:1.4.2.cuba.0
|
|
|
|
*/
|
2018-03-07 21:24:37 +08:00
|
|
|
|
|
|
|
/* WebJar dependencies */
|
|
|
|
compile(bom['org.webjars:jquery'])
|
|
|
|
compile(bom['org.webjars:jquery-ui'])
|
|
|
|
compile(bom['org.webjars.bower:jquery-file-upload'])
|
|
|
|
compile(bom['org.webjars.npm:object-fit-images'])
|
2018-08-14 21:13:49 +08:00
|
|
|
compile(bom['org.webjars:ace-builds'])
|
2018-06-18 18:49:41 +08:00
|
|
|
compile(bom['org.webjars:diff-match-patch'])
|
2018-03-07 21:24:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
with copySpec {
|
|
|
|
from sourceSets.main.allJava
|
|
|
|
include "com/haulmont/cuba/web/widgets/client/**"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
configure(webModule) {
|
2016-01-20 18:36:55 +08:00
|
|
|
configurations {
|
|
|
|
themes
|
|
|
|
}
|
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
dependencies {
|
|
|
|
compile(sharedLibModule)
|
|
|
|
compile(guiModule)
|
2016-03-16 17:46:35 +08:00
|
|
|
compile(restApiModule)
|
2018-03-07 21:24:37 +08:00
|
|
|
compile(webWidgetsModule)
|
2013-02-06 23:14:40 +08:00
|
|
|
|
2017-11-14 23:51:17 +08:00
|
|
|
compile(bom['org.springframework.ldap:spring-ldap-core']) {
|
2018-03-07 21:24:37 +08:00
|
|
|
// removed because it defines its own Log4j LogFactory via JDK services mechanism
|
|
|
|
exclude(group: 'org.slf4j', module: 'jcl-over-slf4j')
|
2017-11-14 23:51:17 +08:00
|
|
|
}
|
2018-02-13 16:11:34 +08:00
|
|
|
// use the same spring-tx as core
|
|
|
|
compile(bom['org.springframework:spring-tx'])
|
2017-11-14 23:51:17 +08:00
|
|
|
|
2018-04-04 04:21:57 +08:00
|
|
|
compile(bom['org.jsoup:jsoup']) // use the same version as core
|
|
|
|
|
2018-03-07 23:15:35 +08:00
|
|
|
compile(bom['org.springframework:spring-webmvc'])
|
|
|
|
compile(bom['commons-fileupload:commons-fileupload']) // required for Spring multipart resolver
|
2017-09-07 16:36:06 +08:00
|
|
|
|
2017-11-28 16:31:03 +08:00
|
|
|
compile(bom['com.haulmont.cuba-resources:cuba-png-icons'])
|
|
|
|
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2014-12-05 19:56:06 +08:00
|
|
|
|
2016-11-09 18:38:05 +08:00
|
|
|
themes(bom['com.vaadin:vaadin-themes'])
|
2016-01-20 18:36:55 +08:00
|
|
|
|
2018-05-24 16:23:38 +08:00
|
|
|
testCompile('cglib:cglib-nodep:3.2.6')
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(clientTestsModule)
|
2014-12-08 16:45:59 +08:00
|
|
|
testCompile(guiModule.sourceSets.test.output)
|
2018-02-16 19:19:06 +08:00
|
|
|
testRuntime(bom['javax.servlet:javax.servlet-api'])
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
entitiesEnhancing {
|
|
|
|
main {
|
|
|
|
enabled = true
|
|
|
|
}
|
2018-06-08 18:34:47 +08:00
|
|
|
test {
|
|
|
|
enabled = true
|
|
|
|
}
|
2018-06-04 16:31:22 +08:00
|
|
|
}
|
2014-03-20 16:10:31 +08:00
|
|
|
|
2013-02-12 16:57:33 +08:00
|
|
|
task buildScssThemes(type: CubaWebScssThemeCreation) {
|
2018-09-10 14:55:29 +08:00
|
|
|
themes = ['halo', 'hover', 'havana']
|
2014-10-15 17:43:55 +08:00
|
|
|
// compress = true
|
|
|
|
// sprites = true
|
|
|
|
// cleanup = true
|
2014-10-13 22:36:40 +08:00
|
|
|
}
|
|
|
|
|
2015-12-16 21:07:09 +08:00
|
|
|
task deployThemes(type: CubaDeployThemeTask, dependsOn: buildScssThemes) {
|
|
|
|
}
|
|
|
|
|
2018-07-26 15:08:45 +08:00
|
|
|
task buildHover(type: CubaWebScssThemeCreation) {
|
|
|
|
themes = ['hover']
|
|
|
|
// compress = true
|
|
|
|
// sprites = true
|
|
|
|
// cleanup = true
|
|
|
|
}
|
|
|
|
|
|
|
|
task deployHover(type: Copy, dependsOn: buildHover) {
|
|
|
|
from file("$webModule.buildDir/web/VAADIN/themes/hover")
|
|
|
|
into "${cuba.tomcat.dir}/webapps/cuba/VAADIN/themes/hover"
|
|
|
|
exclude '**/web.xml'
|
|
|
|
}
|
|
|
|
|
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")
|
2015-09-23 16:13:28 +08:00
|
|
|
into "${cuba.tomcat.dir}/webapps/cuba/VAADIN/themes/halo"
|
2014-10-13 22:36:40 +08:00
|
|
|
exclude '**/web.xml'
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2015-07-31 23:21:54 +08:00
|
|
|
task buildHavana(type: CubaWebScssThemeCreation) {
|
|
|
|
themes = ['havana']
|
|
|
|
// compress = true
|
|
|
|
// sprites = true
|
|
|
|
// cleanup = true
|
|
|
|
}
|
|
|
|
|
|
|
|
task deployHavana(type: Copy, dependsOn: buildHavana) {
|
|
|
|
from file("$webModule.buildDir/web/VAADIN/themes/havana")
|
2015-09-23 16:13:28 +08:00
|
|
|
into "${cuba.tomcat.dir}/webapps/cuba/VAADIN/themes/havana"
|
2015-07-31 23:21:54 +08:00
|
|
|
exclude '**/web.xml'
|
|
|
|
}
|
|
|
|
|
2016-02-26 16:22:54 +08:00
|
|
|
def webOutDir = file("$buildDir/web")
|
|
|
|
task webArchive(dependsOn: buildScssThemes, type: Zip) {
|
|
|
|
from file('web')
|
|
|
|
from webOutDir
|
|
|
|
exclude '**/web.xml', '**/app.properties'
|
|
|
|
classifier = 'web'
|
|
|
|
}
|
|
|
|
|
2018-09-07 19:26:26 +08:00
|
|
|
task themesJar(dependsOn: buildScssThemes, type: Jar) {
|
|
|
|
from file('themes')
|
|
|
|
classifier = 'themes'
|
|
|
|
}
|
|
|
|
|
2016-02-26 16:22:54 +08:00
|
|
|
artifacts {
|
2018-09-07 19:26:26 +08:00
|
|
|
archives webArchive, themesJar
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task deploy(dependsOn: assemble, type: CubaDeployment) {
|
|
|
|
appName = 'cuba'
|
2018-09-11 18:14:12 +08:00
|
|
|
appJars('cuba-global', 'cuba-client', 'cuba-gui', 'cuba-web', 'cuba-web-widgets', 'cuba-rest-api')
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2013-02-06 23:14:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(webToolkitModule) {
|
|
|
|
dependencies {
|
2018-03-07 21:24:37 +08:00
|
|
|
compile(webWidgetsModule)
|
|
|
|
compile(bom['com.vaadin:vaadin-client'])
|
|
|
|
compile(bom['com.vaadin:vaadin-client-compiler'])
|
|
|
|
compile(bom['com.vaadin:vaadin-compatibility-client'])
|
2014-12-17 19:19:21 +08:00
|
|
|
|
2018-02-16 19:19:06 +08:00
|
|
|
runtime(bom['javax.servlet:javax.servlet-api'])
|
2013-02-06 23:14:40 +08:00
|
|
|
}
|
|
|
|
|
2013-04-12 18:51:30 +08:00
|
|
|
task buildWidgetSet(type: CubaWidgetSetBuilding) {
|
2018-03-07 21:24:37 +08:00
|
|
|
widgetSetClass = 'com.haulmont.cuba.web.widgets.WidgetSet'
|
2015-07-15 15:27:15 +08:00
|
|
|
// Strict
|
|
|
|
strict = true
|
2014-08-13 16:01:18 +08:00
|
|
|
// Debug flags:
|
2018-06-05 21:05:08 +08:00
|
|
|
// printCompilerClassPath = true
|
|
|
|
// logLevel = 'INFO'
|
2015-07-15 15:27:15 +08:00
|
|
|
// Parallel thread count
|
|
|
|
workers = 2
|
2014-08-13 16:01:18 +08:00
|
|
|
|
|
|
|
// Performance and widgetset size:
|
2018-08-17 18:44:48 +08:00
|
|
|
style = 'OBF' // 'OBF' or 'PRETTY' or 'DETAILED'
|
2015-07-15 15:27:15 +08:00
|
|
|
disableCastChecking = false
|
|
|
|
optimize = 9
|
|
|
|
draft = false
|
|
|
|
|
|
|
|
// Compiler JVM
|
2018-03-07 21:24:37 +08:00
|
|
|
xmx = '-Xmx768m'
|
2015-07-15 15:27:15 +08:00
|
|
|
xss = '-Xss8m'
|
2015-11-27 21:12:39 +08:00
|
|
|
xxMPS = '-XX:MaxPermSize=256m'
|
2014-07-03 18:21:47 +08:00
|
|
|
}
|
|
|
|
|
2015-08-28 16:32:13 +08:00
|
|
|
task buildDebugWidgetSet(type: CubaWidgetSetBuilding) {
|
2015-09-07 17:40:18 +08:00
|
|
|
widgetSetsDir = "$project.buildDir/web-debug/VAADIN/widgetsets"
|
2018-03-07 21:24:37 +08:00
|
|
|
widgetSetClass = 'com.haulmont.cuba.web.widgets.WidgetSet'
|
2015-08-28 16:32:13 +08:00
|
|
|
// Performance and widgetset size:
|
|
|
|
style = 'PRETTY'
|
|
|
|
}
|
|
|
|
|
2015-07-23 18:05:41 +08:00
|
|
|
task debugWidgetSet(type: CubaWidgetSetDebug) {
|
2018-03-07 21:24:37 +08:00
|
|
|
widgetSetClass = 'com.haulmont.cuba.web.widgets.WidgetSet'
|
2015-07-23 18:05:41 +08:00
|
|
|
}
|
|
|
|
|
2014-07-03 18:21:47 +08:00
|
|
|
jar {
|
|
|
|
from sourceSets.main.allJava
|
2013-02-06 23:14:40 +08:00
|
|
|
}
|
|
|
|
|
2018-08-23 20:51:35 +08:00
|
|
|
task webArchive(dependsOn: buildWidgetSet, type: Jar) {
|
2014-07-03 18:21:47 +08:00
|
|
|
from file("$buildDir/web")
|
2018-08-23 20:51:35 +08:00
|
|
|
classifier = 'client'
|
2013-02-06 23:14:40 +08:00
|
|
|
}
|
|
|
|
|
2018-08-23 20:51:35 +08:00
|
|
|
task webDebugArchive(dependsOn: buildDebugWidgetSet, type: Jar) {
|
2015-11-27 21:12:39 +08:00
|
|
|
from file("$buildDir/web-debug")
|
2018-08-23 20:51:35 +08:00
|
|
|
classifier = 'debug-client'
|
2015-08-28 16:32:13 +08:00
|
|
|
}
|
|
|
|
|
2013-02-06 23:14:40 +08:00
|
|
|
artifacts {
|
|
|
|
archives webArchive
|
2015-09-23 16:13:28 +08:00
|
|
|
if (!cuba.artifact.isSnapshot) {
|
2015-09-07 17:40:18 +08:00
|
|
|
archives webDebugArchive
|
|
|
|
}
|
2013-02-06 23:14:40 +08:00
|
|
|
}
|
|
|
|
|
2018-08-23 20:51:35 +08:00
|
|
|
task deploy(dependsOn: webArchive, type: Copy) {
|
|
|
|
from webArchive
|
|
|
|
into "$cuba.tomcat.dir/webapps/cuba/WEB-INF/lib"
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2015-06-25 22:30:19 +08:00
|
|
|
|
|
|
|
task cleanWidgetSet(dependsOn: clean) {
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(desktopModule) {
|
|
|
|
apply(plugin: 'application')
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2011-11-17 16:31:31 +08:00
|
|
|
mainClassName = 'com.haulmont.cuba.desktop.App'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile(guiModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['com.miglayout:miglayout-swing'])
|
|
|
|
compile(bom['com.fifesoft:rsyntaxtextarea'])
|
|
|
|
compile(bom['com.haulmont.thirdparty:glazedlists'])
|
|
|
|
compile(bom['com.haulmont.thirdparty:swingx-core'])
|
2014-12-08 16:45:59 +08:00
|
|
|
|
2017-11-28 16:31:03 +08:00
|
|
|
compile(bom['com.haulmont.cuba-resources:cuba-png-icons'])
|
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(clientTestsModule)
|
2014-12-08 16:45:59 +08:00
|
|
|
testCompile(guiModule.sourceSets.test.output)
|
2018-02-16 19:19:06 +08:00
|
|
|
testRuntime(bom['javax.servlet:javax.servlet-api'])
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2016-11-18 17:46:43 +08:00
|
|
|
|
|
|
|
// disable building of *.tar and *.zip artifacts by default assemble task
|
|
|
|
configurations.archives.artifacts.removeAll {
|
|
|
|
it.file =~ 'tar' || it.file =~ 'zip'
|
|
|
|
}
|
2018-06-05 21:05:08 +08:00
|
|
|
|
|
|
|
// vaadin8
|
|
|
|
compileJava.enabled = false
|
2018-06-05 21:56:44 +08:00
|
|
|
test.enabled = false
|
2018-06-05 22:12:03 +08:00
|
|
|
compileTestGroovy.enabled = false
|
|
|
|
compileTestJava.enabled = false
|
2018-09-17 20:25:04 +08:00
|
|
|
javadoc.enabled = false
|
2018-09-18 15:10:29 +08:00
|
|
|
findbugsMain.enabled = false
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
|
|
|
|
2016-03-14 17:01:52 +08:00
|
|
|
configure(restApiModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(clientModule)
|
|
|
|
compile(sharedLibModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2017-08-05 20:24:04 +08:00
|
|
|
compile(bom['commons-fileupload:commons-fileupload']) // required for Spring multipart resolver
|
|
|
|
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['org.springframework:spring-webmvc'])
|
|
|
|
compile(bom['org.springframework:spring-context-support'])
|
|
|
|
|
2017-08-17 22:29:07 +08:00
|
|
|
compile(bom['org.springframework.ldap:spring-ldap-core']) {
|
|
|
|
exclude(group: 'org.slf4j', module: 'jcl-over-slf4j') // removed because it defines its own Log4j LogFactory via JDK services mechanism
|
|
|
|
}
|
|
|
|
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['org.json:json'])
|
|
|
|
|
|
|
|
compile(bom['com.fasterxml.jackson.core:jackson-databind'])
|
2018-04-04 04:21:57 +08:00
|
|
|
compile(bom['com.fasterxml.jackson.core:jackson-annotations'])
|
2016-11-09 18:38:05 +08:00
|
|
|
compile(bom['com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'])
|
|
|
|
|
|
|
|
compile(bom['org.springframework.security:spring-security-core'])
|
|
|
|
compile(bom['org.springframework.security:spring-security-web'])
|
|
|
|
compile(bom['org.springframework.security:spring-security-config'])
|
2018-06-07 15:38:09 +08:00
|
|
|
compile(bom['org.springframework.security.oauth:spring-security-oauth2'])
|
2016-03-14 17:01:52 +08:00
|
|
|
|
2018-03-27 17:22:21 +08:00
|
|
|
compile(bom['io.swagger:swagger-models'])
|
|
|
|
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2016-11-09 18:38:05 +08:00
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(clientTestsModule)
|
2016-03-14 17:01:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-23 18:47:25 +08:00
|
|
|
configure(portalModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(globalModule)
|
|
|
|
compile(clientModule)
|
|
|
|
compile(sharedLibModule)
|
2016-03-14 17:01:52 +08:00
|
|
|
compile(restApiModule)
|
2016-11-09 18:38:05 +08:00
|
|
|
|
|
|
|
compile(bom['org.springframework:spring-webmvc'])
|
|
|
|
compile(bom['org.springframework:spring-context-support'])
|
|
|
|
compile(bom['org.springframework:spring-jdbc'])
|
|
|
|
|
|
|
|
compile(bom['org.springframework.security:spring-security-core'])
|
|
|
|
compile(bom['org.springframework.security:spring-security-web'])
|
|
|
|
compile(bom['org.springframework.security:spring-security-config'])
|
|
|
|
compile(bom['org.springframework.security:spring-security-taglibs'])
|
|
|
|
|
|
|
|
compile(bom['org.json:json'])
|
|
|
|
|
|
|
|
compile(bom['org.thymeleaf:thymeleaf'])
|
|
|
|
compile(bom['org.thymeleaf:thymeleaf-spring4'])
|
|
|
|
compile(bom['org.thymeleaf.extras:thymeleaf-extras-springsecurity4'])
|
|
|
|
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2016-05-11 19:23:39 +08:00
|
|
|
|
2018-06-04 16:31:22 +08:00
|
|
|
testCompile(clientTestsModule)
|
2012-08-23 18:47:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
scanForTestClasses = false
|
|
|
|
includes = ['**/*Test.class']
|
|
|
|
}
|
2016-08-17 20:01:24 +08:00
|
|
|
|
|
|
|
task deploy(dependsOn: assemble, type: CubaDeployment) {
|
|
|
|
appName = 'cuba-portal'
|
|
|
|
appJars('cuba-global', 'cuba-client', 'cuba-portal', 'cuba-rest-api')
|
|
|
|
}
|
2012-08-23 18:47:25 +08:00
|
|
|
}
|
|
|
|
|
2017-03-29 15:34:56 +08:00
|
|
|
configure(uberJarModule) {
|
|
|
|
dependencies {
|
2018-08-27 23:58:58 +08:00
|
|
|
compile(bom['org.eclipse.jetty:jetty-server'])
|
|
|
|
compile(bom['org.eclipse.jetty:jetty-webapp'])
|
|
|
|
compile(bom['org.eclipse.jetty:jetty-plus'])
|
|
|
|
compile(bom['org.eclipse.jetty:jetty-jndi'])
|
|
|
|
compile(bom['org.eclipse.jetty:jetty-continuation'])
|
|
|
|
compile(bom['org.eclipse.jetty.websocket:websocket-server'])
|
|
|
|
compile(bom['org.eclipse.jetty.websocket:javax-websocket-server-impl'])
|
|
|
|
|
2017-03-29 15:34:56 +08:00
|
|
|
compile(bom['commons-cli:commons-cli'])
|
|
|
|
compile(bom['commons-io:commons-io'])
|
2017-04-06 14:29:20 +08:00
|
|
|
compile(bom['org.apache.commons:commons-dbcp2'])
|
2018-01-11 23:14:06 +08:00
|
|
|
compile(bom['ch.qos.logback:logback-classic'])
|
|
|
|
compile(bom['org.slf4j:log4j-over-slf4j'])
|
2018-01-30 14:23:07 +08:00
|
|
|
compile(bom['org.perf4j:perf4j'])
|
2017-03-29 15:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-07 20:06:17 +08:00
|
|
|
configure(frontModule) {
|
|
|
|
dependencies {
|
|
|
|
compile(bom['org.springframework:spring-webmvc'])
|
|
|
|
compile(bom['org.springframework:spring-context-support'])
|
2018-07-09 20:47:16 +08:00
|
|
|
compileOnly(bom['javax.servlet:javax.servlet-api'])
|
2017-07-07 20:06:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-14 23:34:42 +08:00
|
|
|
task restart(dependsOn: ['stop', ':cuba-core:deploy', ':cuba-web:deploy', ':cuba-web-toolkit:deploy'],
|
2017-03-08 02:44:59 +08:00
|
|
|
description: 'Redeploys applications and restarts local Tomcat') {
|
|
|
|
doLast {
|
|
|
|
ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
|
|
|
|
not {
|
|
|
|
socket(server: 'localhost', port: '8787')
|
|
|
|
}
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2017-03-08 02:44:59 +08:00
|
|
|
start.execute()
|
2011-11-17 16:31:31 +08:00
|
|
|
}
|
2018-03-02 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
2018-03-07 23:15:35 +08:00
|
|
|
zipProject {
|
|
|
|
excludeFromZip = ['out']
|
|
|
|
}
|
|
|
|
|
2018-05-23 19:52:31 +08:00
|
|
|
//apply plugin: 'jacoco'
|
|
|
|
//
|
|
|
|
//jacoco {
|
|
|
|
// toolVersion = "0.8.1"
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//task jacocoProjectReport(type: JacocoReport, group: 'Reporting') {
|
|
|
|
// description = 'Generates an aggregate report from all subprojects'
|
|
|
|
//
|
|
|
|
// def jacocoProjects = subprojects.findAll { prj ->
|
|
|
|
// return prj.project.extensions.findByName('jacoco') != null
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// dependsOn(jacocoProjects.jacocoTestReport)
|
|
|
|
//
|
|
|
|
// additionalSourceDirs = generateSourceFiles(jacocoProjects)
|
|
|
|
// sourceDirectories = generateSourceFiles(jacocoProjects)
|
|
|
|
// classDirectories = generateClassDirs(jacocoProjects)
|
|
|
|
// executionData = rootProject.files(jacocoProjects.jacocoTestReport.executionData)
|
|
|
|
//
|
|
|
|
// reports {
|
|
|
|
// html {
|
|
|
|
// enabled true
|
|
|
|
// destination new File(rootProject.buildDir, 'reports/jacoco/project')
|
|
|
|
// }
|
|
|
|
// xml {
|
|
|
|
// enabled true
|
|
|
|
// destination new File(rootProject.buildDir, 'reports/jacoco/project/jacoco-project.xml')
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// doFirst {
|
|
|
|
// executionData = files(executionData.findAll { it.exists() })
|
|
|
|
// }
|
|
|
|
//}
|
2018-03-02 18:05:29 +08:00
|
|
|
|
|
|
|
def generateSourceFiles(Collection projects) {
|
|
|
|
def dirs = projects.collect { prj -> new File(prj.projectDir, 'src') }
|
|
|
|
|
|
|
|
return rootProject.files(dirs)
|
|
|
|
}
|
|
|
|
|
|
|
|
def generateClassDirs(Collection projects) {
|
|
|
|
def trees = projects.collect { prj ->
|
|
|
|
return prj.fileTree(dir: new File(prj.buildDir, 'classes/java/main'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return trees.inject(files().asFileTree) { sum, current ->
|
|
|
|
sum += current
|
|
|
|
}
|
2018-03-14 00:01:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task aggregateJavadoc(type: Javadoc,
|
|
|
|
description: 'Generate javadocs from all child projects as if it was a single project',
|
|
|
|
group: 'Documentation') {
|
|
|
|
|
|
|
|
destinationDir = file("$buildDir/docs/javadoc")
|
2018-03-16 21:44:59 +08:00
|
|
|
title = "${project.name.toUpperCase()} ${cubaVersion.replace('-SNAPSHOT','')} API"
|
2018-03-14 00:01:17 +08:00
|
|
|
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
options.addStringOption("sourcepath", "")
|
|
|
|
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PUBLIC
|
|
|
|
|
2018-09-17 20:25:04 +08:00
|
|
|
include 'com/haulmont/cuba/**'
|
|
|
|
|
2018-03-14 00:01:17 +08:00
|
|
|
exclude 'com/haulmont/cuba/core/app/cache/**'
|
|
|
|
exclude 'com/haulmont/cuba/core/sys/jpql/antlr2/**'
|
|
|
|
exclude 'com/haulmont/cuba/core/sys/utils/**'
|
|
|
|
exclude 'com/haulmont/cuba/restapi/**'
|
2018-04-10 15:59:10 +08:00
|
|
|
|
|
|
|
exclude 'com/haulmont/cuba/gui/components/compatibility/**'
|
|
|
|
exclude 'com/haulmont/cuba/gui/xml/layout/loaders/**'
|
|
|
|
|
|
|
|
exclude 'com/haulmont/cuba/desktop/sys/**'
|
|
|
|
exclude 'com/haulmont/cuba/desktop/gui/components/**'
|
|
|
|
exclude 'com/haulmont/cuba/desktop/gui/data/**'
|
|
|
|
exclude 'com/haulmont/cuba/desktop/gui/executors/**'
|
|
|
|
|
2018-09-17 20:25:04 +08:00
|
|
|
exclude 'com/haulmont/cuba/web/widgets/addons/**'
|
|
|
|
exclude 'com/haulmont/cuba/web/widgets/client/**'
|
2018-04-10 15:59:10 +08:00
|
|
|
exclude 'com/haulmont/cuba/web/controllers/**'
|
|
|
|
exclude 'com/haulmont/cuba/web/gui/components/**'
|
|
|
|
exclude 'com/haulmont/cuba/web/gui/data/**'
|
|
|
|
exclude 'com/haulmont/cuba/web/gui/executors/**'
|
|
|
|
|
2018-03-14 00:01:17 +08:00
|
|
|
subprojects.each { proj ->
|
|
|
|
def javadocTask = proj.tasks.getByPath('javadoc')
|
|
|
|
|
2018-09-17 20:25:04 +08:00
|
|
|
if (javadocTask.enabled) {
|
|
|
|
source += javadocTask.source
|
|
|
|
classpath += javadocTask.classpath
|
|
|
|
}
|
2018-03-14 00:01:17 +08:00
|
|
|
}
|
2018-09-17 20:25:04 +08:00
|
|
|
}
|