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