fix: gradle run application
Example: gradle runApp -PworkDir="D:\mc-core"
This commit is contained in:
24
build.gradle
24
build.gradle
@@ -1,4 +1,4 @@
|
|||||||
subprojects {
|
allprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
@@ -10,7 +10,9 @@ subprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
ext {
|
ext {
|
||||||
slf4j_version = '1.7.21'
|
slf4j_version = '1.7.21'
|
||||||
spring_version = '4.2.5.RELEASE'
|
spring_version = '4.2.5.RELEASE'
|
||||||
@@ -44,3 +46,23 @@ subprojects {
|
|||||||
delete 'libs'
|
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=app.xml",
|
||||||
|
// "-Dlog4j.configurationFile=log4j2.xml"
|
||||||
|
//]
|
||||||
|
|
||||||
|
ignoreExitValue = true
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user