Add file and pretty console logging #77
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This patch builds on top of the last addition and prepares a foundation for future tasks with some common settings for logging and console printing.
ConsoleSettings
The console settings config object controls the logoutput of
xcodebuild
to the standart output. The tool is by nature very verbose and does't allow any verbosity levels to be set except to quiten it completely. In the apple development szene is a tool available to help out with that xcpretty. It's main use is to transform the output ofxcodebuild
and format it in a shorter more human readable format. It also has formatters to reformat unit test output into different formats. The tool is written in ruby which doesn't help us much so I ported it over to groovy xcpretty.groovy. It is not a 100% port as code snippet colering is missing and only theSimple
formatter is supported. This extra library is added and used whenprettyPrint
is enabled in the console settings object. The logfile written to disk is not formatted!The console settings can be set on the plugin level for all
xcodebuild
tasks or individual for each task.The default values are set based on the gradle console settings which can be changed with the commandline switch
--console=(auto,plain,rich,verbose)
or via gradle property-Dorg.gradle.console=(auto,plain,rich,verbose)
Extension config settings
I added a few config values to the
XcodeBuildPluginExtion
to set the default log directory, archive directory and derived data directory.Each xcodebuild task, at the moment only
XcodeArchive
will bind to these values by default and append the task name to the log file or as a sub directory. The common values can be set in thebuild.gradle
script or via environment variable or gradle property.Changes