Archived
0
This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mc-core/build.gradle

96 lines
3.1 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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'
junit_version = '5.3.1'
}
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 */
testImplementation (group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junit_version)
testRuntimeOnly(group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junit_version)
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)
}
test {
useJUnitPlatform()
}
task copyDep(type: Copy) {
into 'libs'
from configurations.compile + configurations.runtime - configurations.compile_excludeCopy
}
task cleanDep(type: Delete) {
delete 'libs'
}
}
/**
* Запуск сервера.
* Для указания рабочей папки, указываем JVM параметр
* -DworkDir=path\to\workdir
* Если используется отдельная папка для имплементации логгера, то указываем
* -DlogImplDir=path\to\logimpldir
* Если необходимо передать дополнительные JVM параметры серверу, то указываем их с двойной "D", например:
* -DDspringConfig=spring.xml
* -DDlog4j.configurationFile=log4j2.xml
*/
task runServer(type: JavaExec) {
main = 'mc.core.Main'
workingDir = System.getProperty("workDir", ".")
subprojects.findAll().each{ prj ->
classpath += prj.sourceSets.main.runtimeClasspath
}
if (System.getProperty("logImplDir") != null) {
classpath += files(fileTree(dir: new File(System.getProperty("logImplDir"))))
}
System.getProperties().stringPropertyNames().stream()
.filter{propName -> propName.startsWith("D")}
.forEach{propName -> jvmArgs += "-D" + propName.substring(1) + "=" + System.getProperty(propName)}
ignoreExitValue = true
}