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
e939b152
Commit
e939b152
authored
Mar 12, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename the platform constants
parent
e67b6768
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
76 additions
and
78 deletions
+76
-78
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+15
-5
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+11
-11
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+13
-13
process.dart
packages/flutter_tools/lib/src/base/process.dart
+1
-1
build_configuration.dart
packages/flutter_tools/lib/src/build_configuration.dart
+8
-11
apk.dart
packages/flutter_tools/lib/src/commands/apk.dart
+2
-2
run_mojo.dart
packages/flutter_tools/lib/src/commands/run_mojo.dart
+2
-2
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+2
-2
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-1
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+16
-25
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+3
-3
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
e939b152
...
@@ -48,7 +48,17 @@ class AndroidDevice extends Device {
...
@@ -48,7 +48,17 @@ class AndroidDevice extends Device {
final
String
modelID
;
final
String
modelID
;
final
String
deviceCodeName
;
final
String
deviceCodeName
;
bool
get
isLocalEmulator
=>
false
;
bool
_isLocalEmulator
;
bool
get
isLocalEmulator
{
if
(
_isLocalEmulator
==
null
)
{
// sample values: x86, armeabi-v7a
String
value
=
runCheckedSync
(
adbCommandForDevice
([
'shell'
,
'getprop'
,
'ro.product.cpu.abi'
]));
_isLocalEmulator
=
value
==
'x86'
;
}
return
_isLocalEmulator
;
}
_AdbLogReader
_logReader
;
_AdbLogReader
_logReader
;
_AndroidDevicePortForwarder
_portForwarder
;
_AndroidDevicePortForwarder
_portForwarder
;
...
@@ -59,8 +69,7 @@ class AndroidDevice extends Device {
...
@@ -59,8 +69,7 @@ class AndroidDevice extends Device {
bool
_isValidAdbVersion
(
String
adbVersion
)
{
bool
_isValidAdbVersion
(
String
adbVersion
)
{
// Sample output: 'Android Debug Bridge version 1.0.31'
// Sample output: 'Android Debug Bridge version 1.0.31'
Match
versionFields
=
Match
versionFields
=
new
RegExp
(
r'(\d+)\.(\d+)\.(\d+)'
).
firstMatch
(
adbVersion
);
new
RegExp
(
r'(\d+)\.(\d+)\.(\d+)'
).
firstMatch
(
adbVersion
);
if
(
versionFields
!=
null
)
{
if
(
versionFields
!=
null
)
{
int
majorVersion
=
int
.
parse
(
versionFields
[
1
]);
int
majorVersion
=
int
.
parse
(
versionFields
[
1
]);
int
minorVersion
=
int
.
parse
(
versionFields
[
2
]);
int
minorVersion
=
int
.
parse
(
versionFields
[
2
]);
...
@@ -275,8 +284,9 @@ class AndroidDevice extends Device {
...
@@ -275,8 +284,9 @@ class AndroidDevice extends Device {
return
runCommandAndStreamOutput
(
command
).
then
((
int
exitCode
)
=>
exitCode
==
0
);
return
runCommandAndStreamOutput
(
command
).
then
((
int
exitCode
)
=>
exitCode
==
0
);
}
}
// TODO(devoncarew): Return android_arm or android_x64 based on [isLocalEmulator].
@override
@override
TargetPlatform
get
platform
=>
TargetPlatform
.
android
;
TargetPlatform
get
platform
=>
TargetPlatform
.
android
_arm
;
void
clearLogs
()
{
void
clearLogs
()
{
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
...
@@ -584,7 +594,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
...
@@ -584,7 +594,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
return
ports
;
return
ports
;
}
}
Future
<
int
>
forward
(
int
devicePort
,
{
int
hostPort:
null
})
async
{
Future
<
int
>
forward
(
int
devicePort
,
{
int
hostPort
})
async
{
if
((
hostPort
==
null
)
||
(
hostPort
==
0
))
{
if
((
hostPort
==
null
)
||
(
hostPort
==
0
))
{
// Auto select host port.
// Auto select host port.
hostPort
=
await
findAvailablePort
();
hostPort
=
await
findAvailablePort
();
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
e939b152
...
@@ -115,13 +115,13 @@ class ApplicationPackageStore {
...
@@ -115,13 +115,13 @@ class ApplicationPackageStore {
ApplicationPackage
getPackageForPlatform
(
TargetPlatform
platform
)
{
ApplicationPackage
getPackageForPlatform
(
TargetPlatform
platform
)
{
switch
(
platform
)
{
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android
_arm
:
return
android
;
return
android
;
case
TargetPlatform
.
i
OS
:
case
TargetPlatform
.
i
os_arm
:
case
TargetPlatform
.
i
OSSimulator
:
case
TargetPlatform
.
i
os_x64
:
return
iOS
;
return
iOS
;
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
darwin_x64
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
linux
_x64
:
return
null
;
return
null
;
}
}
}
}
...
@@ -132,7 +132,7 @@ class ApplicationPackageStore {
...
@@ -132,7 +132,7 @@ class ApplicationPackageStore {
for
(
BuildConfiguration
config
in
configs
)
{
for
(
BuildConfiguration
config
in
configs
)
{
switch
(
config
.
targetPlatform
)
{
switch
(
config
.
targetPlatform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android
_arm
:
assert
(
android
==
null
);
assert
(
android
==
null
);
android
=
AndroidApk
.
getCustomApk
();
android
=
AndroidApk
.
getCustomApk
();
// Fall back to the prebuilt or engine-provided apk if we can't build
// Fall back to the prebuilt or engine-provided apk if we can't build
...
@@ -145,18 +145,18 @@ class ApplicationPackageStore {
...
@@ -145,18 +145,18 @@ class ApplicationPackageStore {
android
=
new
AndroidApk
(
localPath:
localPath
);
android
=
new
AndroidApk
(
localPath:
localPath
);
}
else
{
}
else
{
Artifact
artifact
=
ArtifactStore
.
getArtifact
(
Artifact
artifact
=
ArtifactStore
.
getArtifact
(
type:
ArtifactType
.
shell
,
targetPlatform:
TargetPlatform
.
android
);
type:
ArtifactType
.
shell
,
targetPlatform:
TargetPlatform
.
android
_arm
);
android
=
new
AndroidApk
(
localPath:
await
ArtifactStore
.
getPath
(
artifact
));
android
=
new
AndroidApk
(
localPath:
await
ArtifactStore
.
getPath
(
artifact
));
}
}
break
;
break
;
case
TargetPlatform
.
i
OS
:
case
TargetPlatform
.
i
os_arm
:
case
TargetPlatform
.
i
OSSimulator
:
case
TargetPlatform
.
i
os_x64
:
iOS
??=
new
IOSApp
.
fromBuildConfiguration
(
config
);
iOS
??=
new
IOSApp
.
fromBuildConfiguration
(
config
);
break
;
break
;
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
darwin_x64
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
linux
_x64
:
break
;
break
;
}
}
}
}
...
...
packages/flutter_tools/lib/src/artifacts.dart
View file @
e939b152
...
@@ -23,15 +23,15 @@ String _getNameForHostPlatform(HostPlatform platform) {
...
@@ -23,15 +23,15 @@ String _getNameForHostPlatform(HostPlatform platform) {
String
_getNameForTargetPlatform
(
TargetPlatform
platform
)
{
String
_getNameForTargetPlatform
(
TargetPlatform
platform
)
{
switch
(
platform
)
{
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android
_arm
:
return
'android-arm'
;
return
'android-arm'
;
case
TargetPlatform
.
i
OS
:
case
TargetPlatform
.
i
os_arm
:
return
'ios-arm'
;
return
'ios-arm'
;
case
TargetPlatform
.
i
OSSimulator
:
case
TargetPlatform
.
i
os_x64
:
return
'ios-x64'
;
return
'ios-x64'
;
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
darwin_x64
:
return
'darwin-x64'
;
return
'darwin-x64'
;
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
linux
_x64
:
return
'linux-x64'
;
return
'linux-x64'
;
}
}
}
}
...
@@ -77,13 +77,13 @@ class ArtifactStore {
...
@@ -77,13 +77,13 @@ class ArtifactStore {
name:
'Sky Shell'
,
name:
'Sky Shell'
,
fileName:
'SkyShell.apk'
,
fileName:
'SkyShell.apk'
,
type:
ArtifactType
.
shell
,
type:
ArtifactType
.
shell
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Sky Shell'
,
name:
'Sky Shell'
,
fileName:
'sky_shell'
,
fileName:
'sky_shell'
,
type:
ArtifactType
.
shell
,
type:
ArtifactType
.
shell
,
targetPlatform:
TargetPlatform
.
linux
targetPlatform:
TargetPlatform
.
linux
_x64
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Sky Snapshot'
,
name:
'Sky Snapshot'
,
...
@@ -101,37 +101,37 @@ class ArtifactStore {
...
@@ -101,37 +101,37 @@ class ArtifactStore {
name:
'Flutter for Mojo'
,
name:
'Flutter for Mojo'
,
fileName:
'flutter.mojo'
,
fileName:
'flutter.mojo'
,
type:
ArtifactType
.
mojo
,
type:
ArtifactType
.
mojo
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Flutter for Mojo'
,
name:
'Flutter for Mojo'
,
fileName:
'flutter.mojo'
,
fileName:
'flutter.mojo'
,
type:
ArtifactType
.
mojo
,
type:
ArtifactType
.
mojo
,
targetPlatform:
TargetPlatform
.
linux
targetPlatform:
TargetPlatform
.
linux
_x64
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Compiled Java code'
,
name:
'Compiled Java code'
,
fileName:
'classes.dex.jar'
,
fileName:
'classes.dex.jar'
,
type:
ArtifactType
.
androidClassesJar
,
type:
ArtifactType
.
androidClassesJar
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'ICU data table'
,
name:
'ICU data table'
,
fileName:
'icudtl.dat'
,
fileName:
'icudtl.dat'
,
type:
ArtifactType
.
androidIcuData
,
type:
ArtifactType
.
androidIcuData
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Key Store'
,
name:
'Key Store'
,
fileName:
'chromium-debug.keystore'
,
fileName:
'chromium-debug.keystore'
,
type:
ArtifactType
.
androidKeystore
,
type:
ArtifactType
.
androidKeystore
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
const
Artifact
.
_
(
const
Artifact
.
_
(
name:
'Compiled C++ code'
,
name:
'Compiled C++ code'
,
fileName:
'libsky_shell.so'
,
fileName:
'libsky_shell.so'
,
type:
ArtifactType
.
androidLibSkyShell
,
type:
ArtifactType
.
androidLibSkyShell
,
targetPlatform:
TargetPlatform
.
android
targetPlatform:
TargetPlatform
.
android
_arm
),
),
];
];
...
...
packages/flutter_tools/lib/src/base/process.dart
View file @
e939b152
...
@@ -132,7 +132,7 @@ String _runWithLoggingSync(List<String> cmd, {
...
@@ -132,7 +132,7 @@ String _runWithLoggingSync(List<String> cmd, {
}
}
if
(
results
.
stdout
.
trim
().
isNotEmpty
)
if
(
results
.
stdout
.
trim
().
isNotEmpty
)
printTrace
(
results
.
stdout
.
trim
());
printTrace
(
results
.
stdout
.
trim
());
return
results
.
stdout
;
return
results
.
stdout
.
trim
()
;
}
}
class
ProcessExit
implements
Exception
{
class
ProcessExit
implements
Exception
{
...
...
packages/flutter_tools/lib/src/build_configuration.dart
View file @
e939b152
...
@@ -20,11 +20,11 @@ enum HostPlatform {
...
@@ -20,11 +20,11 @@ enum HostPlatform {
}
}
enum
TargetPlatform
{
enum
TargetPlatform
{
android
,
android
_arm
,
i
OS
,
i
os_arm
,
i
OSSimulator
,
i
os_x64
,
mac
,
darwin_x64
,
linux
,
linux
_x64
}
}
HostPlatform
getCurrentHostPlatform
(
)
{
HostPlatform
getCurrentHostPlatform
(
)
{
...
@@ -38,18 +38,17 @@ HostPlatform getCurrentHostPlatform() {
...
@@ -38,18 +38,17 @@ HostPlatform getCurrentHostPlatform() {
TargetPlatform
getCurrentHostPlatformAsTarget
(
)
{
TargetPlatform
getCurrentHostPlatformAsTarget
(
)
{
if
(
Platform
.
isMacOS
)
if
(
Platform
.
isMacOS
)
return
TargetPlatform
.
mac
;
return
TargetPlatform
.
darwin_x64
;
if
(
Platform
.
isLinux
)
if
(
Platform
.
isLinux
)
return
TargetPlatform
.
linux
;
return
TargetPlatform
.
linux
_x64
;
printError
(
'Unsupported host platform, defaulting to Linux'
);
printError
(
'Unsupported host platform, defaulting to Linux'
);
return
TargetPlatform
.
linux
;
return
TargetPlatform
.
linux
_x64
;
}
}
class
BuildConfiguration
{
class
BuildConfiguration
{
BuildConfiguration
.
prebuilt
({
BuildConfiguration
.
prebuilt
({
this
.
hostPlatform
,
this
.
hostPlatform
,
this
.
targetPlatform
,
this
.
targetPlatform
,
this
.
deviceId
,
this
.
testable
:
false
this
.
testable
:
false
})
:
type
=
BuildType
.
prebuilt
,
buildDir
=
null
;
})
:
type
=
BuildType
.
prebuilt
,
buildDir
=
null
;
...
@@ -59,7 +58,6 @@ class BuildConfiguration {
...
@@ -59,7 +58,6 @@ class BuildConfiguration {
this
.
targetPlatform
,
this
.
targetPlatform
,
String
enginePath
,
String
enginePath
,
String
buildPath
,
String
buildPath
,
this
.
deviceId
,
this
.
testable
:
false
this
.
testable
:
false
})
:
buildDir
=
path
.
normalize
(
path
.
join
(
enginePath
,
buildPath
))
{
})
:
buildDir
=
path
.
normalize
(
path
.
join
(
enginePath
,
buildPath
))
{
assert
(
type
==
BuildType
.
debug
||
type
==
BuildType
.
release
);
assert
(
type
==
BuildType
.
debug
||
type
==
BuildType
.
release
);
...
@@ -69,6 +67,5 @@ class BuildConfiguration {
...
@@ -69,6 +67,5 @@ class BuildConfiguration {
final
HostPlatform
hostPlatform
;
final
HostPlatform
hostPlatform
;
final
TargetPlatform
targetPlatform
;
final
TargetPlatform
targetPlatform
;
final
String
buildDir
;
final
String
buildDir
;
final
String
deviceId
;
final
bool
testable
;
final
bool
testable
;
}
}
packages/flutter_tools/lib/src/commands/apk.dart
View file @
e939b152
...
@@ -226,7 +226,7 @@ Future<_ApkComponents> _findApkComponents(
...
@@ -226,7 +226,7 @@ Future<_ApkComponents> _findApkComponents(
];
];
Iterable
<
Future
<
String
>>
pathFutures
=
artifactTypes
.
map
(
Iterable
<
Future
<
String
>>
pathFutures
=
artifactTypes
.
map
(
(
ArtifactType
type
)
=>
ArtifactStore
.
getPath
(
ArtifactStore
.
getArtifact
(
(
ArtifactType
type
)
=>
ArtifactStore
.
getPath
(
ArtifactStore
.
getArtifact
(
type:
type
,
targetPlatform:
TargetPlatform
.
android
)));
type:
type
,
targetPlatform:
TargetPlatform
.
android
_arm
)));
artifactPaths
=
await
Future
.
wait
(
pathFutures
);
artifactPaths
=
await
Future
.
wait
(
pathFutures
);
}
}
...
@@ -392,7 +392,7 @@ Future<int> buildAndroid({
...
@@ -392,7 +392,7 @@ Future<int> buildAndroid({
}
}
BuildConfiguration
config
=
configs
.
firstWhere
(
BuildConfiguration
config
=
configs
.
firstWhere
(
(
BuildConfiguration
bc
)
=>
bc
.
targetPlatform
==
TargetPlatform
.
android
(
BuildConfiguration
bc
)
=>
bc
.
targetPlatform
==
TargetPlatform
.
android
_arm
);
);
_ApkComponents
components
=
await
_findApkComponents
(
config
,
enginePath
,
manifest
,
resources
);
_ApkComponents
components
=
await
_findApkComponents
(
config
,
enginePath
,
manifest
,
resources
);
if
(
components
==
null
)
{
if
(
components
==
null
)
{
...
...
packages/flutter_tools/lib/src/commands/run_mojo.dart
View file @
e939b152
...
@@ -71,7 +71,7 @@ class RunMojoCommand extends FlutterCommand {
...
@@ -71,7 +71,7 @@ class RunMojoCommand extends FlutterCommand {
BuildConfiguration
_getCurrentHostConfig
()
{
BuildConfiguration
_getCurrentHostConfig
()
{
BuildConfiguration
result
;
BuildConfiguration
result
;
TargetPlatform
target
=
argResults
[
'android'
]
?
TargetPlatform
target
=
argResults
[
'android'
]
?
TargetPlatform
.
android
:
getCurrentHostPlatformAsTarget
();
TargetPlatform
.
android
_arm
:
getCurrentHostPlatformAsTarget
();
for
(
BuildConfiguration
config
in
buildConfigurations
)
{
for
(
BuildConfiguration
config
in
buildConfigurations
)
{
if
(
config
.
targetPlatform
==
target
)
{
if
(
config
.
targetPlatform
==
target
)
{
result
=
config
;
result
=
config
;
...
@@ -93,7 +93,7 @@ class RunMojoCommand extends FlutterCommand {
...
@@ -93,7 +93,7 @@ class RunMojoCommand extends FlutterCommand {
String
flutterPath
;
String
flutterPath
;
if
(
config
==
null
||
config
.
type
==
BuildType
.
prebuilt
)
{
if
(
config
==
null
||
config
.
type
==
BuildType
.
prebuilt
)
{
TargetPlatform
targetPlatform
=
argResults
[
'android'
]
?
TargetPlatform
.
android
:
TargetPlatform
.
linux
;
TargetPlatform
targetPlatform
=
argResults
[
'android'
]
?
TargetPlatform
.
android
_arm
:
TargetPlatform
.
linux_x64
;
Artifact
artifact
=
ArtifactStore
.
getArtifact
(
type:
ArtifactType
.
mojo
,
targetPlatform:
targetPlatform
);
Artifact
artifact
=
ArtifactStore
.
getArtifact
(
type:
ArtifactType
.
mojo
,
targetPlatform:
targetPlatform
);
flutterPath
=
_makePathAbsolute
(
await
ArtifactStore
.
getPath
(
artifact
));
flutterPath
=
_makePathAbsolute
(
await
ArtifactStore
.
getPath
(
artifact
));
}
else
{
}
else
{
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
e939b152
...
@@ -47,9 +47,9 @@ class TestCommand extends FlutterCommand {
...
@@ -47,9 +47,9 @@ class TestCommand extends FlutterCommand {
return
await
ArtifactStore
.
getPath
(
artifact
);
return
await
ArtifactStore
.
getPath
(
artifact
);
}
else
{
}
else
{
switch
(
config
.
targetPlatform
)
{
switch
(
config
.
targetPlatform
)
{
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
linux
_x64
:
return
path
.
join
(
config
.
buildDir
,
'sky_shell'
);
return
path
.
join
(
config
.
buildDir
,
'sky_shell'
);
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
darwin_x64
:
return
path
.
join
(
config
.
buildDir
,
'SkyShell.app'
,
'Contents'
,
'MacOS'
,
'SkyShell'
);
return
path
.
join
(
config
.
buildDir
,
'SkyShell.app'
,
'Contents'
,
'MacOS'
,
'SkyShell'
);
default
:
default
:
throw
new
Exception
(
'Unsupported platform.'
);
throw
new
Exception
(
'Unsupported platform.'
);
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
e939b152
...
@@ -224,7 +224,7 @@ class IOSDevice extends Device {
...
@@ -224,7 +224,7 @@ class IOSDevice extends Device {
}
}
@override
@override
TargetPlatform
get
platform
=>
TargetPlatform
.
i
OS
;
TargetPlatform
get
platform
=>
TargetPlatform
.
i
os_arm
;
DeviceLogReader
get
logReader
{
DeviceLogReader
get
logReader
{
if
(
_logReader
==
null
)
if
(
_logReader
==
null
)
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
e939b152
...
@@ -536,7 +536,7 @@ class IOSSimulator extends Device {
...
@@ -536,7 +536,7 @@ class IOSSimulator extends Device {
}
}
@override
@override
TargetPlatform
get
platform
=>
TargetPlatform
.
i
OSSimulator
;
TargetPlatform
get
platform
=>
TargetPlatform
.
i
os_x64
;
DeviceLogReader
get
logReader
{
DeviceLogReader
get
logReader
{
if
(
_logReader
==
null
)
if
(
_logReader
==
null
)
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
e939b152
...
@@ -80,7 +80,7 @@ abstract class FlutterCommand extends Command {
...
@@ -80,7 +80,7 @@ abstract class FlutterCommand extends Command {
devices
=
devices
.
where
((
Device
device
)
=>
device
.
isSupported
()).
toList
();
devices
=
devices
.
where
((
Device
device
)
=>
device
.
isSupported
()).
toList
();
if
(
androidOnly
)
if
(
androidOnly
)
devices
=
devices
.
where
((
Device
device
)
=>
device
.
platform
==
TargetPlatform
.
android
).
toList
();
devices
=
devices
.
where
((
Device
device
)
=>
device
.
platform
==
TargetPlatform
.
android
_arm
).
toList
();
if
(
devices
.
isEmpty
)
{
if
(
devices
.
isEmpty
)
{
printStatus
(
'No supported devices connected.'
);
printStatus
(
'No supported devices connected.'
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
e939b152
...
@@ -269,14 +269,13 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -269,14 +269,13 @@ class FlutterCommandRunner extends CommandRunner {
if
(
enginePath
==
null
)
{
if
(
enginePath
==
null
)
{
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
android
,
targetPlatform:
TargetPlatform
.
android_arm
deviceId:
globalResults
[
'device-id'
]
));
));
if
(
hostPlatform
==
HostPlatform
.
linux
)
{
if
(
hostPlatform
==
HostPlatform
.
linux
)
{
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
HostPlatform
.
linux
,
hostPlatform:
HostPlatform
.
linux
,
targetPlatform:
TargetPlatform
.
linux
,
targetPlatform:
TargetPlatform
.
linux
_x64
,
testable:
true
testable:
true
));
));
}
}
...
@@ -284,14 +283,12 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -284,14 +283,12 @@ class FlutterCommandRunner extends CommandRunner {
if
(
hostPlatform
==
HostPlatform
.
mac
)
{
if
(
hostPlatform
==
HostPlatform
.
mac
)
{
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
HostPlatform
.
mac
,
hostPlatform:
HostPlatform
.
mac
,
targetPlatform:
TargetPlatform
.
iOS
,
targetPlatform:
TargetPlatform
.
ios_arm
deviceId:
globalResults
[
'device-id'
]
));
));
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
configs
.
add
(
new
BuildConfiguration
.
prebuilt
(
hostPlatform:
HostPlatform
.
mac
,
hostPlatform:
HostPlatform
.
mac
,
targetPlatform:
TargetPlatform
.
iOSSimulator
,
targetPlatform:
TargetPlatform
.
ios_x64
deviceId:
globalResults
[
'device-id'
]
));
));
}
}
}
else
{
}
else
{
...
@@ -305,10 +302,9 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -305,10 +302,9 @@ class FlutterCommandRunner extends CommandRunner {
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
debug
,
type:
BuildType
.
debug
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
android
,
targetPlatform:
TargetPlatform
.
android
_arm
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'android-debug-build-path'
],
buildPath:
globalResults
[
'android-debug-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
...
@@ -324,19 +320,17 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -324,19 +320,17 @@ class FlutterCommandRunner extends CommandRunner {
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
debug
,
type:
BuildType
.
debug
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
i
OS
,
targetPlatform:
TargetPlatform
.
i
os_arm
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-debug-build-path'
],
buildPath:
globalResults
[
'ios-debug-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
debug
,
type:
BuildType
.
debug
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
i
OSSimulator
,
targetPlatform:
TargetPlatform
.
i
os_x64
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-sim-debug-build-path'
],
buildPath:
globalResults
[
'ios-sim-debug-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
}
}
}
}
...
@@ -345,10 +339,9 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -345,10 +339,9 @@ class FlutterCommandRunner extends CommandRunner {
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
release
,
type:
BuildType
.
release
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
android
,
targetPlatform:
TargetPlatform
.
android
_arm
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'android-release-build-path'
],
buildPath:
globalResults
[
'android-release-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
...
@@ -364,19 +357,17 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -364,19 +357,17 @@ class FlutterCommandRunner extends CommandRunner {
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
release
,
type:
BuildType
.
release
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
i
OS
,
targetPlatform:
TargetPlatform
.
i
os_arm
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-release-build-path'
],
buildPath:
globalResults
[
'ios-release-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
configs
.
add
(
new
BuildConfiguration
.
local
(
configs
.
add
(
new
BuildConfiguration
.
local
(
type:
BuildType
.
release
,
type:
BuildType
.
release
,
hostPlatform:
hostPlatform
,
hostPlatform:
hostPlatform
,
targetPlatform:
TargetPlatform
.
i
OSSimulator
,
targetPlatform:
TargetPlatform
.
i
os_x64
,
enginePath:
enginePath
,
enginePath:
enginePath
,
buildPath:
globalResults
[
'ios-sim-release-build-path'
],
buildPath:
globalResults
[
'ios-sim-release-build-path'
]
deviceId:
globalResults
[
'device-id'
]
));
));
}
}
}
}
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
e939b152
...
@@ -32,17 +32,17 @@ class MockToolchain extends Toolchain {
...
@@ -32,17 +32,17 @@ class MockToolchain extends Toolchain {
}
}
class
MockAndroidDevice
extends
Mock
implements
AndroidDevice
{
class
MockAndroidDevice
extends
Mock
implements
AndroidDevice
{
TargetPlatform
get
platform
=>
TargetPlatform
.
android
;
TargetPlatform
get
platform
=>
TargetPlatform
.
android
_arm
;
bool
isSupported
()
=>
true
;
bool
isSupported
()
=>
true
;
}
}
class
MockIOSDevice
extends
Mock
implements
IOSDevice
{
class
MockIOSDevice
extends
Mock
implements
IOSDevice
{
TargetPlatform
get
platform
=>
TargetPlatform
.
i
OS
;
TargetPlatform
get
platform
=>
TargetPlatform
.
i
os_arm
;
bool
isSupported
()
=>
true
;
bool
isSupported
()
=>
true
;
}
}
class
MockIOSSimulator
extends
Mock
implements
IOSSimulator
{
class
MockIOSSimulator
extends
Mock
implements
IOSSimulator
{
TargetPlatform
get
platform
=>
TargetPlatform
.
i
OSSimulator
;
TargetPlatform
get
platform
=>
TargetPlatform
.
i
os_x64
;
bool
isSupported
()
=>
true
;
bool
isSupported
()
=>
true
;
}
}
...
...
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