mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![auto-submit[bot]](/assets/img/avatar_default.png)
Reverts: flutter/flutter#146931 Initiated by: Hixie Reason for reverting: more failures Original PR Author: Hixie Reviewed By: {reidbaker} This change reverts the following previous change: Fixes #137555. This is an updated version of https://github.com/flutter/flutter/pull/146856, which was reverted in https://github.com/flutter/flutter/pull/146927. The first commit is identical to the original PR, and subsequent commits are the fixes to address failures detected in devicelab post-commit.
54 lines
1.7 KiB
Dart
54 lines
1.7 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:io' show Directory, Process;
|
|
|
|
import 'package:path/path.dart' as path;
|
|
|
|
import '../framework/devices.dart' as adb;
|
|
import '../framework/framework.dart' show TaskFunction;
|
|
import '../framework/task_result.dart' show TaskResult;
|
|
import '../framework/utils.dart' as utils;
|
|
import '../microbenchmarks.dart' as microbenchmarks;
|
|
|
|
TaskFunction runTask(adb.DeviceOperatingSystem operatingSystem) {
|
|
return () async {
|
|
adb.deviceOperatingSystem = operatingSystem;
|
|
final adb.Device device = await adb.devices.workingDevice;
|
|
await device.unlock();
|
|
|
|
final Directory appDir = utils.dir(path.join(utils.flutterDirectory.path,
|
|
'dev/benchmarks/platform_channels_benchmarks'));
|
|
final Process flutterProcess = await utils.inDirectory(appDir, () async {
|
|
final List<String> createArgs = <String>[
|
|
'--platforms',
|
|
'ios,android',
|
|
'--no-overwrite',
|
|
'-v',
|
|
'.',
|
|
];
|
|
print('\nExecuting: flutter create $createArgs $appDir');
|
|
await utils.flutter('create', options: createArgs);
|
|
|
|
final List<String> options = <String>[
|
|
'-v',
|
|
// --release doesn't work on iOS due to code signing issues
|
|
'--profile',
|
|
'--no-publish-port',
|
|
'-d',
|
|
device.deviceId,
|
|
];
|
|
return utils.startFlutter(
|
|
'run',
|
|
options: options,
|
|
);
|
|
});
|
|
|
|
final Map<String, double> results =
|
|
await microbenchmarks.readJsonResults(flutterProcess);
|
|
return TaskResult.success(results,
|
|
benchmarkScoreKeys: results.keys.toList());
|
|
};
|
|
}
|