Build log output to file
This commit is contained in:
23
build.gradle
23
build.gradle
@ -43,6 +43,29 @@ dependencies {
|
||||
testCompile 'junit:junit:4.+'
|
||||
}
|
||||
|
||||
// writing build process to a log file
|
||||
// --------------------- BUILD LOG SETTINGS ----------------------
|
||||
def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss')
|
||||
def buildLogDir = "${rootDir}/logs"
|
||||
mkdir("${buildLogDir}")
|
||||
def buildLog = new File("${buildLogDir}/${tstamp}_buildLog.log")
|
||||
|
||||
import org.gradle.internal.logging.*
|
||||
System.setProperty('org.gradle.color.error', 'RED')
|
||||
|
||||
gradle.services.get(LoggingOutputInternal).addStandardOutputListener (new StandardOutputListener () {
|
||||
void onOutput(CharSequence output) {
|
||||
buildLog << output
|
||||
}
|
||||
})
|
||||
|
||||
gradle.services.get(LoggingOutputInternal).addStandardErrorListener (new StandardOutputListener () {
|
||||
void onOutput(CharSequence output) {
|
||||
buildLog << output
|
||||
}
|
||||
})
|
||||
// --------------------- BUILD LOG SETTINGS ----------------------
|
||||
|
||||
run.args = ['client',
|
||||
'-config', 'ncore-properties.xml',
|
||||
'-config', 'ncore-properties-local.xml']
|
||||
|
Reference in New Issue
Block a user