diff --git a/bin/internal/engine.version b/bin/internal/engine.version index 55e3e48..c8dca0a 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -3316dd8728419ad3534e3f6112aa6291f587078a +b24591ed328a2d4ce6505819e2f5898a78132f7f diff --git a/bin/internal/flutter.version b/bin/internal/flutter.version index f393339..45363bc 100644 --- a/bin/internal/flutter.version +++ b/bin/internal/flutter.version @@ -1 +1 @@ -135454af32477f815a7525073027a3ff9eff1bfd +b06b8b2710955028a6b562f5aa6fe62941d6febf diff --git a/lib/commands/attach.dart b/lib/commands/attach.dart index ea84955..a9481a5 100644 --- a/lib/commands/attach.dart +++ b/lib/commands/attach.dart @@ -1,15 +1,23 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import 'package:flutter_tools/src/commands/attach.dart'; import '../elinux_plugins.dart'; class ELinuxAttachCommand extends AttachCommand with ELinuxExtension { - ELinuxAttachCommand({bool verboseHelp = false}) - : super(verboseHelp: verboseHelp); + ELinuxAttachCommand({ + super.verboseHelp, + super.hotRunnerFactory, + required super.artifacts, + required super.stdio, + required super.logger, + required super.terminal, + required super.signals, + required super.platform, + required super.processInfo, + required super.fileSystem, + }); } diff --git a/lib/commands/build.dart b/lib/commands/build.dart index 55390ff..b949ecf 100644 --- a/lib/commands/build.dart +++ b/lib/commands/build.dart @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,7 +22,14 @@ import '../elinux_plugins.dart'; class ELinuxBuildCommand extends BuildCommand { ELinuxBuildCommand({bool verboseHelp = false}) - : super(verboseHelp: verboseHelp) { + : super( + fileSystem: globals.fs, + buildSystem: globals.buildSystem, + osUtils: globals.os, + verboseHelp: verboseHelp, + androidSdk: globals.androidSdk, + logger: globals.logger, + ) { addSubcommand(BuildPackageCommand(verboseHelp: verboseHelp)); } } @@ -31,7 +38,10 @@ class BuildPackageCommand extends BuildSubCommand with ELinuxExtension, ELinuxRequiredArtifacts { /// See: [BuildApkCommand] in `build_apk.dart` BuildPackageCommand({bool verboseHelp = false}) - : super(verboseHelp: verboseHelp) { + : super( + verboseHelp: verboseHelp, + logger: globals.logger, + ) { addCommonDesktopBuildOptions(verboseHelp: verboseHelp); argParser.addOption( 'target-arch', diff --git a/lib/commands/drive.dart b/lib/commands/drive.dart index 661e585..5de8158 100644 --- a/lib/commands/drive.dart +++ b/lib/commands/drive.dart @@ -1,4 +1,4 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,5 +19,6 @@ class ELinuxDriveCommand extends DriveCommand fileSystem: globals.fs, logger: globals.logger, platform: globals.platform, + signals: globals.signals, ); } diff --git a/lib/commands/upgrade.dart b/lib/commands/upgrade.dart index f243d12..d98358f 100644 --- a/lib/commands/upgrade.dart +++ b/lib/commands/upgrade.dart @@ -1,4 +1,4 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // 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. @@ -16,6 +16,7 @@ import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/upgrade.dart'; import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/globals.dart' as globals; +import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; import 'package:meta/meta.dart'; @@ -315,9 +316,9 @@ class ELinuxUpgradeCommandRunner { globals.printStatus(''); await pub.get( context: PubContext.pubUpgrade, - directory: projectRoot, + project: + FlutterProject.fromDirectory(globals.fs.directory(projectRoot)), upgrade: true, - generateSyntheticPackage: false, ); } } diff --git a/lib/elinux_artifacts.dart b/lib/elinux_artifacts.dart index 936141a..0aa7cc6 100644 --- a/lib/elinux_artifacts.dart +++ b/lib/elinux_artifacts.dart @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,23 +6,16 @@ import 'package:file/file.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/os.dart'; -import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; class ELinuxArtifacts extends CachedArtifacts { ELinuxArtifacts({ - required FileSystem fileSystem, - required Platform platform, - required Cache cache, - required OperatingSystemUtils operatingSystemUtils, - }) : _cache = cache, - super( - fileSystem: fileSystem, - platform: platform, - cache: cache, - operatingSystemUtils: operatingSystemUtils, - ); + required super.fileSystem, + required super.platform, + required super.cache, + required super.operatingSystemUtils, + }) : _cache = cache; final Cache _cache; diff --git a/lib/elinux_build_target.dart b/lib/elinux_build_target.dart index d2181c7..cfa0be4 100644 --- a/lib/elinux_build_target.dart +++ b/lib/elinux_build_target.dart @@ -21,6 +21,7 @@ import 'package:flutter_tools/src/build_system/targets/android.dart'; import 'package:flutter_tools/src/build_system/targets/assets.dart'; import 'package:flutter_tools/src/build_system/targets/common.dart'; import 'package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart'; +import 'package:flutter_tools/src/build_system/targets/shader_compiler.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/cmake.dart'; import 'package:flutter_tools/src/globals.dart' as globals; @@ -95,6 +96,7 @@ abstract class ELinuxAssetBundle extends Target { outputDirectory, targetPlatform: tp, buildMode: buildMode, + shaderTarget: ShaderTarget.sksl, ); final DepfileService depfileService = DepfileService( fileSystem: environment.fileSystem, diff --git a/lib/elinux_cache.dart b/lib/elinux_cache.dart index afe8467..acaf2bc 100644 --- a/lib/elinux_cache.dart +++ b/lib/elinux_cache.dart @@ -1,4 +1,4 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,6 +12,7 @@ import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/flutter_cache.dart'; import 'package:flutter_tools/src/globals.dart' as globals; +import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; mixin ELinuxRequiredArtifacts on FlutterCommand { @@ -46,11 +47,13 @@ class ELinuxFlutterCache extends FlutterCache { required FileSystem fileSystem, required Platform platform, required OperatingSystemUtils osUtils, + required FlutterProjectFactory projectFactory, }) : super( logger: logger, fileSystem: fileSystem, platform: platform, - osUtils: osUtils) { + osUtils: osUtils, + projectFactory: projectFactory) { registerArtifact(ELinuxEngineArtifacts(this, platform: platform)); } } diff --git a/lib/elinux_device.dart b/lib/elinux_device.dart index 9d584ff..8409cd2 100644 --- a/lib/elinux_device.dart +++ b/lib/elinux_device.dart @@ -1,4 +1,4 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // 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. @@ -6,11 +6,9 @@ // @dart = 2.8 import 'dart:async'; -import 'dart:convert'; import 'dart:io'; import 'package:flutter_tools/src/android/android_device.dart'; -import 'package:flutter_tools/src/base/common.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/os.dart'; import 'package:flutter_tools/src/base/process.dart'; diff --git a/lib/elinux_device_discovery.dart b/lib/elinux_device_discovery.dart index 2c585a5..be4927d 100644 --- a/lib/elinux_device_discovery.dart +++ b/lib/elinux_device_discovery.dart @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be @@ -54,7 +54,6 @@ class ELinuxDeviceManager extends FlutterDeviceManager { macOSWorkflow: context.get(), fuchsiaSdk: globals.fuchsiaSdk, operatingSystemUtils: globals.os, - terminal: globals.terminal, customDevicesConfig: CustomDevicesConfig( fileSystem: globals.fs, logger: globals.logger, diff --git a/lib/executable.dart b/lib/executable.dart index 58da717..99320ba 100644 --- a/lib/executable.dart +++ b/lib/executable.dart @@ -1,4 +1,4 @@ -// Copyright 2021 Sony Group Corporation. All rights reserved. +// Copyright 2023 Sony Group Corporation. All rights reserved. // Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be @@ -45,11 +45,11 @@ import 'commands/precache.dart'; import 'commands/run.dart'; import 'commands/test.dart'; import 'commands/upgrade.dart'; +import 'elinux_artifacts.dart'; import 'elinux_cache.dart'; import 'elinux_device_discovery.dart'; import 'elinux_doctor.dart'; import 'elinux_package.dart'; -import 'elinux_artifacts.dart'; /// Main entry point for commands. /// @@ -92,15 +92,27 @@ Future main(List args) async { GenerateLocalizationsCommand( fileSystem: globals.fs, logger: globals.logger, + artifacts: globals.artifacts, + processManager: globals.processManager, ), - InstallCommand(), + InstallCommand(verboseHelp: verboseHelp), LogsCommand(), - ScreenshotCommand(), + ScreenshotCommand(fs: globals.fs), SymbolizeCommand(stdio: globals.stdio, fileSystem: globals.fs), ELinuxUpgradeCommand(verboseHelp: verboseHelp), // Commands extended for ELinux. ELinuxAnalyzeCommand(verboseHelp: verboseHelp), - ELinuxAttachCommand(verboseHelp: verboseHelp), + ELinuxAttachCommand( + verboseHelp: verboseHelp, + artifacts: globals.artifacts, + stdio: globals.stdio, + logger: globals.logger, + terminal: globals.terminal, + signals: globals.signals, + platform: globals.platform, + processInfo: globals.processInfo, + fileSystem: globals.fs, + ), ELinuxBuildCommand(verboseHelp: verboseHelp), ELinuxCleanCommand(verbose: verbose), ELinuxCreateCommand(verboseHelp: verboseHelp), @@ -126,6 +138,7 @@ Future main(List args) async { logger: globals.logger, platform: globals.platform, osUtils: globals.os, + projectFactory: globals.projectFactory, ), TemplateRenderer: () => const MustacheTemplateRenderer(), ApplicationPackageFactory: () => ELinuxApplicationPackageFactory(), @@ -151,6 +164,7 @@ Future main(List args) async { outputPreferences: globals.outputPreferences, )), }, + shutdownHooks: globals.shutdownHooks, ); } diff --git a/templates/app/runner/flutter_embedder_options.h b/templates/app/runner/flutter_embedder_options.h index fbb8190..bfb5b43 100644 --- a/templates/app/runner/flutter_embedder_options.h +++ b/templates/app/runner/flutter_embedder_options.h @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Corporation. All rights reserved. +// Copyright 2023 Sony Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,17 +22,21 @@ class FlutterEmbedderOptions { "Window rotation(degree) [0(default)|90|180|270]", 0, false); options_.AddDouble("force-scale-factor", "s", - "Force a scale factor instead using default value", 1.0, - false); + "Force a scale factor instead using default value", 1.0, + false); #if defined(FLUTTER_TARGET_BACKEND_GBM) || \ defined(FLUTTER_TARGET_BACKEND_EGLSTREAM) // no more options. #elif defined(FLUTTER_TARGET_BACKEND_X11) + options_.AddString("title", "t", "Window title", "Flutter", false); options_.AddWithoutValue("fullscreen", "f", "Always full-screen display", false); options_.AddInt("width", "w", "Window width", 1280, false); options_.AddInt("height", "h", "Window height", 720, false); #else // FLUTTER_TARGET_BACKEND_WAYLAND + options_.AddString("title", "t", "Window title", "Flutter", false); + options_.AddString("app-id", "a", "XDG App ID", "dev.flutter.elinux", + false); options_.AddWithoutValue("onscreen-keyboard", "k", "Enable on-screen keyboard", false); options_.AddWithoutValue("window-decoration", "d", @@ -91,6 +95,7 @@ class FlutterEmbedderOptions { #elif defined(FLUTTER_TARGET_BACKEND_X11) use_onscreen_keyboard_ = false; use_window_decoration_ = false; + window_title_ = options_.GetValue("title"); window_view_mode_ = options_.Exist("fullscreen") ? flutter::FlutterViewController::ViewMode::kFullscreen @@ -98,6 +103,8 @@ class FlutterEmbedderOptions { window_width_ = options_.GetValue("width"); window_height_ = options_.GetValue("height"); #else // FLUTTER_TARGET_BACKEND_WAYLAND + window_title_ = options_.GetValue("title"); + window_app_id_ = options_.GetValue("app-id"); use_onscreen_keyboard_ = options_.Exist("onscreen-keyboard"); use_window_decoration_ = options_.Exist("window-decoration"); window_view_mode_ = @@ -112,6 +119,8 @@ class FlutterEmbedderOptions { } std::string BundlePath() const { return bundle_path_; } + std::string WindowTitle() const { return window_title_; } + std::string WindowAppID() const { return window_app_id_; } bool IsUseMouseCursor() const { return use_mouse_cursor_; } bool IsUseOnscreenKeyboard() const { return use_onscreen_keyboard_; } bool IsUseWindowDecoraation() const { return use_window_decoration_; } @@ -130,6 +139,8 @@ class FlutterEmbedderOptions { commandline::CommandOptions options_; std::string bundle_path_; + std::string window_title_; + std::string window_app_id_; bool use_mouse_cursor_ = true; bool use_onscreen_keyboard_ = false; bool use_window_decoration_ = false; diff --git a/templates/app/runner/main.cc b/templates/app/runner/main.cc index dd3e12d..ae4a067 100644 --- a/templates/app/runner/main.cc +++ b/templates/app/runner/main.cc @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Corporation. All rights reserved. +// Copyright 2023 Sony Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,6 +30,8 @@ int main(int argc, char** argv) { view_properties.height = options.WindowHeight(); view_properties.view_mode = options.WindowViewMode(); view_properties.view_rotation = options.WindowRotation(); + view_properties.title = options.WindowTitle(); + view_properties.app_id = options.WindowAppID(); view_properties.use_mouse_cursor = options.IsUseMouseCursor(); view_properties.use_onscreen_keyboard = options.IsUseOnscreenKeyboard(); view_properties.use_window_decoration = options.IsUseWindowDecoraation();