Skip to content

Commit 87ed9fa

Browse files
Merge branch 'master' into master
2 parents 6c81812 + c169a17 commit 87ed9fa

File tree

57 files changed

+417
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+417
-395
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vars = {
1414
'flutter_git': 'https://flutter.googlesource.com',
1515
'skia_git': 'https://skia.googlesource.com',
1616
'llvm_git': 'https://llvm.googlesource.com',
17-
'skia_revision': '177a2929e32f19a217aa724a4035b11bd21f3a89',
17+
'skia_revision': 'c91ea1a8fd3fdd0018e89875557ded9ac14620c1',
1818

1919
# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
2020
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
@@ -813,7 +813,7 @@ deps = {
813813
'packages': [
814814
{
815815
'package': 'fuchsia/sdk/core/linux-amd64',
816-
'version': 'MwYckh5OvwwmIYLx0Z34IxTKnqGMEmITvYbeFqrdU4IC'
816+
'version': 'nggV-vSVM14nIXPsZBFj_hPpzMnA3MgxNK9YksOJUv8C'
817817
}
818818
],
819819
'condition': 'download_fuchsia_deps and not download_fuchsia_sdk',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2fcc4032dd8b1a3da0b4424d49341bedd86d5137
1+
ac21f531a0cce74c889fd4b5ffe0d585141ffe83

dev/bots/analyze.dart

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ Future<void> run(List<String> arguments) async {
167167
printProgress('Lint Kotlin files...');
168168
await lintKotlinFiles(flutterRoot);
169169

170+
printProgress('Lint generated Kotlin files from templates...');
171+
await lintKotlinTemplatedFiles(flutterRoot);
172+
170173
// Ensure that all package dependencies are in sync.
171174
printProgress('Package dependencies...');
172175
await runCommand(flutter, <String>[
@@ -2460,6 +2463,66 @@ Future<void> verifyTabooDocumentation(String workingDirectory, {int minimumMatch
24602463
}
24612464
}
24622465

2466+
final Map<String, String> _kKotlinTemplateKeys = <String, String>{
2467+
'androidIdentifier': 'dummyPackage',
2468+
'pluginClass': 'PluginClass',
2469+
'projectName': 'dummy',
2470+
'agpVersion': '0.0.0.1',
2471+
'kotlinVersion': '0.0.0.1',
2472+
};
2473+
2474+
final String _kKotlinTemplateRelativePath = path.join('packages', 'flutter_tools', 'templates');
2475+
2476+
const List<String> _kKotlinExtList = <String>['.kt.tmpl', '.kts.tmpl'];
2477+
const String _kKotlinTmplExt = '.tmpl';
2478+
final RegExp _kKotlinTemplatePattern = RegExp(r'{{(.*?)}}');
2479+
2480+
/// Copy kotlin template files from [_kKotlinTemplateRelativePath] into a system tmp folder
2481+
/// then replace template values with values from [_kKotlinTemplateKeys] or "'dummy'" if an
2482+
/// unknown key is found. Then run ktlint on the tmp folder to check for lint errors in the
2483+
/// generated Kotlin files.
2484+
Future<void> lintKotlinTemplatedFiles(String workingDirectory) async {
2485+
final String templatePath = path.join(workingDirectory, _kKotlinTemplateRelativePath);
2486+
final Iterable<File> files = Directory(templatePath)
2487+
.listSync(recursive: true)
2488+
.toList()
2489+
.whereType<File>()
2490+
.where((File file) => _kKotlinExtList.contains(path.extension(file.path, 2)));
2491+
2492+
if (files.isEmpty) {
2493+
foundError(<String>['No Kotlin template files found']);
2494+
return;
2495+
}
2496+
2497+
final Directory tempDir = Directory.systemTemp.createTempSync('template_output');
2498+
for (final File templateFile in files) {
2499+
final String inputContent = await templateFile.readAsString();
2500+
final String modifiedContent = inputContent.replaceAllMapped(
2501+
_kKotlinTemplatePattern,
2502+
(Match match) => _kKotlinTemplateKeys[match[1]] ?? 'dummy',
2503+
);
2504+
2505+
String outputFilename = path.basename(templateFile.path);
2506+
outputFilename = outputFilename.substring(
2507+
0,
2508+
outputFilename.length - _kKotlinTmplExt.length,
2509+
); // Remove '.tmpl' from file path
2510+
2511+
// Ensure the first letter of the generated class is uppercase (instead of pluginClass)
2512+
outputFilename = outputFilename.substring(0, 1).toUpperCase() + outputFilename.substring(1);
2513+
2514+
final String relativePath = path.dirname(path.relative(templateFile.path, from: templatePath));
2515+
final String outputDir = path.join(tempDir.path, relativePath);
2516+
await Directory(outputDir).create(recursive: true);
2517+
final String outputFile = path.join(outputDir, outputFilename);
2518+
final File output = File(outputFile);
2519+
await output.writeAsString(modifiedContent);
2520+
}
2521+
return lintKotlinFiles(tempDir.path).whenComplete(() {
2522+
tempDir.deleteSync(recursive: true);
2523+
});
2524+
}
2525+
24632526
Future<void> lintKotlinFiles(String workingDirectory) async {
24642527
const String baselineRelativePath = 'dev/bots/test/analyze-test-input/ktlint-baseline.xml';
24652528
const String editorConfigRelativePath = 'dev/bots/test/analyze-test-input/.editorconfig';

engine/src/flutter/.ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ targets:
524524
- os=Windows
525525

526526
- name: Windows windows_host_engine_test
527-
bringup: true # Flaky https://github.com/flutter/flutter/issues/167418
528527
recipe: engine_v2/engine_v2
529528
timeout: 120
530529
properties:

engine/src/flutter/ci/licenses_golden/excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3767,7 +3767,6 @@
37673767
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power.sensor/meta.json
37683768
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power.statecontrol/meta.json
37693769
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.power/meta.json
3770-
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.powerlevel/meta.json
37713770
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.qualcomm.router/meta.json
37723771
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.radar/meta.json
37733772
../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.registers/meta.json

engine/src/flutter/ci/licenses_golden/licenses_fuchsia

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 3a1356a40da2aff62932d5d38cd51477
1+
Signature: 757640b101637c7e3d87e0fa27395c0b
22

33
====================================================================================================
44
LIBRARY: fuchsia_sdk
@@ -13142,7 +13142,6 @@ LIBRARY: fuchsia_sdk
1314213142
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.boot.metadata/metadata.fidl + ../../../fuchsia/sdk/linux/LICENSE
1314313143
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics.types/interest.fidl + ../../../fuchsia/sdk/linux/LICENSE
1314413144
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.gnss/gnss_device.fidl + ../../../fuchsia/sdk/linux/LICENSE
13145-
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.powerlevel/powerlevel.fidl + ../../../fuchsia/sdk/linux/LICENSE
1314613145
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.qualcomm.router/qrtr.fidl + ../../../fuchsia/sdk/linux/LICENSE
1314713146
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/tracing-resource.fidl + ../../../fuchsia/sdk/linux/LICENSE
1314813147
ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.location.gnss.types/gnss_types.fidl + ../../../fuchsia/sdk/linux/LICENSE
@@ -13153,13 +13152,13 @@ ORIGIN: ../../../fuchsia/sdk/linux/pkg/component_incoming_cpp/include/lib/compon
1315313152
ORIGIN: ../../../fuchsia/sdk/linux/pkg/component_incoming_cpp/include/lib/component/incoming/cpp/service_member_watcher.h + ../../../fuchsia/sdk/linux/LICENSE
1315413153
ORIGIN: ../../../fuchsia/sdk/linux/pkg/driver_fake_gpio_cpp/fake-gpio.cc + ../../../fuchsia/sdk/linux/LICENSE
1315513154
ORIGIN: ../../../fuchsia/sdk/linux/pkg/driver_fake_gpio_cpp/include/lib/driver/fake-gpio/cpp/fake-gpio.h + ../../../fuchsia/sdk/linux/LICENSE
13155+
ORIGIN: ../../../fuchsia/sdk/linux/pkg/driver_logging_cpp/include/lib/driver/logging/cpp/internal/panic.h + ../../../fuchsia/sdk/linux/LICENSE
1315613156
ORIGIN: ../../../fuchsia/sdk/linux/pkg/zx/counter.cc + ../../../fuchsia/sdk/linux/LICENSE
1315713157
ORIGIN: ../../../fuchsia/sdk/linux/pkg/zx/include/lib/zx/counter.h + ../../../fuchsia/sdk/linux/LICENSE
1315813158
TYPE: LicenseType.bsd
1315913159
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.boot.metadata/metadata.fidl
1316013160
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics.types/interest.fidl
1316113161
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.gnss/gnss_device.fidl
13162-
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.powerlevel/powerlevel.fidl
1316313162
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.hardware.qualcomm.router/qrtr.fidl
1316413163
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/tracing-resource.fidl
1316513164
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.location.gnss.types/gnss_types.fidl
@@ -13170,6 +13169,7 @@ FILE: ../../../fuchsia/sdk/linux/pkg/component_incoming_cpp/include/lib/componen
1317013169
FILE: ../../../fuchsia/sdk/linux/pkg/component_incoming_cpp/include/lib/component/incoming/cpp/service_member_watcher.h
1317113170
FILE: ../../../fuchsia/sdk/linux/pkg/driver_fake_gpio_cpp/fake-gpio.cc
1317213171
FILE: ../../../fuchsia/sdk/linux/pkg/driver_fake_gpio_cpp/include/lib/driver/fake-gpio/cpp/fake-gpio.h
13172+
FILE: ../../../fuchsia/sdk/linux/pkg/driver_logging_cpp/include/lib/driver/logging/cpp/internal/panic.h
1317313173
FILE: ../../../fuchsia/sdk/linux/pkg/zx/counter.cc
1317413174
FILE: ../../../fuchsia/sdk/linux/pkg/zx/include/lib/zx/counter.h
1317513175
----------------------------------------------------------------------------------------------------

engine/src/flutter/ci/licenses_golden/licenses_skia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: d6b2a9d3e2d0e3d4a972a48985cab9db
1+
Signature: 308a1ea3efa14dc11e04fbbd23f4e550
22

33
====================================================================================================
44
LIBRARY: etc1

engine/src/flutter/common/settings.h

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "flutter/fml/build_config.h"
1717
#include "flutter/fml/closure.h"
1818
#include "flutter/fml/mapping.h"
19-
#include "flutter/fml/task_queue_id.h"
2019
#include "flutter/fml/time/time_point.h"
2120
#include "flutter/fml/unique_fd.h"
2221

@@ -71,10 +70,8 @@ class FrameTiming {
7170
};
7271

7372
using TaskObserverAdd =
74-
std::function<fml::TaskQueueId(intptr_t /* key */,
75-
fml::closure /* callback */)>;
76-
using TaskObserverRemove =
77-
std::function<void(fml::TaskQueueId /* queue */, intptr_t /* key */)>;
73+
std::function<void(intptr_t /* key */, fml::closure /* callback */)>;
74+
using TaskObserverRemove = std::function<void(intptr_t /* key */)>;
7875
using UnhandledExceptionCallback =
7976
std::function<bool(const std::string& /* error */,
8077
const std::string& /* stack trace */)>;
@@ -362,20 +359,9 @@ struct Settings {
362359
/// This is used by the runOnPlatformThread API.
363360
bool enable_platform_isolates = false;
364361

365-
enum class MergedPlatformUIThread {
366-
// Use separate threads for the UI and platform task runners.
367-
kDisabled,
368-
// Use the platform thread for both the UI and platform task runners.
369-
kEnabled,
370-
// Start the engine on a separate UI thread and then move the UI task
371-
// runner to the platform thread after the engine is initialized.
372-
// This can improve app launch latency by allowing other work to run on
373-
// the platform thread during engine startup.
374-
kMergeAfterLaunch
375-
};
376-
377-
MergedPlatformUIThread merged_platform_ui_thread =
378-
MergedPlatformUIThread::kEnabled;
362+
// If true, the UI thread is the platform thread on supported
363+
// platforms.
364+
bool merged_platform_ui_thread = true;
379365
};
380366

381367
} // namespace flutter

engine/src/flutter/fml/platform/fuchsia/task_observers.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ void ExecuteAfterTaskObservers() {
1616
}
1717
}
1818

19-
fml::TaskQueueId CurrentMessageLoopAddAfterTaskObserver(intptr_t key,
20-
fit::closure observer) {
19+
void CurrentMessageLoopAddAfterTaskObserver(intptr_t key,
20+
fit::closure observer) {
2121
if (observer) {
2222
tTaskObservers[key] = std::move(observer);
2323
}
24-
return fml::TaskQueueId::Invalid();
2524
}
2625

27-
void CurrentMessageLoopRemoveAfterTaskObserver(fml::TaskQueueId queue_id,
28-
intptr_t key) {
26+
void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) {
2927
tTaskObservers.erase(key);
3028
}
3129

engine/src/flutter/fml/platform/fuchsia/task_observers.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include <lib/fit/function.h>
99

10-
#include "flutter/fml/task_queue_id.h"
11-
1210
namespace fml {
1311

1412
// Executes all closures that were registered via
@@ -32,11 +30,10 @@ namespace fml {
3230
// somehow.
3331
void ExecuteAfterTaskObservers();
3432

35-
fml::TaskQueueId CurrentMessageLoopAddAfterTaskObserver(intptr_t key,
36-
fit::closure observer);
33+
void CurrentMessageLoopAddAfterTaskObserver(intptr_t key,
34+
fit::closure observer);
3735

38-
void CurrentMessageLoopRemoveAfterTaskObserver(fml::TaskQueueId queue_id,
39-
intptr_t key);
36+
void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key);
4037

4138
} // namespace fml
4239

0 commit comments

Comments
 (0)