80 lines
2.2 KiB
Groovy
80 lines
2.2 KiB
Groovy
allprojects {
|
|
apply plugin: 'java'
|
|
|
|
compileJava {
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
url 'https://oss.sonatype.org/content/groups/public/'
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
group 'mc'
|
|
|
|
ext {
|
|
slf4j_version = '1.7.25'
|
|
spring_version = '5.1.0.RELEASE'
|
|
lombok_version = '1.18.2'
|
|
}
|
|
|
|
configurations {
|
|
compile_excludeCopy
|
|
compile.extendsFrom compile_excludeCopy
|
|
}
|
|
|
|
dependencies {
|
|
/* Logger */
|
|
compile (group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version)
|
|
compile (group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4j_version)
|
|
|
|
/* Spring */
|
|
compile (group: 'org.springframework', name: 'spring-context', version: spring_version)
|
|
|
|
/* Lombok */
|
|
annotationProcessor (group: 'org.projectlombok', name: 'lombok', version: lombok_version)
|
|
compileOnly (group: 'org.projectlombok', name: 'lombok', version: lombok_version)
|
|
|
|
/* Testing */
|
|
testCompile (group: 'junit', name: 'junit', version: '4.12')
|
|
testCompile (group: 'org.slf4j', name: 'slf4j-simple', version: slf4j_version)
|
|
testCompile (group: 'org.mockito', name: 'mockito-core', version: '1.10.19')
|
|
testCompile (group: 'org.springframework', name: 'spring-test', version: spring_version)
|
|
}
|
|
|
|
task copyDep(type: Copy) {
|
|
into 'libs'
|
|
from configurations.compile + configurations.runtime - configurations.compile_excludeCopy
|
|
}
|
|
|
|
task cleanDep(type: Delete) {
|
|
delete 'libs'
|
|
}
|
|
}
|
|
|
|
task runApp(type: JavaExec) {
|
|
main = 'mc.core.Main'
|
|
|
|
workingDir = (project.hasProperty("workDir") ? project.workDir : '.')
|
|
|
|
subprojects.findAll().each{ prj ->
|
|
classpath += prj.sourceSets.main.runtimeClasspath
|
|
}
|
|
/* Uncomment, if your Log Implements are folder '{workDir}/log-impl' */
|
|
//classpath += files(fileTree(dir: new File(workingDir, "log-impl")))
|
|
|
|
/* Uncomment, if you used VM args */
|
|
//jvmArgs = [
|
|
// "-DspringConfig=spring.xml",
|
|
// "-Dlog4j.configurationFile=log4j2.xml"
|
|
//]
|
|
|
|
ignoreExitValue = true
|
|
}
|