-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathautoTest.dart
53 lines (42 loc) · 1.11 KB
/
autoTest.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import 'dart:io';
import 'utils.dart' as utils;
const desktopFlags = ["windows", "macos", "linux"];
const mobileFlags = ["ios", "android"];
final deviceMap = {
"windows": "windows",
"linux": "linux",
"mac": "mac",
};
// NOT IN USE
// FAILED HORRIBLY WATSED GOOD AMOUNT OF TIME
main(List<String> args) async {
final String platform = args[0];
const int observatoryPort = 8888;
String targetFile = utils.normalize("./lib/main.mobile.dart");
final tmpEnvFile = File("env.tmp");
tmpEnvFile.writeAsStringSync(platform);
if (desktopFlags.contains(platform)) {
targetFile = utils.normalize("./lib/main.dart");
}
final flutter = await Process.start(
"flutter",
[
"run",
"--observatory-port",
observatoryPort.toString(),
"-t",
targetFile,
"-d",
deviceMap[platform]!,
],
runInShell: Platform.isWindows,
);
print("FLUTTER OUT");
print(flutter.stdout);
print("FLUTTER error");
print(flutter.stderr);
flutter.stdout.listen((event) {
print(event.toString());
});
utils.setEnv("VM_SERVICE_URL", "http://127.0.0.1:$observatoryPort/");
}