I call ant.signjar from a gradle script. How can I capture its output? I did neither get it managed easily to elevate the output from INFO to another level, nor to intercept or wrap the output to error warnings out to WARN level. Currently the signjar echoes out that the certificate will expire soon, but this is not shown on WARN level which is not so nice.
相关问题
- Could not read entry … from cache taskArtifacts.bi
- Configure gradle plugin based on future tasks
- How to fix the error Cannot change strategy of con
- Include pom.xml in Jar with gradle
- Gradle vs Compiler
相关文章
- Android BuildConfig Field generating String incorr
- Gradle Could not find method “() for arguments on
- Gradle Custom Plugin: gradleApi() vs Explicit Depe
- Android Studio 3.5 ERROR: Unable to resolve depend
- How to specify @category in test task in gradle?
- How to clean your build with Flutter RP2 in Androi
- Remove transitive classpath dependency in gradle
- Execution failed for task ':bintrayUpload'
Here's a method that captures the output of an Ant task by registering a custom BuildListener for the duration of the call.
Example usage:
I assume the Ant task is using Ant's logging framework, and not just printing to standard out. In that case, have you tried the following?
When configured in this way, the log level will be changed to INFO while the task is executing (and reverted back afterwards), no matter which log level is set when invoking Gradle. Note that you can't elevate the log level of an Ant log event; it's up to the Ant task at which level it logs.