diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index fcca26c69d678e576d112884dea202214db4749d..30bbd785e603f4763984812e1129708bd76eae47 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -54,8 +54,6 @@ FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h FILE: ../../../flutter/common/task_runners.cc FILE: ../../../flutter/common/task_runners.h -FILE: ../../../flutter/common/version/version.cc -FILE: ../../../flutter/common/version/version.h FILE: ../../../flutter/flow/compositor_context.cc FILE: ../../../flutter/flow/compositor_context.h FILE: ../../../flutter/flow/debug_print.cc @@ -360,9 +358,6 @@ FILE: ../../../flutter/lib/ui/text/text_box.h FILE: ../../../flutter/lib/ui/ui.dart FILE: ../../../flutter/lib/ui/ui_dart_state.cc FILE: ../../../flutter/lib/ui/ui_dart_state.h -FILE: ../../../flutter/lib/ui/versions.cc -FILE: ../../../flutter/lib/ui/versions.dart -FILE: ../../../flutter/lib/ui/versions.h FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/platform_message.cc FILE: ../../../flutter/lib/ui/window/platform_message.h @@ -720,6 +715,8 @@ FILE: ../../../flutter/shell/platform/glfw/keyboard_hook_handler.h FILE: ../../../flutter/shell/platform/glfw/public/flutter_glfw.h FILE: ../../../flutter/shell/platform/glfw/text_input_plugin.cc FILE: ../../../flutter/shell/platform/glfw/text_input_plugin.h +FILE: ../../../flutter/shell/version/version.cc +FILE: ../../../flutter/shell/version/version.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart FILE: ../../../flutter/sky/tools/roll/patches/chromium/android_build.patch FILE: ../../../flutter/third_party/txt/src/txt/platform.cc diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 51dd35ccfbea81b7588ab5b23d7b90b1db0f90f4..bef50753a4b9e35da2334764e96d3d051efcb812 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -81,8 +81,6 @@ source_set("ui") { "text/text_box.h", "ui_dart_state.cc", "ui_dart_state.h", - "versions.cc", - "versions.h", "window/platform_message.cc", "window/platform_message.h", "window/platform_message_response.cc", @@ -104,7 +102,6 @@ source_set("ui") { deps = [ "$flutter_root/assets", "$flutter_root/common", - "$flutter_root/common/version", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime:test_font", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index a434db2b95baa712d74ef86f4245deac77e0b49c..8605d7a9600950c007c45215806ec3bdc4edb002 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -27,7 +27,6 @@ #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_builder.h" -#include "flutter/lib/ui/versions.h" #include "flutter/lib/ui/window/window.h" #include "third_party/tonic/converter/dart_converter.h" #include "third_party/tonic/logging/dart_error.h" @@ -91,7 +90,6 @@ void DartUI::InitForGlobal() { SceneBuilder::RegisterNatives(g_natives); SemanticsUpdate::RegisterNatives(g_natives); SemanticsUpdateBuilder::RegisterNatives(g_natives); - Versions::RegisterNatives(g_natives); Vertices::RegisterNatives(g_natives); Window::RegisterNatives(g_natives); #if defined(OS_FUCHSIA) diff --git a/lib/ui/dart_ui.gni b/lib/ui/dart_ui.gni index 67246f6ef84983e401c1fc060edc691cbd382107..c52a9f025f2316b9572776758c7c29d878729b64 100644 --- a/lib/ui/dart_ui.gni +++ b/lib/ui/dart_ui.gni @@ -16,7 +16,6 @@ dart_ui_files = [ "$flutter_root/lib/ui/semantics.dart", "$flutter_root/lib/ui/text.dart", "$flutter_root/lib/ui/ui.dart", - "$flutter_root/lib/ui/versions.dart", "$flutter_root/lib/ui/window.dart", ] diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 5730f4e1378fa649f8cbce4732b49892c483f471..cef4db81cee0e43ba2c7d29a6e2b9bc2277e7acf 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -34,5 +34,4 @@ part 'plugins.dart'; part 'pointer.dart'; part 'semantics.dart'; part 'text.dart'; -part 'versions.dart'; part 'window.dart'; diff --git a/lib/ui/versions.cc b/lib/ui/versions.cc deleted file mode 100644 index 0398eccf2963cede5603cbe768a65f3435f983f3..0000000000000000000000000000000000000000 --- a/lib/ui/versions.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2013 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. - -#include "flutter/lib/ui/versions.h" -#include "flutter/common/version/version.h" -#include "third_party/tonic/converter/dart_converter.h" -#include "third_party/tonic/dart_library_natives.h" - -#include -#include - -using tonic::DartConverter; - -namespace flutter { - -// returns a vector with 3 versions. -// Dart, Skia and Flutter engine versions in this order. -void GetVersions(Dart_NativeArguments args) { - const std::vector versions_list = { - GetDartVersion(), GetSkiaVersion(), GetFlutterEngineVersion()}; - Dart_Handle dart_val = - DartConverter>::ToDart(versions_list); - Dart_SetReturnValue(args, dart_val); -} - -void Versions::RegisterNatives(tonic::DartLibraryNatives* natives) { - natives->Register({{"Versions_getVersions", GetVersions, 0, true}}); -} - -} // namespace flutter diff --git a/lib/ui/versions.dart b/lib/ui/versions.dart deleted file mode 100644 index 9121234856082ed69909e4a017c697e60a757f4c..0000000000000000000000000000000000000000 --- a/lib/ui/versions.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2013 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. - -part of dart.ui; - -/// Wraps version information for Dart, Skia and Flutter. -class Versions { - - /// Builds a versions object using the information - /// we get from calling the native getVersions. - factory Versions._internal() { - final List versions = _getVersions(); - return Versions._(versions[0], versions[1], versions[2]); - } - - /// Private constructor to capture the versions. - Versions._( - this.dartVersion, - this.skiaVersion, - this.flutterEngineVersion - ) : assert(dartVersion != null), - assert(skiaVersion != null), - assert(flutterEngineVersion != null); - - /// returns a vector with 3 versions. - /// Dart, Skia and Flutter engine versions in this order. - static List _getVersions() native 'Versions_getVersions'; - - final String dartVersion; - final String skiaVersion; - final String flutterEngineVersion; -} - -/// [Versions] singleton. This object exposes Dart, Skia and -/// Flutter engine versions. -final Versions versions = Versions._internal(); diff --git a/lib/ui/versions.h b/lib/ui/versions.h deleted file mode 100644 index eb18ce380ca64a291688fec44548f5702c940a96..0000000000000000000000000000000000000000 --- a/lib/ui/versions.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2013 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. - -#ifndef FLUTTER_LIB_UI_VERSIONS_H_ -#define FLUTTER_LIB_UI_VERSIONS_H_ - -namespace tonic { -class DartLibraryNatives; -} // namespace tonic - -namespace flutter { - -class Versions final { - public: - static void RegisterNatives(tonic::DartLibraryNatives* natives); -}; - -} // namespace flutter - -#endif // FLUTTER_LIB_UI_VERSIONS_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 0e5c5b90d71d258c20db55352b74726eba835b6a..48d949e227e1e12949596f55093babdf537b64ad 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -106,7 +106,7 @@ source_set("common") { ] public_deps = [ - "$flutter_root/common/version", + "$flutter_root/shell/version", "$flutter_root/third_party/txt", "//third_party/rapidjson", "//third_party/tonic", diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 1fe0cfe0295df8021f9b0cff75cc413a31fc47aa..4d7da77e85b6b99e58eacd5ca364a419ebb04faf 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -10,7 +10,6 @@ #include #include "flutter/common/settings.h" -#include "flutter/common/version/version.h" #include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/file.h" #include "flutter/fml/make_copyable.h" diff --git a/shell/common/persistent_cache.cc b/shell/common/persistent_cache.cc index 4c110970e05de44e273ccb50f1190a385970fa77..ce2b380cd1adc9d45d29c32609b890da8094beca 100644 --- a/shell/common/persistent_cache.cc +++ b/shell/common/persistent_cache.cc @@ -7,13 +7,13 @@ #include #include -#include "flutter/common/version/version.h" #include "flutter/fml/base32.h" #include "flutter/fml/file.h" #include "flutter/fml/make_copyable.h" #include "flutter/fml/mapping.h" #include "flutter/fml/paths.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/version/version.h" namespace flutter { diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 366923614b3bcf01ba00828684efc8f3516fefa1..6298772af988f7a0c55ca7aceb469165e1edb1a6 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -9,10 +9,10 @@ #include #include -#include "flutter/common/version/version.h" #include "flutter/fml/native_library.h" #include "flutter/fml/paths.h" #include "flutter/fml/string_view.h" +#include "flutter/shell/version/version.h" // Include once for the default enum definition. #include "flutter/shell/common/switches.h" diff --git a/common/version/BUILD.gn b/shell/version/BUILD.gn similarity index 100% rename from common/version/BUILD.gn rename to shell/version/BUILD.gn diff --git a/common/version/version.cc b/shell/version/version.cc similarity index 90% rename from common/version/version.cc rename to shell/version/version.cc index db5fb0608001e9979bb4890e6d2f2c909ff2629c..72c989381b4acd89520fe27883e8dea2b6b200fb 100644 --- a/common/version/version.cc +++ b/shell/version/version.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/common/version/version.h" +#include "flutter/shell/version/version.h" namespace flutter { diff --git a/common/version/version.gni b/shell/version/version.gni similarity index 100% rename from common/version/version.gni rename to shell/version/version.gni diff --git a/common/version/version.h b/shell/version/version.h similarity index 70% rename from common/version/version.h rename to shell/version/version.h index 00ab5031db419e346c91c71dfba2e58300679699..cbf3357d6a1ea43f32adb8a4be0c5ea48795944f 100644 --- a/common/version/version.h +++ b/shell/version/version.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_COMMON_VERSION_VERSION_H_ -#define FLUTTER_COMMON_VERSION_VERSION_H_ +#ifndef FLUTTER_SHELL_COMMON_VERSION_H_ +#define FLUTTER_SHELL_COMMON_VERSION_H_ namespace flutter { @@ -15,4 +15,4 @@ const char* GetDartVersion(); } // namespace flutter -#endif // FLUTTER_COMMON_VERSION_VERSION_H_ +#endif // FLUTTER_SHELL_COMMON_VERSION_H_ diff --git a/testing/dart/versions_test.dart b/testing/dart/versions_test.dart deleted file mode 100644 index 91935c76a58bcb7ae77337bfa3c2b881ca2e8d5c..0000000000000000000000000000000000000000 --- a/testing/dart/versions_test.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2013 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:ui'; - -import 'package:test/test.dart'; - -bool _isNotEmpty(String s) { - if (s == null || s.isEmpty) { - return false; - } else { - return true; - } -} - -void main() { - test('dartVersion should not be empty', () { - final String dartVersion = versions.dartVersion; - expect(_isNotEmpty(dartVersion), equals(true)); - }); - - test('skiaVersion should not be empty', () { - final String skiaVersion = versions.skiaVersion; - expect(_isNotEmpty(skiaVersion), equals(true)); - }); - - test('flutterEngineVersion should not be empty', () { - final String flutterEngineVersion = versions.flutterEngineVersion; - expect(_isNotEmpty(flutterEngineVersion), equals(true)); - }); -}