Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
15e322c0
Unverified
Commit
15e322c0
authored
Jul 24, 2019
by
Jonah Williams
Committed by
GitHub
Jul 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose build-dir config option (#36773)
parent
6e963b99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
config.dart
packages/flutter_tools/lib/src/commands/config.dart
+12
-0
config_test.dart
...lutter_tools/test/general.shard/commands/config_test.dart
+24
-0
No files found.
packages/flutter_tools/lib/src/commands/config.dart
View file @
15e322c0
...
@@ -6,6 +6,8 @@ import 'dart:async';
...
@@ -6,6 +6,8 @@ import 'dart:async';
import
'../android/android_sdk.dart'
;
import
'../android/android_sdk.dart'
;
import
'../android/android_studio.dart'
;
import
'../android/android_studio.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../convert.dart'
;
import
'../convert.dart'
;
import
'../features.dart'
;
import
'../features.dart'
;
import
'../globals.dart'
;
import
'../globals.dart'
;
...
@@ -24,6 +26,8 @@ class ConfigCommand extends FlutterCommand {
...
@@ -24,6 +26,8 @@ class ConfigCommand extends FlutterCommand {
argParser
.
addOption
(
'gradle-dir'
,
help:
'The gradle install directory.'
);
argParser
.
addOption
(
'gradle-dir'
,
help:
'The gradle install directory.'
);
argParser
.
addOption
(
'android-sdk'
,
help:
'The Android SDK directory.'
);
argParser
.
addOption
(
'android-sdk'
,
help:
'The Android SDK directory.'
);
argParser
.
addOption
(
'android-studio-dir'
,
help:
'The Android Studio install directory.'
);
argParser
.
addOption
(
'android-studio-dir'
,
help:
'The Android Studio install directory.'
);
argParser
.
addOption
(
'build-dir'
,
help:
'The relative path to override a projects build directory'
,
valueHelp:
'out/'
);
argParser
.
addFlag
(
'machine'
,
argParser
.
addFlag
(
'machine'
,
negatable:
false
,
negatable:
false
,
hide:
!
verboseHelp
,
hide:
!
verboseHelp
,
...
@@ -128,6 +132,14 @@ class ConfigCommand extends FlutterCommand {
...
@@ -128,6 +132,14 @@ class ConfigCommand extends FlutterCommand {
if
(
argResults
.
wasParsed
(
'clear-ios-signing-cert'
))
if
(
argResults
.
wasParsed
(
'clear-ios-signing-cert'
))
_updateConfig
(
'ios-signing-cert'
,
''
);
_updateConfig
(
'ios-signing-cert'
,
''
);
if
(
argResults
.
wasParsed
(
'build-dir'
))
{
final
String
buildDir
=
argResults
[
'build-dir'
];
if
(
fs
.
path
.
isAbsolute
(
buildDir
))
{
throwToolExit
(
'build-dir should be a relative path'
);
}
_updateConfig
(
'build-dir'
,
buildDir
);
}
for
(
Feature
feature
in
allFeatures
)
{
for
(
Feature
feature
in
allFeatures
)
{
if
(
feature
.
configSetting
==
null
)
{
if
(
feature
.
configSetting
==
null
)
{
continue
;
continue
;
...
...
packages/flutter_tools/test/general.shard/commands/config_test.dart
View file @
15e322c0
...
@@ -7,9 +7,11 @@ import 'dart:convert';
...
@@ -7,9 +7,11 @@ import 'dart:convert';
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/config.dart'
;
import
'package:flutter_tools/src/commands/config.dart'
;
import
'package:flutter_tools/src/version.dart'
;
import
'package:flutter_tools/src/version.dart'
;
...
@@ -53,6 +55,28 @@ void main() {
...
@@ -53,6 +55,28 @@ void main() {
AndroidSdk:
()
=>
mockAndroidSdk
,
AndroidSdk:
()
=>
mockAndroidSdk
,
});
});
testUsingContext
(
'Can set build-dir'
,
()
async
{
final
ConfigCommand
configCommand
=
ConfigCommand
();
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
configCommand
);
await
commandRunner
.
run
(<
String
>[
'config'
,
'--build-dir=foo'
]);
expect
(
getBuildDirectory
(),
'foo'
);
});
testUsingContext
(
'throws error on absolute path to build-dir'
,
()
async
{
final
ConfigCommand
configCommand
=
ConfigCommand
();
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
configCommand
);
expect
(()
=>
commandRunner
.
run
(<
String
>[
'config'
,
'--build-dir=/foo'
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
});
testUsingContext
(
'allows setting and removing feature flags'
,
()
async
{
testUsingContext
(
'allows setting and removing feature flags'
,
()
async
{
final
ConfigCommand
configCommand
=
ConfigCommand
();
final
ConfigCommand
configCommand
=
ConfigCommand
();
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
configCommand
);
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
configCommand
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment