You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logging level for the standard output will be LogLevel.INFO and for the errorLogLevel.WARN regarding the configurations you set or update before running the Proguard task as the proguard() task action function will set it before executing Proguard:
// Gradle task execution.@TaskActionpublicvoidproguard() throwsException
{
// Let the logging manager capture the standard output and errors from// ProGuard.LoggingManagerloggingManager = getLogging();
loggingManager.captureStandardOutput(LogLevel.INFO);
loggingManager.captureStandardError(LogLevel.WARN);
// Run ProGuard with the collected configuration.newProGuard(getConfiguration()).execute();
}
The logging level will always be INFO if you run the ProGuard task
proguardTask.logging.captureStandardOutput(LogLevel.ERROR)
// Execute the Proguard task
proguardTask.actions.forEach { it.execute(proguardTask) }
println("Standard Output Logging Level: ${proguardTask.logging.standardOutputCaptureLevel}") // Will be INFO
Without running Proguard Task:
proguardTask.logging.captureStandardOutput(LogLevel.ERROR)
println("Standard Output Logging Level: ${proguardTask.logging.standardOutputCaptureLevel}") // Will be ERROR
A workaround is to disable the logging completely while executing the task:
val oldStandardOut =System.outval oldStandardErr =System.err
val noOpOutputStream =object:OutputStream() {
overridefunwrite(b:Int) {
// Do nothing
}
}
try {
System.setOut(java.io.PrintStream(noOpOutputStream))
System.setErr(java.io.PrintStream(noOpOutputStream))
// Execute the Proguard task
proguardTask.actions.forEach { it.execute(proguardTask) }
} finally {
System.setOut(oldStandardOut)
System.setErr(oldStandardErr)
}
When running the Proguard task directly inside another task by either:
Or:
The logging level for the standard output will be
LogLevel.INFO
and for the errorLogLevel.WARN
regarding the configurations you set or update before running the Proguard task as theproguard()
task action function will set it before executing Proguard:proguard/gradle-plugin/src/main/java/proguard/gradle/ProGuardTask.java
Lines 1422 to 1436 in ee3deb6
The logging level will always be INFO if you run the ProGuard task
Without running Proguard Task:
A workaround is to disable the logging completely while executing the task:
Or use another way to apply the Proguard plugin and use it, similar to Compose Desktop Proguard or SgtSilvio Gradle Proguard.
It seems that the
getConfiguration()
is private which is required to run withProguard
class usingnew ProGuard(getConfiguration()).execute();
.The text was updated successfully, but these errors were encountered: