flutter/packages/flutter_tools
Greg Spencer 081d2a7a86
Re-land text wrapping/color PR (#22831)
This attempts to re-land #22656.

There are two changes from the original:

I turned off wrapping completely when not sending output to a terminal. Previously I had defaulted to wrapping at and arbitrary 100 chars in that case, just to keep long messages from being too long, but that turns out the be a bad idea because there are tests that are relying on the specific form of the output. It's also pretty arbitrary, and mostly people sending output to a non-terminal will want unwrapped text.

I found a better way to terminate ANSI color/bold sequences, so that they can be embedded within each other without needed quite as complex a dance with removing redundant sequences.

As part of these changes, I removed the Logger.supportsColor setter so that the one source of truth for color support is in AnsiTerminal.supportsColor.

*     Turn on line wrapping again in usage and status messages, adds ANSI color to doctor and analysis messages. (#22656)

    This turns on text wrapping for usage messages and status messages. When on a terminal, wraps to the width of the terminal. When writing to a non-terminal, wrap lines at a default column width (currently defined to be 100 chars). If --no-wrap is specified, then no wrapping occurs. If --wrap-column is specified, wraps to that column (if --wrap is on).

    Adds ANSI color to the doctor and analysis output on terminals. This is in this PR with the wrapping, since wrapping needs to know how to count visible characters in the presence of ANSI sequences. (This is just one more step towards re-implementing all of Curses for Flutter. :-)) Will not print ANSI sequences when sent to a non-terminal, or of --no-color is specified.

    Fixes ANSI color and bold sequences so that they can be combined (bold, colored text), and a small bug in indentation calculation for wrapping.

    Since wrapping is now turned on, also removed many redundant '\n's in the code.
2018-10-10 18:17:56 -07:00
..
bin Remove unused deps and flags from flutter tool. (#22571) 2018-10-09 13:04:06 -07:00
doc Allow passing a restart reason through to analytics (#21983) 2018-10-10 10:23:32 +01:00
gradle Add a profile build type to the Android app template (with plugin support) (#22884) 2018-10-10 09:54:57 -07:00
ide_templates/intellij Change 'flutter ide-config' to optionally create root Intellij module (#19920) 2018-07-30 10:15:26 -07:00
lib Re-land text wrapping/color PR (#22831) 2018-10-10 18:17:56 -07:00
schema Rename 'application' back to 'module', and make 'app' the default again for templates. (#22888) 2018-10-10 11:01:40 -07:00
templates Rename 'application' back to 'module', and make 'app' the default again for templates. (#22888) 2018-10-10 11:01:40 -07:00
test Re-land text wrapping/color PR (#22831) 2018-10-10 18:17:56 -07:00
tool apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
analysis_options.yaml Turn on unawaited_futures in flutter_tools (#21048) 2018-08-30 20:57:44 -07:00
BUILD.gn [gn] Be explicit about Dart sources. 2018-08-01 09:33:03 -07:00
pubspec.yaml [flutter_driver] Adds fuchsia compat for connect() (#22633) 2018-10-08 11:09:07 -07:00
README.md Remove -j1 to run tools tests concurrently (#22038) 2018-09-19 17:47:06 +01:00

Flutter Tools

Tools for building Flutter applications.

To run the tests, ensure that no devices are connected, then navigate to flutter_tools and execute:

../../bin/cache/dart-sdk/bin/pub run test