Commit 29fdc7a4 authored by Devon Carew's avatar Devon Carew

rename the --release and --debug flags (#3382)

parent 8b9c9420
...@@ -86,7 +86,7 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree ...@@ -86,7 +86,7 @@ Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory. `flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory.
To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `travis/test.sh`. To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `travis/test.sh`.
If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--debug` or `--release` to change what flutter shell `flutter test` uses. If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--engine-debug` or `--engine-release` to change what flutter shell `flutter test` uses.
To do this with the `travis/test.sh` script, you can use the `FLUTTER_ENGINE` environment variable. To do this with the `travis/test.sh` script, you can use the `FLUTTER_ENGINE` environment variable.
Note: Flutter tests are headless, you won't see any UI. You can use Note: Flutter tests are headless, you won't see any UI. You can use
...@@ -166,14 +166,14 @@ the following steps. ...@@ -166,14 +166,14 @@ the following steps.
configurations (e.g., `out/android_Debug`). configurations (e.g., `out/android_Debug`).
You should now be able to run the tests against your locally built You should now be able to run the tests against your locally built
engine using the `flutter test --debug` command. To run one of the engine using the `flutter test --engine-debug` command. To run one of the
examples on your device using your locally built engine, use the examples on your device using your locally built engine, use the
`--debug` option to the `flutter` tool: `--engine-debug` option to the `flutter` tool:
* `flutter run --debug` * `flutter run --engine-debug`
If you want to test the release version instead of the debug version, If you want to test the release version instead of the debug version,
use `--release` instead of `--debug`. use `--engine-release` instead of `--engine-debug`.
Making a breaking change to the engine Making a breaking change to the engine
-------------------------------------- --------------------------------------
......
...@@ -138,7 +138,7 @@ class TestCommand extends FlutterCommand { ...@@ -138,7 +138,7 @@ class TestCommand extends FlutterCommand {
return exitCode; return exitCode;
} }
if (!foundOne) { if (!foundOne) {
printError('At least one of --debug or --release must be set, to specify the local build products to test.'); printError('At least one of --engine-debug or --engine-release must be set, to specify the local build products to test.');
return 1; return 1;
} }
......
...@@ -61,18 +61,18 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -61,18 +61,18 @@ class FlutterCommandRunner extends CommandRunner {
if (verboseHelp) if (verboseHelp)
argParser.addSeparator('Local build selection options (not normally required):'); argParser.addSeparator('Local build selection options (not normally required):');
argParser.addFlag('debug', argParser.addFlag('engine-debug',
negatable: false, negatable: false,
hide: !verboseHelp, hide: !verboseHelp,
help: help:
'Set this if you are building Flutter locally and want to use the debug build products.\n' 'Set this if you are building Flutter locally and want to use the debug build products.\n'
'Defaults to true if --engine-src-path is specified and --release is not, otherwise false.'); 'Defaults to true if --engine-src-path is specified and --engine-release is not, otherwise false.');
argParser.addFlag('release', argParser.addFlag('engine-release',
negatable: false, negatable: false,
hide: !verboseHelp, hide: !verboseHelp,
help: help:
'Set this if you are building Flutter locally and want to use the release build products.\n' 'Set this if you are building Flutter locally and want to use the release build products.\n'
'The --release option is not compatible with the listen command on iOS devices and simulators.'); 'The --engine-release option is not compatible with the listen command on iOS devices and simulators.');
argParser.addOption('engine-src-path', argParser.addOption('engine-src-path',
hide: !verboseHelp, hide: !verboseHelp,
help: help:
...@@ -216,10 +216,10 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -216,10 +216,10 @@ class FlutterCommandRunner extends CommandRunner {
if (enginePath != null) { if (enginePath != null) {
ToolConfiguration.instance.engineSrcPath = enginePath; ToolConfiguration.instance.engineSrcPath = enginePath;
if (globalResults.wasParsed('release')) if (globalResults.wasParsed('engine-release'))
ToolConfiguration.instance.release = globalResults['release']; ToolConfiguration.instance.engineRelease = globalResults['engine-release'];
if (globalResults.wasParsed('debug')) if (globalResults.wasParsed('engine-debug'))
ToolConfiguration.instance.release = !globalResults['debug']; ToolConfiguration.instance.engineRelease = !globalResults['engine-debug'];
} }
// The Android SDK could already have been set by tests. // The Android SDK could already have been set by tests.
...@@ -247,8 +247,8 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -247,8 +247,8 @@ class FlutterCommandRunner extends CommandRunner {
String _findEnginePath(ArgResults globalResults) { String _findEnginePath(ArgResults globalResults) {
String engineSourcePath = globalResults['engine-src-path'] ?? Platform.environment[kFlutterEngineEnvironmentVariableName]; String engineSourcePath = globalResults['engine-src-path'] ?? Platform.environment[kFlutterEngineEnvironmentVariableName];
bool isDebug = globalResults['debug']; bool isDebug = globalResults['engine-debug'];
bool isRelease = globalResults['release']; bool isRelease = globalResults['engine-release'];
if (engineSourcePath == null && (isDebug || isRelease)) { if (engineSourcePath == null && (isDebug || isRelease)) {
try { try {
...@@ -282,8 +282,8 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -282,8 +282,8 @@ class FlutterCommandRunner extends CommandRunner {
} }
List<BuildConfiguration> _createBuildConfigurations(ArgResults globalResults) { List<BuildConfiguration> _createBuildConfigurations(ArgResults globalResults) {
bool isDebug = globalResults['debug']; bool isDebug = globalResults['engine-debug'];
bool isRelease = globalResults['release']; bool isRelease = globalResults['engine-release'];
HostPlatform hostPlatform = getCurrentHostPlatform(); HostPlatform hostPlatform = getCurrentHostPlatform();
TargetPlatform hostPlatformAsTarget = getCurrentHostPlatformAsTarget(); TargetPlatform hostPlatformAsTarget = getCurrentHostPlatformAsTarget();
......
...@@ -93,14 +93,14 @@ class ToolConfiguration { ...@@ -93,14 +93,14 @@ class ToolConfiguration {
String engineSrcPath; String engineSrcPath;
/// The engine mode to use (only relevent when [engineSrcPath] is set). /// The engine mode to use (only relevent when [engineSrcPath] is set).
bool release; bool engineRelease;
/// Used to override the directory calculated from engineSrcPath (--engine-out-dir). /// Used to override the directory calculated from engineSrcPath (--engine-out-dir).
String engineOutDir; String engineOutDir;
bool get isLocalEngine => engineSrcPath != null || engineOutDir != null; bool get isLocalEngine => engineSrcPath != null || engineOutDir != null;
String get _modeStr => release ? 'Release' : 'Debug'; String get _modeStr => engineRelease ? 'Release' : 'Debug';
/// The directory that contains development tools for the given platform. This /// The directory that contains development tools for the given platform. This
/// includes things like `sky_shell` and `sky_snapshot`. /// includes things like `sky_shell` and `sky_snapshot`.
......
...@@ -45,7 +45,7 @@ void main() { ...@@ -45,7 +45,7 @@ void main() {
testUsingContext('using enginePath', () { testUsingContext('using enginePath', () {
ToolConfiguration toolConfig = new ToolConfiguration(); ToolConfiguration toolConfig = new ToolConfiguration();
toolConfig.engineSrcPath = 'engine'; toolConfig.engineSrcPath = 'engine';
toolConfig.release = true; toolConfig.engineRelease = true;
expect( expect(
toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path, toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path,
...@@ -56,7 +56,7 @@ void main() { ...@@ -56,7 +56,7 @@ void main() {
'engine/out/android_Release' 'engine/out/android_Release'
); );
toolConfig.release = false; toolConfig.engineRelease = false;
expect( expect(
toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path, toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path,
'engine/out/Debug' 'engine/out/Debug'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment