Update utils.dart to work with the breaking change of SDK issue 40678 (#53093)
This commit is contained in:
@@ -19,11 +19,25 @@ import 'framework.dart';
|
||||
String cwd = Directory.current.path;
|
||||
|
||||
/// The local engine to use for [flutter] and [evalFlutter], if any.
|
||||
String get localEngine => const String.fromEnvironment('localEngine');
|
||||
String get localEngine {
|
||||
// Use two distinct `defaultValue`s to determine whether a 'localEngine'
|
||||
// declaration exists in the environment.
|
||||
const bool isDefined =
|
||||
String.fromEnvironment('localEngine', defaultValue: 'a') ==
|
||||
String.fromEnvironment('localEngine', defaultValue: 'b');
|
||||
return isDefined ? const String.fromEnvironment('localEngine') : null;
|
||||
}
|
||||
|
||||
/// The local engine source path to use if a local engine is used for [flutter]
|
||||
/// and [evalFlutter].
|
||||
String get localEngineSrcPath => const String.fromEnvironment('localEngineSrcPath');
|
||||
String get localEngineSrcPath {
|
||||
// Use two distinct `defaultValue`s to determine whether a
|
||||
// 'localEngineSrcPath' declaration exists in the environment.
|
||||
const bool isDefined =
|
||||
String.fromEnvironment('localEngineSrcPath', defaultValue: 'a') ==
|
||||
String.fromEnvironment('localEngineSrcPath', defaultValue: 'b');
|
||||
return isDefined ? const String.fromEnvironment('localEngineSrcPath') : null;
|
||||
}
|
||||
|
||||
List<ProcessInfo> _runningProcesses = <ProcessInfo>[];
|
||||
ProcessManager _processManager = const LocalProcessManager();
|
||||
|
||||
@@ -33,4 +33,11 @@ void main() {
|
||||
expect(parseServicePort(badOutput), null);
|
||||
});
|
||||
});
|
||||
|
||||
group('engine environment declarations', () {
|
||||
test('localEngine', () {
|
||||
expect(localEngine, null);
|
||||
expect(localEngineSrcPath, null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user