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
653566dd
Commit
653566dd
authored
Apr 04, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify toolchain setup
parent
73bee3ae
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
20 additions
and
79 deletions
+20
-79
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-2
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+0
-2
build_flx.dart
packages/flutter_tools/lib/src/commands/build_flx.dart
+1
-4
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+0
-7
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+0
-10
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+0
-17
install.dart
packages/flutter_tools/lib/src/commands/install.dart
+0
-2
listen.dart
packages/flutter_tools/lib/src/commands/listen.dart
+0
-3
refresh.dart
packages/flutter_tools/lib/src/commands/refresh.dart
+0
-7
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+0
-7
run_mojo.dart
packages/flutter_tools/lib/src/commands/run_mojo.dart
+0
-2
stop.dart
packages/flutter_tools/lib/src/commands/stop.dart
+0
-1
trace.dart
packages/flutter_tools/lib/src/commands/trace.dart
+0
-2
plist_utils.dart
packages/flutter_tools/lib/src/ios/plist_utils.dart
+10
-7
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+7
-4
toolchain.dart
packages/flutter_tools/lib/src/toolchain.dart
+1
-1
drive_test.dart
packages/flutter_tools/test/drive_test.dart
+0
-1
No files found.
packages/flutter_tools/lib/src/application_package.dart
View file @
653566dd
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
...
...
@@ -118,7 +117,7 @@ class ApplicationPackageStore {
}
}
static
Future
<
ApplicationPackageStore
>
forConfigs
(
List
<
BuildConfiguration
>
configs
)
async
{
static
ApplicationPackageStore
forConfigs
(
List
<
BuildConfiguration
>
configs
)
{
AndroidApk
android
;
IOSApp
iOS
;
...
...
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
653566dd
...
...
@@ -185,8 +185,6 @@ class BuildApkCommand extends FlutterCommand {
return
1
;
}
await
downloadToolchain
();
// TODO(devoncarew): This command should take an arg for the output type (arm / x64).
return
await
buildAndroid
(
...
...
packages/flutter_tools/lib/src/commands/build_flx.dart
View file @
653566dd
...
...
@@ -40,10 +40,7 @@ class BuildFlxCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
String
compilerPath
=
argResults
[
'compiler'
];
if
(
compilerPath
==
null
)
await
downloadToolchain
();
else
if
(
compilerPath
!=
null
)
toolchain
=
new
Toolchain
(
compiler:
new
SnapshotCompiler
(
compilerPath
));
String
outputPath
=
argResults
[
'output-file'
];
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
653566dd
...
...
@@ -31,13 +31,6 @@ class BuildIOSCommand extends FlutterCommand {
return
1
;
}
printTrace
(
'Ensuring toolchains are up to date.'
);
await
Future
.
wait
([
downloadToolchain
(),
downloadApplicationPackages
(),
],
eagerError:
true
);
IOSApp
app
=
applicationPackages
.
iOS
;
if
(
app
==
null
)
{
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
653566dd
...
...
@@ -262,11 +262,6 @@ class AppDomain extends Domain {
Directory
.
current
=
new
Directory
(
projectDirectory
);
try
{
await
Future
.
wait
([
command
.
downloadToolchain
(),
command
.
downloadApplicationPackages
(),
],
eagerError:
true
);
int
result
=
await
startApp
(
device
,
command
.
applicationPackages
,
...
...
@@ -304,11 +299,6 @@ class AppDomain extends Domain {
Directory
.
current
=
new
Directory
(
projectDirectory
);
try
{
await
Future
.
wait
([
command
.
downloadToolchain
(),
command
.
downloadApplicationPackages
(),
],
eagerError:
true
);
ApplicationPackage
app
=
command
.
applicationPackages
.
getPackageForPlatform
(
device
.
platform
);
return
device
.
stopApp
(
app
);
}
finally
{
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
653566dd
...
...
@@ -80,8 +80,6 @@ class DriveCommand extends RunCommandBase {
@override
Future
<
int
>
runInProject
()
async
{
await
toolchainDownloader
(
this
);
String
testFile
=
_getTestFile
();
if
(
testFile
==
null
)
{
return
1
;
...
...
@@ -311,18 +309,3 @@ Future<int> stopApp(DriveCommand command) async {
bool
stopped
=
await
command
.
device
.
stopApp
(
package
);
return
stopped
?
0
:
1
;
}
/// Downloads Flutter toolchain.
typedef
Future
<
Null
>
ToolchainDownloader
(
DriveCommand
command
);
ToolchainDownloader
toolchainDownloader
=
downloadToolchain
;
void
restoreToolchainDownloader
(
)
{
toolchainDownloader
=
downloadToolchain
;
}
Future
<
Null
>
downloadToolchain
(
DriveCommand
command
)
async
{
printTrace
(
'Downloading toolchain.'
);
await
Future
.
wait
([
command
.
downloadToolchain
(),
command
.
downloadApplicationPackages
(),
],
eagerError:
true
);
}
packages/flutter_tools/lib/src/commands/install.dart
View file @
653566dd
...
...
@@ -21,8 +21,6 @@ class InstallCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
await
downloadApplicationPackages
();
Device
device
=
deviceForCommand
;
ApplicationPackage
package
=
applicationPackages
.
getPackageForPlatform
(
device
.
platform
);
...
...
packages/flutter_tools/lib/src/commands/listen.dart
View file @
653566dd
...
...
@@ -32,9 +32,6 @@ class ListenCommand extends RunCommandBase {
@override
Future
<
int
>
runInProject
()
async
{
await
downloadApplicationPackages
();
await
downloadToolchain
();
Iterable
<
String
>
directories
=
()
sync
*
{
yield
*
argResults
.
rest
;
yield
'.'
;
...
...
packages/flutter_tools/lib/src/commands/refresh.dart
View file @
653566dd
...
...
@@ -34,13 +34,6 @@ class RefreshCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
printTrace
(
'Downloading toolchain.'
);
await
Future
.
wait
([
downloadToolchain
(),
downloadApplicationPackages
(),
],
eagerError:
true
);
Directory
tempDir
=
await
Directory
.
systemTemp
.
createTemp
(
'flutter_tools'
);
try
{
String
snapshotPath
=
path
.
join
(
tempDir
.
path
,
'snapshot_blob.bin'
);
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
653566dd
...
...
@@ -94,13 +94,6 @@ class RunCommand extends RunCommandBase {
@override
Future
<
int
>
runInProject
()
async
{
printTrace
(
'Downloading toolchain.'
);
await
Future
.
wait
([
downloadToolchain
(),
downloadApplicationPackages
(),
],
eagerError:
true
);
bool
clearLogs
=
argResults
[
'clear-logs'
];
int
debugPort
;
...
...
packages/flutter_tools/lib/src/commands/run_mojo.dart
View file @
653566dd
...
...
@@ -162,8 +162,6 @@ class RunMojoCommand extends FlutterCommand {
return
1
;
}
await
downloadToolchain
();
String
targetApp
=
argResults
[
'app'
];
if
(
targetApp
==
null
)
{
targetApp
=
_kDefaultBundlePath
;
...
...
packages/flutter_tools/lib/src/commands/stop.dart
View file @
653566dd
...
...
@@ -21,7 +21,6 @@ class StopCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
await
downloadApplicationPackages
();
Device
device
=
deviceForCommand
;
ApplicationPackage
app
=
applicationPackages
.
getPackageForPlatform
(
device
.
platform
);
printStatus
(
'Stopping apps on
${device.name}
.'
);
...
...
packages/flutter_tools/lib/src/commands/trace.dart
View file @
653566dd
...
...
@@ -38,8 +38,6 @@ class TraceCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
await
downloadApplicationPackages
();
ApplicationPackage
androidApp
=
applicationPackages
.
android
;
AndroidDevice
device
=
deviceForCommand
;
...
...
packages/flutter_tools/lib/src/ios/plist_utils.dart
View file @
653566dd
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
import
'../base/process.dart'
;
...
...
@@ -9,21 +11,22 @@ import '../base/process.dart';
const
String
kCFBundleIdentifierKey
=
"CFBundleIdentifier"
;
String
getValueFromFile
(
String
plistFilePath
,
String
key
)
{
// TODO(chinmaygarde): For now, we only need to read from plist files on a
//
mac
host. If this changes, we will need our own Dart plist reader.
// TODO(chinmaygarde): For now, we only need to read from plist files on a
mac
// host. If this changes, we will need our own Dart plist reader.
// Don't use PlistBuddy since that is not guaranteed to be installed.
// 'defaults' requires the path to be absolute and without the 'plist'
// extension.
if
(!
FileSystemEntity
.
isFileSync
(
plistFilePath
))
return
null
;
String
normalizedPlistPath
=
path
.
withoutExtension
(
path
.
absolute
(
plistFilePath
));
try
{
String
value
=
runCheckedSync
(<
String
>[
'/usr/bin/defaults'
,
'read'
,
normalizedPlistPath
,
key
]).
trim
();
'/usr/bin/defaults'
,
'read'
,
normalizedPlistPath
,
key
]);
return
value
.
isEmpty
?
null
:
value
;
}
catch
(
error
)
{
return
null
;
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
653566dd
...
...
@@ -58,12 +58,12 @@ abstract class FlutterCommand extends Command {
_usesPubOption
=
true
;
}
Future
<
Null
>
downloadToolchain
()
async
{
toolchain
??=
await
Toolchain
.
forConfigs
(
buildConfigurations
);
void
_setupToolchain
()
{
toolchain
??=
Toolchain
.
forConfigs
(
buildConfigurations
);
}
Future
<
Null
>
downloadApplicationPackages
()
async
{
applicationPackages
??=
await
ApplicationPackageStore
.
forConfigs
(
buildConfigurations
);
void
_setupApplicationPackages
()
{
applicationPackages
??=
ApplicationPackageStore
.
forConfigs
(
buildConfigurations
);
}
@override
...
...
@@ -126,6 +126,9 @@ abstract class FlutterCommand extends Command {
return
exitCode
;
}
_setupToolchain
();
_setupApplicationPackages
();
return
await
runInProject
();
}
...
...
packages/flutter_tools/lib/src/toolchain.dart
View file @
653566dd
...
...
@@ -57,7 +57,7 @@ class Toolchain {
final
SnapshotCompiler
compiler
;
static
Future
<
Toolchain
>
forConfigs
(
List
<
BuildConfiguration
>
configs
)
async
{
static
Toolchain
forConfigs
(
List
<
BuildConfiguration
>
configs
)
{
for
(
BuildConfiguration
config
in
configs
)
{
String
compilerPath
=
_getCompilerPath
(
config
);
if
(
compilerPath
!=
null
)
...
...
packages/flutter_tools/test/drive_test.dart
View file @
653566dd
...
...
@@ -35,7 +35,6 @@ void main() {
command
=
new
DriveCommand
();
applyMocksToCommand
(
command
);
useInMemoryFileSystem
(
cwd:
'/some/app'
);
toolchainDownloader
=
(
_
)
async
{
};
targetDeviceFinder
=
()
{
throw
'Unexpected call to targetDeviceFinder'
;
};
...
...
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