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
ba57ea09
Unverified
Commit
ba57ea09
authored
Mar 25, 2020
by
Jenn Magder
Committed by
GitHub
Mar 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Move processUtils into globals (#53209)" (#53301)
parent
86389be6
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
103 additions
and
90 deletions
+103
-90
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+14
-14
android_emulator.dart
packages/flutter_tools/lib/src/android/android_emulator.dart
+3
-2
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+2
-2
android_studio.dart
packages/flutter_tools/lib/src/android/android_studio.dart
+1
-1
android_workflow.dart
packages/flutter_tools/lib/src/android/android_workflow.dart
+3
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+3
-3
gradle_errors.dart
packages/flutter_tools/lib/src/android/gradle_errors.dart
+1
-1
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-1
process.dart
packages/flutter_tools/lib/src/base/process.dart
+4
-0
ios.dart
packages/flutter_tools/lib/src/build_system/targets/ios.dart
+1
-1
cache.dart
packages/flutter_tools/lib/src/cache.dart
+1
-1
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+10
-10
channel.dart
packages/flutter_tools/lib/src/commands/channel.dart
+6
-5
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+2
-1
format.dart
packages/flutter_tools/lib/src/commands/format.dart
+2
-2
upgrade.dart
packages/flutter_tools/lib/src/commands/upgrade.dart
+8
-8
version.dart
packages/flutter_tools/lib/src/commands/version.dart
+4
-4
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+3
-2
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+2
-1
emulator.dart
packages/flutter_tools/lib/src/emulator.dart
+3
-3
fuchsia_build.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart
+2
-1
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+2
-2
fuchsia_kernel_compiler.dart
...lutter_tools/lib/src/fuchsia/fuchsia_kernel_compiler.dart
+2
-1
fuchsia_pm.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
+2
-2
globals.dart
packages/flutter_tools/lib/src/globals.dart
+0
-2
ios_emulators.dart
packages/flutter_tools/lib/src/ios/ios_emulators.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+2
-2
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+3
-3
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+2
-1
build_macos.dart
packages/flutter_tools/lib/src/macos/build_macos.dart
+2
-1
coverage_collector.dart
packages/flutter_tools/lib/src/test/coverage_collector.dart
+1
-1
version.dart
packages/flutter_tools/lib/src/version.dart
+7
-7
build_windows.dart
packages/flutter_tools/lib/src/windows/build_windows.dart
+2
-1
windows_device.dart
packages/flutter_tools/lib/src/windows/windows_device.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
ba57ea09
...
@@ -225,7 +225,7 @@ class AndroidDevice extends Device {
...
@@ -225,7 +225,7 @@ class AndroidDevice extends Device {
bool
allowReentrantFlutter
=
false
,
bool
allowReentrantFlutter
=
false
,
Map
<
String
,
String
>
environment
,
Map
<
String
,
String
>
environment
,
})
{
})
{
return
globals
.
processUtils
.
runSync
(
return
processUtils
.
runSync
(
adbCommandForDevice
(
params
),
adbCommandForDevice
(
params
),
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
...
@@ -240,7 +240,7 @@ class AndroidDevice extends Device {
...
@@ -240,7 +240,7 @@ class AndroidDevice extends Device {
String
workingDirectory
,
String
workingDirectory
,
bool
allowReentrantFlutter
=
false
,
bool
allowReentrantFlutter
=
false
,
})
async
{
})
async
{
return
globals
.
processUtils
.
run
(
return
processUtils
.
run
(
adbCommandForDevice
(
params
),
adbCommandForDevice
(
params
),
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
...
@@ -278,7 +278,7 @@ class AndroidDevice extends Device {
...
@@ -278,7 +278,7 @@ class AndroidDevice extends Device {
}
}
try
{
try
{
final
RunResult
adbVersion
=
await
globals
.
processUtils
.
run
(
final
RunResult
adbVersion
=
await
processUtils
.
run
(
<
String
>[
getAdbPath
(
androidSdk
),
'version'
],
<
String
>[
getAdbPath
(
androidSdk
),
'version'
],
throwOnError:
true
,
throwOnError:
true
,
);
);
...
@@ -299,7 +299,7 @@ class AndroidDevice extends Device {
...
@@ -299,7 +299,7 @@ class AndroidDevice extends Device {
// output lines like this, which we want to ignore:
// output lines like this, which we want to ignore:
// adb server is out of date. killing..
// adb server is out of date. killing..
// * daemon started successfully *
// * daemon started successfully *
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
<
String
>[
getAdbPath
(
androidSdk
),
'start-server'
],
<
String
>[
getAdbPath
(
androidSdk
),
'start-server'
],
throwOnError:
true
,
throwOnError:
true
,
);
);
...
@@ -336,7 +336,7 @@ class AndroidDevice extends Device {
...
@@ -336,7 +336,7 @@ class AndroidDevice extends Device {
}
}
Future
<
String
>
_getDeviceApkSha1
(
AndroidApk
apk
)
async
{
Future
<
String
>
_getDeviceApkSha1
(
AndroidApk
apk
)
async
{
final
RunResult
result
=
await
globals
.
processUtils
.
run
(
final
RunResult
result
=
await
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
'shell'
,
'cat'
,
_getDeviceSha1Path
(
apk
)]));
adbCommandForDevice
(<
String
>[
'shell'
,
'cat'
,
_getDeviceSha1Path
(
apk
)]));
return
result
.
stdout
;
return
result
.
stdout
;
}
}
...
@@ -380,7 +380,7 @@ class AndroidDevice extends Device {
...
@@ -380,7 +380,7 @@ class AndroidDevice extends Device {
}
}
final
Status
status
=
globals
.
logger
.
startProgress
(
'Installing
${globals.fs.path.relative(app.file.path)}
...'
,
timeout:
timeoutConfiguration
.
slowOperation
);
final
Status
status
=
globals
.
logger
.
startProgress
(
'Installing
${globals.fs.path.relative(app.file.path)}
...'
,
timeout:
timeoutConfiguration
.
slowOperation
);
final
RunResult
installResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
installResult
=
await
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
'install'
,
'-t'
,
'-r'
,
app
.
file
.
path
]));
adbCommandForDevice
(<
String
>[
'install'
,
'-t'
,
'-r'
,
app
.
file
.
path
]));
status
.
stop
();
status
.
stop
();
// Some versions of adb exit with exit code 0 even on failure :(
// Some versions of adb exit with exit code 0 even on failure :(
...
@@ -416,7 +416,7 @@ class AndroidDevice extends Device {
...
@@ -416,7 +416,7 @@ class AndroidDevice extends Device {
String
uninstallOut
;
String
uninstallOut
;
try
{
try
{
final
RunResult
uninstallResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
uninstallResult
=
await
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
'uninstall'
,
app
.
id
]),
adbCommandForDevice
(<
String
>[
'uninstall'
,
app
.
id
]),
throwOnError:
true
,
throwOnError:
true
,
);
);
...
@@ -647,13 +647,13 @@ class AndroidDevice extends Device {
...
@@ -647,13 +647,13 @@ class AndroidDevice extends Device {
@override
@override
Future
<
bool
>
stopApp
(
AndroidApk
app
)
{
Future
<
bool
>
stopApp
(
AndroidApk
app
)
{
final
List
<
String
>
command
=
adbCommandForDevice
(<
String
>[
'shell'
,
'am'
,
'force-stop'
,
app
.
id
]);
final
List
<
String
>
command
=
adbCommandForDevice
(<
String
>[
'shell'
,
'am'
,
'force-stop'
,
app
.
id
]);
return
globals
.
processUtils
.
stream
(
command
).
then
<
bool
>(
return
processUtils
.
stream
(
command
).
then
<
bool
>(
(
int
exitCode
)
=>
exitCode
==
0
||
allowHeapCorruptionOnWindows
(
exitCode
));
(
int
exitCode
)
=>
exitCode
==
0
||
allowHeapCorruptionOnWindows
(
exitCode
));
}
}
@override
@override
Future
<
MemoryInfo
>
queryMemoryInfo
()
async
{
Future
<
MemoryInfo
>
queryMemoryInfo
()
async
{
final
RunResult
runResult
=
await
globals
.
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
final
RunResult
runResult
=
await
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
'shell'
,
'shell'
,
'dumpsys'
,
'dumpsys'
,
'meminfo'
,
'meminfo'
,
...
@@ -669,7 +669,7 @@ class AndroidDevice extends Device {
...
@@ -669,7 +669,7 @@ class AndroidDevice extends Device {
@override
@override
void
clearLogs
()
{
void
clearLogs
()
{
globals
.
processUtils
.
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
processUtils
.
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
}
}
@override
@override
...
@@ -709,7 +709,7 @@ class AndroidDevice extends Device {
...
@@ -709,7 +709,7 @@ class AndroidDevice extends Device {
Future
<
void
>
takeScreenshot
(
File
outputFile
)
async
{
Future
<
void
>
takeScreenshot
(
File
outputFile
)
async
{
const
String
remotePath
=
'/data/local/tmp/flutter_screenshot.png'
;
const
String
remotePath
=
'/data/local/tmp/flutter_screenshot.png'
;
await
runAdbCheckedAsync
(<
String
>[
'shell'
,
'screencap'
,
'-p'
,
remotePath
]);
await
runAdbCheckedAsync
(<
String
>[
'shell'
,
'screencap'
,
'-p'
,
remotePath
]);
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
adbCommandForDevice
(<
String
>[
'pull'
,
remotePath
,
outputFile
.
path
]),
adbCommandForDevice
(<
String
>[
'pull'
,
remotePath
,
outputFile
.
path
]),
throwOnError:
true
,
throwOnError:
true
,
);
);
...
@@ -1074,7 +1074,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
...
@@ -1074,7 +1074,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
String
stdout
;
String
stdout
;
try
{
try
{
stdout
=
globals
.
processUtils
.
runSync
(
stdout
=
processUtils
.
runSync
(
device
.
adbCommandForDevice
(<
String
>[
'forward'
,
'--list'
]),
device
.
adbCommandForDevice
(<
String
>[
'forward'
,
'--list'
]),
throwOnError:
true
,
throwOnError:
true
,
).
stdout
.
trim
();
).
stdout
.
trim
();
...
@@ -1118,7 +1118,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
...
@@ -1118,7 +1118,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
'tcp:
$hostPort
'
,
'tcp:
$hostPort
'
,
'tcp:
$devicePort
'
,
'tcp:
$devicePort
'
,
];
];
final
RunResult
process
=
await
globals
.
processUtils
.
run
(
final
RunResult
process
=
await
processUtils
.
run
(
device
.
adbCommandForDevice
(
forwardCommand
),
device
.
adbCommandForDevice
(
forwardCommand
),
throwOnError:
true
,
throwOnError:
true
,
);
);
...
@@ -1171,7 +1171,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
...
@@ -1171,7 +1171,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
'--remove'
,
'--remove'
,
'tcp:
${forwardedPort.hostPort}
'
,
'tcp:
${forwardedPort.hostPort}
'
,
];
];
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
device
.
adbCommandForDevice
(
unforwardCommand
),
device
.
adbCommandForDevice
(
unforwardCommand
),
throwOnError:
true
,
throwOnError:
true
,
);
);
...
...
packages/flutter_tools/lib/src/android/android_emulator.dart
View file @
ba57ea09
...
@@ -11,6 +11,7 @@ import '../android/android_workflow.dart';
...
@@ -11,6 +11,7 @@ import '../android/android_workflow.dart';
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../base/process.dart'
;
import
'../base/utils.dart'
;
import
'../base/utils.dart'
;
import
'../convert.dart'
;
import
'../convert.dart'
;
import
'../device.dart'
;
import
'../device.dart'
;
...
@@ -53,7 +54,7 @@ class AndroidEmulator extends Emulator {
...
@@ -53,7 +54,7 @@ class AndroidEmulator extends Emulator {
@override
@override
Future
<
void
>
launch
()
async
{
Future
<
void
>
launch
()
async
{
final
Process
process
=
await
globals
.
processUtils
.
start
(
final
Process
process
=
await
processUtils
.
start
(
<
String
>[
getEmulatorPath
(
androidSdk
),
'-avd'
,
id
],
<
String
>[
getEmulatorPath
(
androidSdk
),
'-avd'
,
id
],
);
);
...
@@ -116,7 +117,7 @@ List<AndroidEmulator> getEmulatorAvds() {
...
@@ -116,7 +117,7 @@ List<AndroidEmulator> getEmulatorAvds() {
return
<
AndroidEmulator
>[];
return
<
AndroidEmulator
>[];
}
}
final
String
listAvdsOutput
=
globals
.
processUtils
.
runSync
(
final
String
listAvdsOutput
=
processUtils
.
runSync
(
<
String
>[
emulatorPath
,
'-list-avds'
]).
stdout
.
trim
();
<
String
>[
emulatorPath
,
'-list-avds'
]).
stdout
.
trim
();
final
List
<
AndroidEmulator
>
emulators
=
<
AndroidEmulator
>[];
final
List
<
AndroidEmulator
>
emulators
=
<
AndroidEmulator
>[];
...
...
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
ba57ea09
...
@@ -582,7 +582,7 @@ class AndroidSdk {
...
@@ -582,7 +582,7 @@ class AndroidSdk {
// See: http://stackoverflow.com/questions/14292698/how-do-i-check-if-the-java-jdk-is-installed-on-mac.
// See: http://stackoverflow.com/questions/14292698/how-do-i-check-if-the-java-jdk-is-installed-on-mac.
if
(
platform
.
isMacOS
)
{
if
(
platform
.
isMacOS
)
{
try
{
try
{
final
String
javaHomeOutput
=
globals
.
processUtils
.
runSync
(
final
String
javaHomeOutput
=
processUtils
.
runSync
(
<
String
>[
'/usr/libexec/java_home'
],
<
String
>[
'/usr/libexec/java_home'
],
throwOnError:
true
,
throwOnError:
true
,
hideStdout:
true
,
hideStdout:
true
,
...
@@ -628,7 +628,7 @@ class AndroidSdk {
...
@@ -628,7 +628,7 @@ class AndroidSdk {
if
(!
globals
.
processManager
.
canRun
(
sdkManagerPath
))
{
if
(!
globals
.
processManager
.
canRun
(
sdkManagerPath
))
{
throwToolExit
(
'Android sdkmanager not found. Update to the latest Android SDK to resolve this.'
);
throwToolExit
(
'Android sdkmanager not found. Update to the latest Android SDK to resolve this.'
);
}
}
final
RunResult
result
=
globals
.
processUtils
.
runSync
(
final
RunResult
result
=
processUtils
.
runSync
(
<
String
>[
sdkManagerPath
,
'--version'
],
<
String
>[
sdkManagerPath
,
'--version'
],
environment:
sdkManagerEnv
,
environment:
sdkManagerEnv
,
);
);
...
...
packages/flutter_tools/lib/src/android/android_studio.dart
View file @
ba57ea09
...
@@ -310,7 +310,7 @@ class AndroidStudio implements Comparable<AndroidStudio> {
...
@@ -310,7 +310,7 @@ class AndroidStudio implements Comparable<AndroidStudio> {
}
else
{
}
else
{
RunResult
result
;
RunResult
result
;
try
{
try
{
result
=
globals
.
processUtils
.
runSync
(<
String
>[
javaExecutable
,
'-version'
]);
result
=
processUtils
.
runSync
(<
String
>[
javaExecutable
,
'-version'
]);
}
on
ProcessException
catch
(
e
)
{
}
on
ProcessException
catch
(
e
)
{
_validationMessages
.
add
(
'Failed to run Java:
$e
'
);
_validationMessages
.
add
(
'Failed to run Java:
$e
'
);
}
}
...
...
packages/flutter_tools/lib/src/android/android_workflow.dart
View file @
ba57ea09
...
@@ -14,6 +14,7 @@ import '../base/file_system.dart';
...
@@ -14,6 +14,7 @@ import '../base/file_system.dart';
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/os.dart'
;
import
'../base/os.dart'
;
import
'../base/process.dart'
;
import
'../base/user_messages.dart'
;
import
'../base/user_messages.dart'
;
import
'../base/utils.dart'
;
import
'../base/utils.dart'
;
import
'../base/version.dart'
;
import
'../base/version.dart'
;
...
@@ -322,7 +323,7 @@ class AndroidLicenseValidator extends DoctorValidator {
...
@@ -322,7 +323,7 @@ class AndroidLicenseValidator extends DoctorValidator {
}
}
try
{
try
{
final
Process
process
=
await
globals
.
processUtils
.
start
(
final
Process
process
=
await
processUtils
.
start
(
<
String
>[
androidSdk
.
sdkManagerPath
,
'--licenses'
],
<
String
>[
androidSdk
.
sdkManagerPath
,
'--licenses'
],
environment:
androidSdk
.
sdkManagerEnv
,
environment:
androidSdk
.
sdkManagerEnv
,
);
);
...
@@ -359,7 +360,7 @@ class AndroidLicenseValidator extends DoctorValidator {
...
@@ -359,7 +360,7 @@ class AndroidLicenseValidator extends DoctorValidator {
}
}
try
{
try
{
final
Process
process
=
await
globals
.
processUtils
.
start
(
final
Process
process
=
await
processUtils
.
start
(
<
String
>[
androidSdk
.
sdkManagerPath
,
'--licenses'
],
<
String
>[
androidSdk
.
sdkManagerPath
,
'--licenses'
],
environment:
androidSdk
.
sdkManagerEnv
,
environment:
androidSdk
.
sdkManagerEnv
,
);
);
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
ba57ea09
...
@@ -142,7 +142,7 @@ Future<void> checkGradleDependencies() async {
...
@@ -142,7 +142,7 @@ Future<void> checkGradleDependencies() async {
timeout:
timeoutConfiguration
.
slowOperation
,
timeout:
timeoutConfiguration
.
slowOperation
,
);
);
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
await
globals
.
processUtils
.
run
(<
String
>[
await
processUtils
.
run
(<
String
>[
gradleUtils
.
getExecutable
(
flutterProject
),
gradleUtils
.
getExecutable
(
flutterProject
),
'dependencies'
,
'dependencies'
,
],
],
...
@@ -382,7 +382,7 @@ Future<void> buildGradleApp({
...
@@ -382,7 +382,7 @@ Future<void> buildGradleApp({
final
Stopwatch
sw
=
Stopwatch
()..
start
();
final
Stopwatch
sw
=
Stopwatch
()..
start
();
int
exitCode
=
1
;
int
exitCode
=
1
;
try
{
try
{
exitCode
=
await
globals
.
processUtils
.
stream
(
exitCode
=
await
processUtils
.
stream
(
command
,
command
,
workingDirectory:
project
.
android
.
hostAppGradleRoot
.
path
,
workingDirectory:
project
.
android
.
hostAppGradleRoot
.
path
,
allowReentrantFlutter:
true
,
allowReentrantFlutter:
true
,
...
@@ -584,7 +584,7 @@ Future<void> buildGradleAar({
...
@@ -584,7 +584,7 @@ Future<void> buildGradleAar({
final
Stopwatch
sw
=
Stopwatch
()..
start
();
final
Stopwatch
sw
=
Stopwatch
()..
start
();
RunResult
result
;
RunResult
result
;
try
{
try
{
result
=
await
globals
.
processUtils
.
run
(
result
=
await
processUtils
.
run
(
command
,
command
,
workingDirectory:
project
.
android
.
hostAppGradleRoot
.
path
,
workingDirectory:
project
.
android
.
hostAppGradleRoot
.
path
,
allowReentrantFlutter:
true
,
allowReentrantFlutter:
true
,
...
...
packages/flutter_tools/lib/src/android/gradle_errors.dart
View file @
ba57ea09
...
@@ -270,7 +270,7 @@ final GradleHandledError flavorUndefinedHandler = GradleHandledError(
...
@@ -270,7 +270,7 @@ final GradleHandledError flavorUndefinedHandler = GradleHandledError(
bool
usesAndroidX
,
bool
usesAndroidX
,
bool
shouldBuildPluginAsAar
,
bool
shouldBuildPluginAsAar
,
})
async
{
})
async
{
final
RunResult
tasksRunResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
tasksRunResult
=
await
processUtils
.
run
(
<
String
>[
<
String
>[
gradleUtils
.
getExecutable
(
project
),
gradleUtils
.
getExecutable
(
project
),
'app:tasks'
,
'app:tasks'
,
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
ba57ea09
...
@@ -117,7 +117,7 @@ class AndroidApk extends ApplicationPackage {
...
@@ -117,7 +117,7 @@ class AndroidApk extends ApplicationPackage {
String
apptStdout
;
String
apptStdout
;
try
{
try
{
apptStdout
=
globals
.
processUtils
.
runSync
(
apptStdout
=
processUtils
.
runSync
(
<
String
>[
<
String
>[
aaptPath
,
aaptPath
,
'dump'
,
'dump'
,
...
...
packages/flutter_tools/lib/src/base/process.dart
View file @
ba57ea09
...
@@ -180,6 +180,8 @@ class RunResult {
...
@@ -180,6 +180,8 @@ class RunResult {
typedef
RunResultChecker
=
bool
Function
(
int
);
typedef
RunResultChecker
=
bool
Function
(
int
);
ProcessUtils
get
processUtils
=>
ProcessUtils
.
instance
;
abstract
class
ProcessUtils
{
abstract
class
ProcessUtils
{
factory
ProcessUtils
({
factory
ProcessUtils
({
@required
ProcessManager
processManager
,
@required
ProcessManager
processManager
,
...
@@ -189,6 +191,8 @@ abstract class ProcessUtils {
...
@@ -189,6 +191,8 @@ abstract class ProcessUtils {
logger:
logger
,
logger:
logger
,
);
);
static
ProcessUtils
get
instance
=>
context
.
get
<
ProcessUtils
>();
/// Spawns a child process to run the command [cmd].
/// Spawns a child process to run the command [cmd].
///
///
/// When [throwOnError] is `true`, if the child process finishes with a non-zero
/// When [throwOnError] is `true`, if the child process finishes with a non-zero
...
...
packages/flutter_tools/lib/src/build_system/targets/ios.dart
View file @
ba57ea09
...
@@ -224,7 +224,7 @@ class DebugUniveralFramework extends Target {
...
@@ -224,7 +224,7 @@ class DebugUniveralFramework extends Target {
'-output'
,
'-output'
,
lipoOutputFile
.
path
lipoOutputFile
.
path
];
];
final
RunResult
lipoResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
lipoResult
=
await
processUtils
.
run
(
lipoCommand
,
lipoCommand
,
);
);
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
ba57ea09
...
@@ -984,7 +984,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
...
@@ -984,7 +984,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
try
{
try
{
final
String
gradleExecutable
=
gradle
.
absolute
.
path
;
final
String
gradleExecutable
=
gradle
.
absolute
.
path
;
final
String
flutterSdk
=
globals
.
fsUtils
.
escapePath
(
Cache
.
flutterRoot
);
final
String
flutterSdk
=
globals
.
fsUtils
.
escapePath
(
Cache
.
flutterRoot
);
final
RunResult
processResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
processResult
=
await
processUtils
.
run
(
<
String
>[
<
String
>[
gradleExecutable
,
gradleExecutable
,
'-b'
,
globals
.
fs
.
path
.
join
(
flutterSdk
,
'packages'
,
'flutter_tools'
,
'gradle'
,
'resolve_dependencies.gradle'
),
'-b'
,
globals
.
fs
.
path
.
join
(
flutterSdk
,
'packages'
,
'flutter_tools'
,
'gradle'
,
'resolve_dependencies.gradle'
),
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
ba57ea09
...
@@ -324,7 +324,7 @@ end
...
@@ -324,7 +324,7 @@ end
'
-
output
',
'
-
output
',
fatFlutterFrameworkBinary.path
fatFlutterFrameworkBinary.path
];
];
final RunResult lipoResult = await
globals.
processUtils.run(
final RunResult lipoResult = await processUtils.run(
lipoCommand,
lipoCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
@@ -406,7 +406,7 @@ end
...
@@ -406,7 +406,7 @@ end
destinationAppFrameworkDirectory.childFile(binaryName).path
destinationAppFrameworkDirectory.childFile(binaryName).path
];
];
final RunResult lipoResult = await
globals.
processUtils.run(
final RunResult lipoResult = await processUtils.run(
lipoCommand,
lipoCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
@@ -478,7 +478,7 @@ end
...
@@ -478,7 +478,7 @@ end
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
];
];
RunResult buildPluginsResult = await
globals.
processUtils.run(
RunResult buildPluginsResult = await processUtils.run(
pluginsBuildCommand,
pluginsBuildCommand,
workingDirectory: _project.ios.hostAppRoot.childDirectory('
Pods
').path,
workingDirectory: _project.ios.hostAppRoot.childDirectory('
Pods
').path,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
...
@@ -504,7 +504,7 @@ end
...
@@ -504,7 +504,7 @@ end
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
];
];
buildPluginsResult = await
globals.
processUtils.run(
buildPluginsResult = await processUtils.run(
pluginsBuildCommand,
pluginsBuildCommand,
workingDirectory: _project.ios.hostAppRoot
workingDirectory: _project.ios.hostAppRoot
.childDirectory('
Pods
')
.childDirectory('
Pods
')
...
@@ -556,7 +556,7 @@ end
...
@@ -556,7 +556,7 @@ end
modeDirectory.childDirectory(podFrameworkName).childFile(binaryName).path
modeDirectory.childDirectory(podFrameworkName).childFile(binaryName).path
];
];
final RunResult pluginsLipoResult = await
globals.
processUtils.run(
final RunResult pluginsLipoResult = await processUtils.run(
lipoCommand,
lipoCommand,
workingDirectory: outputDirectory.path,
workingDirectory: outputDirectory.path,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
...
@@ -587,7 +587,7 @@ end
...
@@ -587,7 +587,7 @@ end
modeDirectory.childFile('
$binaryName
.
xcframework
').path
modeDirectory.childFile('
$binaryName
.
xcframework
').path
];
];
final RunResult xcframeworkResult = await
globals.
processUtils.run(
final RunResult xcframeworkResult = await processUtils.run(
xcframeworkCommand,
xcframeworkCommand,
workingDirectory: outputDirectory.path,
workingDirectory: outputDirectory.path,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
...
@@ -664,7 +664,7 @@ end
...
@@ -664,7 +664,7 @@ end
armFlutterFrameworkBinary.path
armFlutterFrameworkBinary.path
];
];
RunResult lipoResult = await
globals.
processUtils.run(
RunResult lipoResult = await processUtils.run(
lipoCommand,
lipoCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
@@ -690,7 +690,7 @@ end
...
@@ -690,7 +690,7 @@ end
simulatorFlutterFrameworkBinary.path
simulatorFlutterFrameworkBinary.path
];
];
lipoResult = await
globals.
processUtils.run(
lipoResult = await processUtils.run(
lipoCommand,
lipoCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
@@ -712,7 +712,7 @@ end
...
@@ -712,7 +712,7 @@ end
.path
.path
];
];
final RunResult xcframeworkResult = await
globals.
processUtils.run(
final RunResult xcframeworkResult = await processUtils.run(
xcframeworkCommand,
xcframeworkCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
@@ -744,7 +744,7 @@ end
...
@@ -744,7 +744,7 @@ end
.path
.path
];
];
final RunResult xcframeworkResult = await
globals.
processUtils.run(
final RunResult xcframeworkResult = await processUtils.run(
xcframeworkCommand,
xcframeworkCommand,
allowReentrantFlutter: false,
allowReentrantFlutter: false,
);
);
...
...
packages/flutter_tools/lib/src/commands/channel.dart
View file @
ba57ea09
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:async'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/process.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
import
'../runner/flutter_command.dart'
;
import
'../runner/flutter_command.dart'
;
...
@@ -60,7 +61,7 @@ class ChannelCommand extends FlutterCommand {
...
@@ -60,7 +61,7 @@ class ChannelCommand extends FlutterCommand {
showAll
=
showAll
||
currentChannel
!=
currentBranch
;
showAll
=
showAll
||
currentChannel
!=
currentBranch
;
globals
.
printStatus
(
'Flutter channels:'
);
globals
.
printStatus
(
'Flutter channels:'
);
final
int
result
=
await
globals
.
processUtils
.
stream
(
final
int
result
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'branch'
,
'-r'
],
<
String
>[
'git'
,
'branch'
,
'-r'
],
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
mapFunction:
(
String
line
)
{
mapFunction:
(
String
line
)
{
...
@@ -139,28 +140,28 @@ class ChannelCommand extends FlutterCommand {
...
@@ -139,28 +140,28 @@ class ChannelCommand extends FlutterCommand {
static
Future
<
void
>
_checkout
(
String
branchName
)
async
{
static
Future
<
void
>
_checkout
(
String
branchName
)
async
{
// Get latest refs from upstream.
// Get latest refs from upstream.
int
result
=
await
globals
.
processUtils
.
stream
(
int
result
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'fetch'
],
<
String
>[
'git'
,
'fetch'
],
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
prefix:
'git: '
,
prefix:
'git: '
,
);
);
if
(
result
==
0
)
{
if
(
result
==
0
)
{
result
=
await
globals
.
processUtils
.
stream
(
result
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'show-ref'
,
'--verify'
,
'--quiet'
,
'refs/heads/
$branchName
'
],
<
String
>[
'git'
,
'show-ref'
,
'--verify'
,
'--quiet'
,
'refs/heads/
$branchName
'
],
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
prefix:
'git: '
,
prefix:
'git: '
,
);
);
if
(
result
==
0
)
{
if
(
result
==
0
)
{
// branch already exists, try just switching to it
// branch already exists, try just switching to it
result
=
await
globals
.
processUtils
.
stream
(
result
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'checkout'
,
branchName
,
'--'
],
<
String
>[
'git'
,
'checkout'
,
branchName
,
'--'
],
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
prefix:
'git: '
,
prefix:
'git: '
,
);
);
}
else
{
}
else
{
// branch does not exist, we have to create it
// branch does not exist, we have to create it
result
=
await
globals
.
processUtils
.
stream
(
result
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'checkout'
,
'--track'
,
'-b'
,
branchName
,
'origin/
$branchName
'
],
<
String
>[
'git'
,
'checkout'
,
'--track'
,
'-b'
,
branchName
,
'origin/
$branchName
'
],
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
prefix:
'git: '
,
prefix:
'git: '
,
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
ba57ea09
...
@@ -11,6 +11,7 @@ import 'package:webdriver/async_io.dart' as async_io;
...
@@ -11,6 +11,7 @@ import 'package:webdriver/async_io.dart' as async_io;
import
'../application_package.dart'
;
import
'../application_package.dart'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../dart/package_map.dart'
;
import
'../dart/package_map.dart'
;
...
@@ -467,7 +468,7 @@ Future<void> _runTests(List<String> testArgs, Map<String, String> environment) a
...
@@ -467,7 +468,7 @@ Future<void> _runTests(List<String> testArgs, Map<String, String> environment) a
PackageMap
.
globalPackagesPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
absolute
(
PackageMap
.
globalPackagesPath
));
PackageMap
.
globalPackagesPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
absolute
(
PackageMap
.
globalPackagesPath
));
final
String
dartVmPath
=
globals
.
fs
.
path
.
join
(
dartSdkPath
,
'bin'
,
'dart'
);
final
String
dartVmPath
=
globals
.
fs
.
path
.
join
(
dartSdkPath
,
'bin'
,
'dart'
);
final
int
result
=
await
globals
.
processUtils
.
stream
(
final
int
result
=
await
processUtils
.
stream
(
<
String
>[
<
String
>[
dartVmPath
,
dartVmPath
,
...
dartVmFlags
,
...
dartVmFlags
,
...
...
packages/flutter_tools/lib/src/commands/format.dart
View file @
ba57ea09
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
import
'dart:async'
;
import
'dart:async'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/process.dart'
;
import
'../dart/sdk.dart'
;
import
'../dart/sdk.dart'
;
import
'../globals.dart'
as
globals
;
import
'../runner/flutter_command.dart'
;
import
'../runner/flutter_command.dart'
;
class
FormatCommand
extends
FlutterCommand
{
class
FormatCommand
extends
FlutterCommand
{
...
@@ -71,7 +71,7 @@ class FormatCommand extends FlutterCommand {
...
@@ -71,7 +71,7 @@ class FormatCommand extends FlutterCommand {
...
argResults
.
rest
,
...
argResults
.
rest
,
];
];
final
int
result
=
await
globals
.
processUtils
.
stream
(
command
);
final
int
result
=
await
processUtils
.
stream
(
command
);
if
(
result
!=
0
)
{
if
(
result
!=
0
)
{
throwToolExit
(
'Formatting failed:
$result
'
,
exitCode:
result
);
throwToolExit
(
'Formatting failed:
$result
'
,
exitCode:
result
);
}
}
...
...
packages/flutter_tools/lib/src/commands/upgrade.dart
View file @
ba57ea09
...
@@ -61,7 +61,7 @@ class UpgradeCommand extends FlutterCommand {
...
@@ -61,7 +61,7 @@ class UpgradeCommand extends FlutterCommand {
force:
boolArg
(
'force'
),
force:
boolArg
(
'force'
),
continueFlow:
boolArg
(
'continue'
),
continueFlow:
boolArg
(
'continue'
),
testFlow:
stringArg
(
'working-directory'
)
!=
null
,
testFlow:
stringArg
(
'working-directory'
)
!=
null
,
gitTagVersion:
GitTagVersion
.
determine
(
globals
.
processUtils
),
gitTagVersion:
GitTagVersion
.
determine
(
processUtils
),
flutterVersion:
stringArg
(
'working-directory'
)
==
null
flutterVersion:
stringArg
(
'working-directory'
)
==
null
?
globals
.
flutterVersion
?
globals
.
flutterVersion
:
FlutterVersion
(
const
SystemClock
(),
_commandRunner
.
workingDirectory
),
:
FlutterVersion
(
const
SystemClock
(),
_commandRunner
.
workingDirectory
),
...
@@ -152,7 +152,7 @@ class UpgradeCommandRunner {
...
@@ -152,7 +152,7 @@ class UpgradeCommandRunner {
}
}
Future
<
void
>
flutterUpgradeContinue
()
async
{
Future
<
void
>
flutterUpgradeContinue
()
async
{
final
int
code
=
await
globals
.
processUtils
.
stream
(
final
int
code
=
await
processUtils
.
stream
(
<
String
>[
<
String
>[
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'upgrade'
,
'upgrade'
,
...
@@ -182,7 +182,7 @@ class UpgradeCommandRunner {
...
@@ -182,7 +182,7 @@ class UpgradeCommandRunner {
Future
<
bool
>
hasUncomittedChanges
()
async
{
Future
<
bool
>
hasUncomittedChanges
()
async
{
try
{
try
{
final
RunResult
result
=
await
globals
.
processUtils
.
run
(
final
RunResult
result
=
await
processUtils
.
run
(
<
String
>[
'git'
,
'status'
,
'-s'
],
<
String
>[
'git'
,
'status'
,
'-s'
],
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
...
@@ -205,7 +205,7 @@ class UpgradeCommandRunner {
...
@@ -205,7 +205,7 @@ class UpgradeCommandRunner {
/// Exits tool if there is no upstream.
/// Exits tool if there is no upstream.
Future
<
void
>
verifyUpstreamConfigured
()
async
{
Future
<
void
>
verifyUpstreamConfigured
()
async
{
try
{
try
{
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
<
String
>[
'git'
,
'rev-parse'
,
'@{u}'
],
<
String
>[
'git'
,
'rev-parse'
,
'@{u}'
],
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
...
@@ -232,7 +232,7 @@ class UpgradeCommandRunner {
...
@@ -232,7 +232,7 @@ class UpgradeCommandRunner {
tag
=
'v
${gitTagVersion.x}
.
${gitTagVersion.y}
.
${gitTagVersion.z}
'
;
tag
=
'v
${gitTagVersion.x}
.
${gitTagVersion.y}
.
${gitTagVersion.z}
'
;
}
}
try
{
try
{
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
<
String
>[
'git'
,
'reset'
,
'--hard'
,
tag
],
<
String
>[
'git'
,
'reset'
,
'--hard'
,
tag
],
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
...
@@ -264,7 +264,7 @@ class UpgradeCommandRunner {
...
@@ -264,7 +264,7 @@ class UpgradeCommandRunner {
/// If the fast forward lands us on the same channel and revision, then
/// If the fast forward lands us on the same channel and revision, then
/// returns true, otherwise returns false.
/// returns true, otherwise returns false.
Future
<
bool
>
attemptFastForward
(
FlutterVersion
oldFlutterVersion
)
async
{
Future
<
bool
>
attemptFastForward
(
FlutterVersion
oldFlutterVersion
)
async
{
final
int
code
=
await
globals
.
processUtils
.
stream
(
final
int
code
=
await
processUtils
.
stream
(
<
String
>[
'git'
,
'pull'
,
'--ff'
],
<
String
>[
'git'
,
'pull'
,
'--ff'
],
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
mapFunction:
(
String
line
)
=>
matchesGitLine
(
line
)
?
null
:
line
,
mapFunction:
(
String
line
)
=>
matchesGitLine
(
line
)
?
null
:
line
,
...
@@ -293,7 +293,7 @@ class UpgradeCommandRunner {
...
@@ -293,7 +293,7 @@ class UpgradeCommandRunner {
Future
<
void
>
precacheArtifacts
()
async
{
Future
<
void
>
precacheArtifacts
()
async
{
globals
.
printStatus
(
''
);
globals
.
printStatus
(
''
);
globals
.
printStatus
(
'Upgrading engine...'
);
globals
.
printStatus
(
'Upgrading engine...'
);
final
int
code
=
await
globals
.
processUtils
.
stream
(
final
int
code
=
await
processUtils
.
stream
(
<
String
>[
<
String
>[
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'--no-color'
,
'--no-version-check'
,
'precache'
,
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'--no-color'
,
'--no-version-check'
,
'precache'
,
],
],
...
@@ -321,7 +321,7 @@ class UpgradeCommandRunner {
...
@@ -321,7 +321,7 @@ class UpgradeCommandRunner {
Future
<
void
>
runDoctor
()
async
{
Future
<
void
>
runDoctor
()
async
{
globals
.
printStatus
(
''
);
globals
.
printStatus
(
''
);
globals
.
printStatus
(
'Running flutter doctor...'
);
globals
.
printStatus
(
'Running flutter doctor...'
);
await
globals
.
processUtils
.
stream
(
await
processUtils
.
stream
(
<
String
>[
<
String
>[
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'--no-version-check'
,
'doctor'
,
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'--no-version-check'
,
'doctor'
,
],
],
...
...
packages/flutter_tools/lib/src/commands/version.dart
View file @
ba57ea09
...
@@ -44,7 +44,7 @@ class VersionCommand extends FlutterCommand {
...
@@ -44,7 +44,7 @@ class VersionCommand extends FlutterCommand {
globals
.
flutterVersion
.
fetchTagsAndUpdate
();
globals
.
flutterVersion
.
fetchTagsAndUpdate
();
RunResult
runResult
;
RunResult
runResult
;
try
{
try
{
runResult
=
await
globals
.
processUtils
.
run
(
runResult
=
await
processUtils
.
run
(
<
String
>[
'git'
,
'tag'
,
'-l'
,
'v*'
,
'--sort=-creatordate'
],
<
String
>[
'git'
,
'tag'
,
'-l'
,
'v*'
,
'--sort=-creatordate'
],
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
...
@@ -112,7 +112,7 @@ class VersionCommand extends FlutterCommand {
...
@@ -112,7 +112,7 @@ class VersionCommand extends FlutterCommand {
}
}
try
{
try
{
await
globals
.
processUtils
.
run
(
await
processUtils
.
run
(
<
String
>[
'git'
,
'checkout'
,
'v
$version
'
],
<
String
>[
'git'
,
'checkout'
,
'v
$version
'
],
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
Cache
.
flutterRoot
,
workingDirectory:
Cache
.
flutterRoot
,
...
@@ -131,7 +131,7 @@ class VersionCommand extends FlutterCommand {
...
@@ -131,7 +131,7 @@ class VersionCommand extends FlutterCommand {
// if necessary.
// if necessary.
globals
.
printStatus
(
''
);
globals
.
printStatus
(
''
);
globals
.
printStatus
(
'Downloading engine...'
);
globals
.
printStatus
(
'Downloading engine...'
);
int
code
=
await
globals
.
processUtils
.
stream
(<
String
>[
int
code
=
await
processUtils
.
stream
(<
String
>[
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'--no-color'
,
'--no-color'
,
'precache'
,
'precache'
,
...
@@ -158,7 +158,7 @@ class VersionCommand extends FlutterCommand {
...
@@ -158,7 +158,7 @@ class VersionCommand extends FlutterCommand {
// Run a doctor check in case system requirements have changed.
// Run a doctor check in case system requirements have changed.
globals
.
printStatus
(
''
);
globals
.
printStatus
(
''
);
globals
.
printStatus
(
'Running flutter doctor...'
);
globals
.
printStatus
(
'Running flutter doctor...'
);
code
=
await
globals
.
processUtils
.
stream
(
code
=
await
processUtils
.
stream
(
<
String
>[
<
String
>[
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
globals
.
fs
.
path
.
join
(
'bin'
,
'flutter'
),
'doctor'
,
'doctor'
,
...
...
packages/flutter_tools/lib/src/dart/pub.dart
View file @
ba57ea09
...
@@ -11,6 +11,7 @@ import '../base/context.dart';
...
@@ -11,6 +11,7 @@ import '../base/context.dart';
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
as
io
;
import
'../base/io.dart'
as
io
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
import
'../reporting/reporting.dart'
;
import
'../reporting/reporting.dart'
;
...
@@ -254,7 +255,7 @@ class _DefaultPub implements Pub {
...
@@ -254,7 +255,7 @@ class _DefaultPub implements Pub {
int
code
;
int
code
;
loop:
while
(
true
)
{
loop:
while
(
true
)
{
attempts
+=
1
;
attempts
+=
1
;
code
=
await
globals
.
processUtils
.
stream
(
code
=
await
processUtils
.
stream
(
_pubCommand
(
arguments
),
_pubCommand
(
arguments
),
workingDirectory:
directory
,
workingDirectory:
directory
,
mapFunction:
filterWrapper
,
// may set versionSolvingFailed, lastPubMessage
mapFunction:
filterWrapper
,
// may set versionSolvingFailed, lastPubMessage
...
@@ -300,7 +301,7 @@ class _DefaultPub implements Pub {
...
@@ -300,7 +301,7 @@ class _DefaultPub implements Pub {
String
directory
,
String
directory
,
})
async
{
})
async
{
Cache
.
releaseLockEarly
();
Cache
.
releaseLockEarly
();
final
io
.
Process
process
=
await
globals
.
processUtils
.
start
(
final
io
.
Process
process
=
await
processUtils
.
start
(
_pubCommand
(
arguments
),
_pubCommand
(
arguments
),
workingDirectory:
directory
,
workingDirectory:
directory
,
environment:
await
_createPubEnvironment
(
PubContext
.
interactive
),
environment:
await
_createPubEnvironment
(
PubContext
.
interactive
),
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
ba57ea09
...
@@ -13,6 +13,7 @@ import 'base/async_guard.dart';
...
@@ -13,6 +13,7 @@ import 'base/async_guard.dart';
import
'base/context.dart'
;
import
'base/context.dart'
;
import
'base/file_system.dart'
;
import
'base/file_system.dart'
;
import
'base/logger.dart'
;
import
'base/logger.dart'
;
import
'base/process.dart'
;
import
'base/terminal.dart'
;
import
'base/terminal.dart'
;
import
'base/user_messages.dart'
;
import
'base/user_messages.dart'
;
import
'base/utils.dart'
;
import
'base/utils.dart'
;
...
@@ -666,7 +667,7 @@ class FlutterValidator extends DoctorValidator {
...
@@ -666,7 +667,7 @@ class FlutterValidator extends DoctorValidator {
bool
_genSnapshotRuns
(
String
genSnapshotPath
)
{
bool
_genSnapshotRuns
(
String
genSnapshotPath
)
{
const
int
kExpectedExitCode
=
255
;
const
int
kExpectedExitCode
=
255
;
try
{
try
{
return
globals
.
processUtils
.
runSync
(<
String
>[
genSnapshotPath
]).
exitCode
==
kExpectedExitCode
;
return
processUtils
.
runSync
(<
String
>[
genSnapshotPath
]).
exitCode
==
kExpectedExitCode
;
}
on
Exception
{
}
on
Exception
{
return
false
;
return
false
;
}
}
...
...
packages/flutter_tools/lib/src/emulator.dart
View file @
ba57ea09
...
@@ -120,7 +120,7 @@ class EmulatorManager {
...
@@ -120,7 +120,7 @@ class EmulatorManager {
'-k'
,
sdkId
,
'-k'
,
sdkId
,
'-d'
,
device
,
'-d'
,
device
,
];
];
final
RunResult
runResult
=
globals
.
processUtils
.
runSync
(
args
,
final
RunResult
runResult
=
processUtils
.
runSync
(
args
,
environment:
androidSdk
?.
sdkManagerEnv
);
environment:
androidSdk
?.
sdkManagerEnv
);
return
CreateEmulatorResult
(
return
CreateEmulatorResult
(
name
,
name
,
...
@@ -141,7 +141,7 @@ class EmulatorManager {
...
@@ -141,7 +141,7 @@ class EmulatorManager {
'device'
,
'device'
,
'-c'
,
'-c'
,
];
];
final
RunResult
runResult
=
globals
.
processUtils
.
runSync
(
args
,
final
RunResult
runResult
=
processUtils
.
runSync
(
args
,
environment:
androidSdk
?.
sdkManagerEnv
);
environment:
androidSdk
?.
sdkManagerEnv
);
if
(
runResult
.
exitCode
!=
0
)
{
if
(
runResult
.
exitCode
!=
0
)
{
return
null
;
return
null
;
...
@@ -168,7 +168,7 @@ class EmulatorManager {
...
@@ -168,7 +168,7 @@ class EmulatorManager {
'avd'
,
'avd'
,
'-n'
,
'temp'
,
'-n'
,
'temp'
,
];
];
final
RunResult
runResult
=
globals
.
processUtils
.
runSync
(
args
,
final
RunResult
runResult
=
processUtils
.
runSync
(
args
,
environment:
androidSdk
?.
sdkManagerEnv
);
environment:
androidSdk
?.
sdkManagerEnv
);
// Get the list of IDs that match our criteria
// Get the list of IDs that match our criteria
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart
View file @
ba57ea09
...
@@ -12,6 +12,7 @@ import '../base/common.dart';
...
@@ -12,6 +12,7 @@ import '../base/common.dart';
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../base/utils.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../bundle.dart'
;
import
'../bundle.dart'
;
...
@@ -107,7 +108,7 @@ Future<void> _genSnapshot(
...
@@ -107,7 +108,7 @@ Future<void> _genSnapshot(
timeout:
null
,
timeout:
null
,
);
);
try
{
try
{
result
=
await
globals
.
processUtils
.
stream
(
command
,
trace:
true
);
result
=
await
processUtils
.
stream
(
command
,
trace:
true
);
}
finally
{
}
finally
{
status
.
cancel
();
status
.
cancel
();
}
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
ba57ea09
...
@@ -575,7 +575,7 @@ class FuchsiaDevice extends Device {
...
@@ -575,7 +575,7 @@ class FuchsiaDevice extends Device {
throwToolExit
(
'Cannot interact with device. No ssh config.
\n
'
throwToolExit
(
'Cannot interact with device. No ssh config.
\n
'
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'
);
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'
);
}
}
return
await
globals
.
processUtils
.
run
(<
String
>[
return
await
processUtils
.
run
(<
String
>[
'ssh'
,
'ssh'
,
'-F'
,
'-F'
,
globals
.
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
globals
.
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
...
@@ -590,7 +590,7 @@ class FuchsiaDevice extends Device {
...
@@ -590,7 +590,7 @@ class FuchsiaDevice extends Device {
throwToolExit
(
'Cannot interact with device. No ssh config.
\n
'
throwToolExit
(
'Cannot interact with device. No ssh config.
\n
'
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'
);
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'
);
}
}
return
await
globals
.
processUtils
.
run
(<
String
>[
return
await
processUtils
.
run
(<
String
>[
'scp'
,
'scp'
,
'-F'
,
'-F'
,
globals
.
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
globals
.
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_kernel_compiler.dart
View file @
ba57ea09
...
@@ -7,6 +7,7 @@ import 'package:meta/meta.dart';
...
@@ -7,6 +7,7 @@ import 'package:meta/meta.dart';
import
'../artifacts.dart'
;
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
import
'../project.dart'
;
import
'../project.dart'
;
...
@@ -94,7 +95,7 @@ class FuchsiaKernelCompiler {
...
@@ -94,7 +95,7 @@ class FuchsiaKernelCompiler {
);
);
int
result
;
int
result
;
try
{
try
{
result
=
await
globals
.
processUtils
.
stream
(
command
,
trace:
true
);
result
=
await
processUtils
.
stream
(
command
,
trace:
true
);
}
finally
{
}
finally
{
status
.
cancel
();
status
.
cancel
();
}
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
View file @
ba57ea09
...
@@ -121,7 +121,7 @@ class FuchsiaPM {
...
@@ -121,7 +121,7 @@ class FuchsiaPM {
'-l'
,
'-l'
,
'
$host
:
$port
'
,
'
$host
:
$port
'
,
];
];
final
Process
process
=
await
globals
.
processUtils
.
start
(
command
);
final
Process
process
=
await
processUtils
.
start
(
command
);
process
.
stdout
process
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
transform
(
const
LineSplitter
())
...
@@ -155,7 +155,7 @@ class FuchsiaPM {
...
@@ -155,7 +155,7 @@ class FuchsiaPM {
throwToolExit
(
'Fuchsia pm tool not found'
);
throwToolExit
(
'Fuchsia pm tool not found'
);
}
}
final
List
<
String
>
command
=
<
String
>[
globals
.
fuchsiaArtifacts
.
pm
.
path
,
...
args
];
final
List
<
String
>
command
=
<
String
>[
globals
.
fuchsiaArtifacts
.
pm
.
path
,
...
args
];
final
RunResult
result
=
await
globals
.
processUtils
.
run
(
command
);
final
RunResult
result
=
await
processUtils
.
run
(
command
);
return
result
.
exitCode
==
0
;
return
result
.
exitCode
==
0
;
}
}
}
}
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
ba57ea09
...
@@ -17,7 +17,6 @@ import 'base/io.dart';
...
@@ -17,7 +17,6 @@ import 'base/io.dart';
import
'base/logger.dart'
;
import
'base/logger.dart'
;
import
'base/net.dart'
;
import
'base/net.dart'
;
import
'base/os.dart'
;
import
'base/os.dart'
;
import
'base/process.dart'
;
import
'base/template.dart'
;
import
'base/template.dart'
;
import
'base/terminal.dart'
;
import
'base/terminal.dart'
;
import
'base/user_messages.dart'
;
import
'base/user_messages.dart'
;
...
@@ -65,7 +64,6 @@ const ProcessManager _kLocalProcessManager = LocalProcessManager();
...
@@ -65,7 +64,6 @@ const ProcessManager _kLocalProcessManager = LocalProcessManager();
/// The active process manager.
/// The active process manager.
ProcessManager
get
processManager
=>
context
.
get
<
ProcessManager
>()
??
_kLocalProcessManager
;
ProcessManager
get
processManager
=>
context
.
get
<
ProcessManager
>()
??
_kLocalProcessManager
;
ProcessUtils
get
processUtils
=>
context
.
get
<
ProcessUtils
>();
const
Platform
_kLocalPlatform
=
LocalPlatform
();
const
Platform
_kLocalPlatform
=
LocalPlatform
();
...
...
packages/flutter_tools/lib/src/ios/ios_emulators.dart
View file @
ba57ea09
...
@@ -46,7 +46,7 @@ class IOSEmulator extends Emulator {
...
@@ -46,7 +46,7 @@ class IOSEmulator extends Emulator {
globals
.
xcode
.
getSimulatorPath
(),
globals
.
xcode
.
getSimulatorPath
(),
];
];
final
RunResult
launchResult
=
await
globals
.
processUtils
.
run
(
args
);
final
RunResult
launchResult
=
await
processUtils
.
run
(
args
);
if
(
launchResult
.
exitCode
!=
0
)
{
if
(
launchResult
.
exitCode
!=
0
)
{
globals
.
printError
(
'
$launchResult
'
);
globals
.
printError
(
'
$launchResult
'
);
return
false
;
return
false
;
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
ba57ea09
...
@@ -329,7 +329,7 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -329,7 +329,7 @@ Future<XcodeBuildResult> buildXcodeProject({
const
Duration
showBuildSettingsTimeout
=
Duration
(
minutes:
1
);
const
Duration
showBuildSettingsTimeout
=
Duration
(
minutes:
1
);
Map
<
String
,
String
>
buildSettings
;
Map
<
String
,
String
>
buildSettings
;
try
{
try
{
final
RunResult
showBuildSettingsResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
showBuildSettingsResult
=
await
processUtils
.
run
(
showBuildSettingsCommand
,
showBuildSettingsCommand
,
throwOnError:
true
,
throwOnError:
true
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
...
@@ -413,7 +413,7 @@ Future<RunResult> _runBuildWithRetries(List<String> buildCommands, BuildableIOSA
...
@@ -413,7 +413,7 @@ Future<RunResult> _runBuildWithRetries(List<String> buildCommands, BuildableIOSA
remainingTries
--;
remainingTries
--;
buildRetryDelaySeconds
*=
2
;
buildRetryDelaySeconds
*=
2
;
buildResult
=
await
globals
.
processUtils
.
run
(
buildResult
=
await
processUtils
.
run
(
buildCommands
,
buildCommands
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
allowReentrantFlutter:
true
,
allowReentrantFlutter:
true
,
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
ba57ea09
...
@@ -579,12 +579,12 @@ class IOSSimulator extends Device {
...
@@ -579,12 +579,12 @@ class IOSSimulator extends Device {
Future
<
Process
>
launchDeviceLogTool
(
IOSSimulator
device
)
async
{
Future
<
Process
>
launchDeviceLogTool
(
IOSSimulator
device
)
async
{
// Versions of iOS prior to iOS 11 log to the simulator syslog file.
// Versions of iOS prior to iOS 11 log to the simulator syslog file.
if
(
await
device
.
sdkMajorVersion
<
11
)
{
if
(
await
device
.
sdkMajorVersion
<
11
)
{
return
globals
.
processUtils
.
start
(<
String
>[
'tail'
,
'-n'
,
'0'
,
'-F'
,
device
.
logFilePath
]);
return
processUtils
.
start
(<
String
>[
'tail'
,
'-n'
,
'0'
,
'-F'
,
device
.
logFilePath
]);
}
}
// For iOS 11 and above, use /usr/bin/log to tail process logs.
// For iOS 11 and above, use /usr/bin/log to tail process logs.
// Run in interactive mode (via script), otherwise /usr/bin/log buffers in 4k chunks. (radar: 34420207)
// Run in interactive mode (via script), otherwise /usr/bin/log buffers in 4k chunks. (radar: 34420207)
return
globals
.
processUtils
.
start
(<
String
>[
return
processUtils
.
start
(<
String
>[
'script'
,
'/dev/null'
,
'/usr/bin/log'
,
'stream'
,
'--style'
,
'syslog'
,
'--predicate'
,
'processImagePath CONTAINS "
${device.id}
"'
,
'script'
,
'/dev/null'
,
'/usr/bin/log'
,
'stream'
,
'--style'
,
'syslog'
,
'--predicate'
,
'processImagePath CONTAINS "
${device.id}
"'
,
]);
]);
}
}
...
@@ -592,7 +592,7 @@ Future<Process> launchDeviceLogTool(IOSSimulator device) async {
...
@@ -592,7 +592,7 @@ Future<Process> launchDeviceLogTool(IOSSimulator device) async {
Future
<
Process
>
launchSystemLogTool
(
IOSSimulator
device
)
async
{
Future
<
Process
>
launchSystemLogTool
(
IOSSimulator
device
)
async
{
// Versions of iOS prior to 11 tail the simulator syslog file.
// Versions of iOS prior to 11 tail the simulator syslog file.
if
(
await
device
.
sdkMajorVersion
<
11
)
{
if
(
await
device
.
sdkMajorVersion
<
11
)
{
return
globals
.
processUtils
.
start
(<
String
>[
'tail'
,
'-n'
,
'0'
,
'-F'
,
'/private/var/log/system.log'
]);
return
processUtils
.
start
(<
String
>[
'tail'
,
'-n'
,
'0'
,
'-F'
,
'/private/var/log/system.log'
]);
}
}
// For iOS 11 and later, all relevant detail is in the device log.
// For iOS 11 and later, all relevant detail is in the device log.
...
...
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
ba57ea09
...
@@ -6,6 +6,7 @@ import '../artifacts.dart';
...
@@ -6,6 +6,7 @@ import '../artifacts.dart';
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
...
@@ -72,7 +73,7 @@ export PROJECT_DIR=${linuxProject.project.directory.path}
...
@@ -72,7 +73,7 @@ export PROJECT_DIR=${linuxProject.project.directory.path}
);
);
int
result
;
int
result
;
try
{
try
{
result
=
await
globals
.
processUtils
.
stream
(<
String
>[
result
=
await
processUtils
.
stream
(<
String
>[
'make'
,
'make'
,
'-C'
,
'-C'
,
linuxProject
.
makeFile
.
parent
.
path
,
linuxProject
.
makeFile
.
parent
.
path
,
...
...
packages/flutter_tools/lib/src/macos/build_macos.dart
View file @
ba57ea09
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
import
'../ios/xcodeproj.dart'
;
import
'../ios/xcodeproj.dart'
;
...
@@ -72,7 +73,7 @@ Future<void> buildMacOS({
...
@@ -72,7 +73,7 @@ Future<void> buildMacOS({
);
);
int
result
;
int
result
;
try
{
try
{
result
=
await
globals
.
processUtils
.
stream
(<
String
>[
result
=
await
processUtils
.
stream
(<
String
>[
'/usr/bin/env'
,
'/usr/bin/env'
,
'xcrun'
,
'xcrun'
,
'xcodebuild'
,
'xcodebuild'
,
...
...
packages/flutter_tools/lib/src/test/coverage_collector.dart
View file @
ba57ea09
...
@@ -161,7 +161,7 @@ class CoverageCollector extends TestWatcher {
...
@@ -161,7 +161,7 @@ class CoverageCollector extends TestWatcher {
final
Directory
tempDir
=
globals
.
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_tools_test_coverage.'
);
final
Directory
tempDir
=
globals
.
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_tools_test_coverage.'
);
try
{
try
{
final
File
sourceFile
=
coverageFile
.
copySync
(
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'lcov.source.info'
));
final
File
sourceFile
=
coverageFile
.
copySync
(
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'lcov.source.info'
));
final
RunResult
result
=
globals
.
processUtils
.
runSync
(<
String
>[
final
RunResult
result
=
processUtils
.
runSync
(<
String
>[
'lcov'
,
'lcov'
,
'--add-tracefile'
,
baseCoverageData
,
'--add-tracefile'
,
baseCoverageData
,
'--add-tracefile'
,
sourceFile
.
path
,
'--add-tracefile'
,
sourceFile
.
path
,
...
...
packages/flutter_tools/lib/src/version.dart
View file @
ba57ea09
...
@@ -53,10 +53,10 @@ class FlutterVersion {
...
@@ -53,10 +53,10 @@ class FlutterVersion {
FlutterVersion
([
this
.
_clock
=
const
SystemClock
(),
this
.
_workingDirectory
])
{
FlutterVersion
([
this
.
_clock
=
const
SystemClock
(),
this
.
_workingDirectory
])
{
_frameworkRevision
=
_runGit
(
_frameworkRevision
=
_runGit
(
gitLog
(<
String
>[
'-n'
,
'1'
,
'--pretty=format:%H'
]).
join
(
' '
),
gitLog
(<
String
>[
'-n'
,
'1'
,
'--pretty=format:%H'
]).
join
(
' '
),
globals
.
processUtils
,
processUtils
,
_workingDirectory
,
_workingDirectory
,
);
);
_gitTagVersion
=
GitTagVersion
.
determine
(
globals
.
processUtils
,
workingDirectory:
_workingDirectory
,
fetchTags:
false
);
_gitTagVersion
=
GitTagVersion
.
determine
(
processUtils
,
workingDirectory:
_workingDirectory
,
fetchTags:
false
);
_frameworkVersion
=
gitTagVersion
.
frameworkVersionFor
(
_frameworkRevision
);
_frameworkVersion
=
gitTagVersion
.
frameworkVersionFor
(
_frameworkRevision
);
}
}
...
@@ -67,7 +67,7 @@ class FlutterVersion {
...
@@ -67,7 +67,7 @@ class FlutterVersion {
/// user explicitly wants to get the version, e.g. for `flutter --version` or
/// user explicitly wants to get the version, e.g. for `flutter --version` or
/// `flutter doctor`.
/// `flutter doctor`.
void
fetchTagsAndUpdate
()
{
void
fetchTagsAndUpdate
()
{
_gitTagVersion
=
GitTagVersion
.
determine
(
globals
.
processUtils
,
workingDirectory:
_workingDirectory
,
fetchTags:
true
);
_gitTagVersion
=
GitTagVersion
.
determine
(
processUtils
,
workingDirectory:
_workingDirectory
,
fetchTags:
true
);
_frameworkVersion
=
gitTagVersion
.
frameworkVersionFor
(
_frameworkRevision
);
_frameworkVersion
=
gitTagVersion
.
frameworkVersionFor
(
_frameworkRevision
);
}
}
...
@@ -112,7 +112,7 @@ class FlutterVersion {
...
@@ -112,7 +112,7 @@ class FlutterVersion {
if
(
_channel
==
null
)
{
if
(
_channel
==
null
)
{
final
String
channel
=
_runGit
(
final
String
channel
=
_runGit
(
'git rev-parse --abbrev-ref --symbolic @{u}'
,
'git rev-parse --abbrev-ref --symbolic @{u}'
,
globals
.
processUtils
,
processUtils
,
_workingDirectory
,
_workingDirectory
,
);
);
final
int
slash
=
channel
.
indexOf
(
'/'
);
final
int
slash
=
channel
.
indexOf
(
'/'
);
...
@@ -120,7 +120,7 @@ class FlutterVersion {
...
@@ -120,7 +120,7 @@ class FlutterVersion {
final
String
remote
=
channel
.
substring
(
0
,
slash
);
final
String
remote
=
channel
.
substring
(
0
,
slash
);
_repositoryUrl
=
_runGit
(
_repositoryUrl
=
_runGit
(
'git ls-remote --get-url
$remote
'
,
'git ls-remote --get-url
$remote
'
,
globals
.
processUtils
,
processUtils
,
_workingDirectory
,
_workingDirectory
,
);
);
_channel
=
channel
.
substring
(
slash
+
1
);
_channel
=
channel
.
substring
(
slash
+
1
);
...
@@ -148,7 +148,7 @@ class FlutterVersion {
...
@@ -148,7 +148,7 @@ class FlutterVersion {
String
get
frameworkAge
{
String
get
frameworkAge
{
return
_frameworkAge
??=
_runGit
(
return
_frameworkAge
??=
_runGit
(
gitLog
(<
String
>[
'-n'
,
'1'
,
'--pretty=format:%ar'
]).
join
(
' '
),
gitLog
(<
String
>[
'-n'
,
'1'
,
'--pretty=format:%ar'
]).
join
(
' '
),
globals
.
processUtils
,
processUtils
,
_workingDirectory
,
_workingDirectory
,
);
);
}
}
...
@@ -288,7 +288,7 @@ class FlutterVersion {
...
@@ -288,7 +288,7 @@ class FlutterVersion {
/// the branch name will be returned as `'[user-branch]'`.
/// the branch name will be returned as `'[user-branch]'`.
String
getBranchName
({
bool
redactUnknownBranches
=
false
})
{
String
getBranchName
({
bool
redactUnknownBranches
=
false
})
{
_branch
??=
()
{
_branch
??=
()
{
final
String
branch
=
_runGit
(
'git rev-parse --abbrev-ref HEAD'
,
globals
.
processUtils
);
final
String
branch
=
_runGit
(
'git rev-parse --abbrev-ref HEAD'
,
processUtils
);
return
branch
==
'HEAD'
?
channel
:
branch
;
return
branch
==
'HEAD'
?
channel
:
branch
;
}();
}();
if
(
redactUnknownBranches
||
_branch
.
isEmpty
)
{
if
(
redactUnknownBranches
||
_branch
.
isEmpty
)
{
...
...
packages/flutter_tools/lib/src/windows/build_windows.dart
View file @
ba57ea09
...
@@ -6,6 +6,7 @@ import '../artifacts.dart';
...
@@ -6,6 +6,7 @@ import '../artifacts.dart';
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
...
@@ -85,7 +86,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
...
@@ -85,7 +86,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
// Run the script with a relative path to the project using the enclosing
// Run the script with a relative path to the project using the enclosing
// directory as the workingDirectory, to avoid hitting the limit on command
// directory as the workingDirectory, to avoid hitting the limit on command
// lengths in batch scripts if the absolute path to the project is long.
// lengths in batch scripts if the absolute path to the project is long.
result
=
await
globals
.
processUtils
.
stream
(<
String
>[
result
=
await
processUtils
.
stream
(<
String
>[
buildScript
,
buildScript
,
vcvarsScript
,
vcvarsScript
,
globals
.
fs
.
path
.
basename
(
solutionPath
),
globals
.
fs
.
path
.
basename
(
solutionPath
),
...
...
packages/flutter_tools/lib/src/windows/windows_device.dart
View file @
ba57ea09
...
@@ -87,7 +87,7 @@ final RegExp _whitespace = RegExp(r'\s+');
...
@@ -87,7 +87,7 @@ final RegExp _whitespace = RegExp(r'\s+');
@visibleForTesting
@visibleForTesting
List
<
String
>
runningProcess
(
String
processName
)
{
List
<
String
>
runningProcess
(
String
processName
)
{
// TODO(jonahwilliams): find a way to do this without powershell.
// TODO(jonahwilliams): find a way to do this without powershell.
final
RunResult
result
=
globals
.
processUtils
.
runSync
(
final
RunResult
result
=
processUtils
.
runSync
(
<
String
>[
'powershell'
,
'-script="Get-CimInstance Win32_Process"'
],
<
String
>[
'powershell'
,
'-script="Get-CimInstance Win32_Process"'
],
);
);
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
...
...
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