109 lines
3.1 KiB
Groovy
109 lines
3.1 KiB
Groovy
buildscript {
|
|
ext {
|
|
// main framework
|
|
antlr4_version = '4.7.2'
|
|
netty_version = '4.1.42.Final'
|
|
shardingsphere_version = '5.0.0-RC1-SNAPSHOT'
|
|
spring_version = '5.1.8.RELEASE'
|
|
// log
|
|
commons_logging_version = '1.2'
|
|
log4j_version = '1.2.17'
|
|
log4j2_version = '2.11.1'
|
|
logback_version = '1.2.3'
|
|
slf4j_version = '1.7.25'
|
|
// other
|
|
hikari_version = '3.4.1'
|
|
jackson_version = '2.9.8'
|
|
jetbrains_annotations_version = '17.0.0'
|
|
mysql_jdbc_version = '8.0.21'
|
|
typesafe_config_version = '1.3.4'
|
|
// test
|
|
jupiter_version = '5.6.2'
|
|
testcontainers_version = '1.14.3'
|
|
// gradle plugin
|
|
lombok_plugin_version = '3.8.0'
|
|
shadow_plugin_version = '2.0.4'
|
|
}
|
|
repositories {
|
|
maven { url "https://maven.aliyun.com/repository/central" }
|
|
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
|
|
}
|
|
dependencies {
|
|
classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_plugin_version"
|
|
classpath "io.freefair.gradle:lombok-plugin:$lombok_plugin_version"
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'jacoco'
|
|
apply plugin: 'io.freefair.lombok'
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
compileJava {
|
|
options.compilerArgs << "-parameters"
|
|
}
|
|
|
|
configurations.all {
|
|
resolutionStrategy.preferProjectModules()
|
|
}
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url "https://maven.aliyun.com/repository/central" }
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
showStandardStreams = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// test
|
|
testCompile "org.junit.jupiter:junit-jupiter-api:$jupiter_version"
|
|
testCompile "org.junit.jupiter:junit-jupiter-engine:$jupiter_version"
|
|
testCompile "ch.qos.logback:logback-classic:$logback_version"
|
|
}
|
|
}
|
|
|
|
// Aggregates all jacoco results into the root project directory
|
|
task jacocoRootReport(type: JacocoReport) {
|
|
|
|
description = 'Generates an aggregate report from all subprojects'
|
|
dependsOn(subprojects.test)
|
|
|
|
additionalSourceDirs.from = subprojects.sourceSets.main.allSource.srcDirs
|
|
sourceDirectories.from = subprojects.sourceSets.main.allSource.srcDirs
|
|
classDirectories.from = subprojects.sourceSets.main.output
|
|
executionData.from = subprojects.jacocoTestReport.executionData
|
|
|
|
reports {
|
|
html.enabled = true
|
|
xml.enabled = true
|
|
}
|
|
|
|
afterEvaluate {
|
|
classDirectories.setFrom(files(classDirectories.files.collect {
|
|
fileTree(dir: it, exclude: [
|
|
'org/optymus/domino/ast/antlr/MySqlLexer*',
|
|
'org/optymus/domino/ast/antlr/MySqlParser*'
|
|
])
|
|
}))
|
|
}
|
|
|
|
// workaround to ignore projects that don't have any tests at all
|
|
onlyIf = { true }
|
|
doFirst {
|
|
executionData files(executionData.findAll { it.exists() })
|
|
}
|
|
}
|
|
|
|
task reportCoverage(dependsOn: ['jacocoRootReport']) |