From abeeab27a2d1a831908772a52a018dab670f3528 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:21:18 +0200 Subject: [PATCH 1/3] Unfederate package_info_plus --- .../package_info_plus/example/pubspec.yaml | 8 -- .../lib/package_info_plus.dart | 3 + .../lib/src/file_version_info.dart | 0 .../lib/src/package_info_plus_linux.dart} | 4 +- .../lib/src}/package_info_plus_macos.dart | 0 .../lib/src}/package_info_plus_web.dart | 10 +-- .../lib/src/package_info_plus_windows.dart | 6 +- .../macos/Assets/.gitkeep | 0 .../macos/Classes/FLTPackageInfoPlusPlugin.h | 0 .../macos/Classes/FLTPackageInfoPlusPlugin.m | 0 .../macos/package_info_plus.podspec | 4 +- .../package_info_plus/pubspec.yaml | 25 ++++--- .../test/package_info_plus_linux_test.dart | 6 +- .../test/package_info_plus_web_test.dart | 26 +++---- .../package_info_plus_web_test.mocks.dart | 0 .../test/package_info_plus_windows_test.dart | 6 +- .../package_info_plus_linux/.gitignore | 7 -- .../package_info_plus_linux/.metadata | 10 --- .../package_info_plus_linux/CHANGELOG.md | 36 --------- .../package_info_plus_linux/LICENSE | 27 ------- .../package_info_plus_linux/README.md | 12 --- .../lib/package_info_plus_linux.dart | 4 - .../package_info_plus_linux/pubspec.yaml | 28 ------- .../package_info_plus_macos/CHANGELOG.md | 39 ---------- .../package_info_plus_macos/LICENSE | 25 ------- .../package_info_plus_macos/README.md | 12 --- .../macos/package_info_plus_macos.podspec | 20 ----- .../package_info_plus_macos/pubspec.yaml | 20 ----- .../package_info_plus_web/CHANGELOG.md | 50 ------------- .../package_info_plus_web/LICENSE | 29 -------- .../package_info_plus_web/README.md | 12 --- .../package_info_plus_web/pubspec.yaml | 31 -------- .../package_info_plus_windows/.gitignore | 74 ------------------- .../package_info_plus_windows/.metadata | 10 --- .../package_info_plus_windows/CHANGELOG.md | 48 ------------ .../package_info_plus_windows/LICENSE | 27 ------- .../package_info_plus_windows/README.md | 12 --- .../lib/package_info_plus_windows.dart | 1 - .../package_info_plus_windows/pubspec.yaml | 29 -------- 39 files changed, 46 insertions(+), 615 deletions(-) rename packages/package_info_plus/{package_info_plus_windows => package_info_plus}/lib/src/file_version_info.dart (100%) rename packages/package_info_plus/{package_info_plus_linux/lib/src/package_info.dart => package_info_plus/lib/src/package_info_plus_linux.dart} (91%) rename packages/package_info_plus/{package_info_plus_macos/lib => package_info_plus/lib/src}/package_info_plus_macos.dart (100%) rename packages/package_info_plus/{package_info_plus_web/lib => package_info_plus/lib/src}/package_info_plus_web.dart (88%) rename packages/package_info_plus/{package_info_plus_windows => package_info_plus}/lib/src/package_info_plus_windows.dart (90%) rename packages/package_info_plus/{package_info_plus_macos => package_info_plus}/macos/Assets/.gitkeep (100%) rename packages/package_info_plus/{package_info_plus_macos => package_info_plus}/macos/Classes/FLTPackageInfoPlusPlugin.h (100%) rename packages/package_info_plus/{package_info_plus_macos => package_info_plus}/macos/Classes/FLTPackageInfoPlusPlugin.m (100%) rename packages/package_info_plus/{package_info_plus_linux => package_info_plus}/test/package_info_plus_linux_test.dart (52%) rename packages/package_info_plus/{package_info_plus_web => package_info_plus}/test/package_info_plus_web_test.dart (82%) rename packages/package_info_plus/{package_info_plus_web => package_info_plus}/test/package_info_plus_web_test.mocks.dart (100%) rename packages/package_info_plus/{package_info_plus_windows => package_info_plus}/test/package_info_plus_windows_test.dart (50%) delete mode 100644 packages/package_info_plus/package_info_plus_linux/.gitignore delete mode 100644 packages/package_info_plus/package_info_plus_linux/.metadata delete mode 100644 packages/package_info_plus/package_info_plus_linux/CHANGELOG.md delete mode 100644 packages/package_info_plus/package_info_plus_linux/LICENSE delete mode 100644 packages/package_info_plus/package_info_plus_linux/README.md delete mode 100644 packages/package_info_plus/package_info_plus_linux/lib/package_info_plus_linux.dart delete mode 100644 packages/package_info_plus/package_info_plus_linux/pubspec.yaml delete mode 100644 packages/package_info_plus/package_info_plus_macos/CHANGELOG.md delete mode 100644 packages/package_info_plus/package_info_plus_macos/LICENSE delete mode 100644 packages/package_info_plus/package_info_plus_macos/README.md delete mode 100644 packages/package_info_plus/package_info_plus_macos/macos/package_info_plus_macos.podspec delete mode 100644 packages/package_info_plus/package_info_plus_macos/pubspec.yaml delete mode 100644 packages/package_info_plus/package_info_plus_web/CHANGELOG.md delete mode 100644 packages/package_info_plus/package_info_plus_web/LICENSE delete mode 100644 packages/package_info_plus/package_info_plus_web/README.md delete mode 100644 packages/package_info_plus/package_info_plus_web/pubspec.yaml delete mode 100644 packages/package_info_plus/package_info_plus_windows/.gitignore delete mode 100644 packages/package_info_plus/package_info_plus_windows/.metadata delete mode 100644 packages/package_info_plus/package_info_plus_windows/CHANGELOG.md delete mode 100644 packages/package_info_plus/package_info_plus_windows/LICENSE delete mode 100644 packages/package_info_plus/package_info_plus_windows/README.md delete mode 100644 packages/package_info_plus/package_info_plus_windows/lib/package_info_plus_windows.dart delete mode 100644 packages/package_info_plus/package_info_plus_windows/pubspec.yaml diff --git a/packages/package_info_plus/package_info_plus/example/pubspec.yaml b/packages/package_info_plus/package_info_plus/example/pubspec.yaml index 046cd8e7b2..bafc7ccdb7 100644 --- a/packages/package_info_plus/package_info_plus/example/pubspec.yaml +++ b/packages/package_info_plus/package_info_plus/example/pubspec.yaml @@ -13,16 +13,8 @@ dependencies: path: ../ dependency_overrides: - package_info_plus_linux: - path: ../../package_info_plus_linux - package_info_plus_macos: - path: ../../package_info_plus_macos package_info_plus_platform_interface: path: ../../package_info_plus_platform_interface - package_info_plus_web: - path: ../../package_info_plus_web - package_info_plus_windows: - path: ../../package_info_plus_windows dev_dependencies: integration_test: diff --git a/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart b/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart index cf2e1ff864..53f29952f0 100644 --- a/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart +++ b/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart @@ -7,6 +7,9 @@ import 'dart:async'; import 'package:flutter/foundation.dart' show visibleForTesting; import 'package:package_info_plus_platform_interface/package_info_platform_interface.dart'; +export 'src/package_info_plus_linux.dart'; +export 'src/package_info_plus_windows.dart' if (dart.library.html) 'src/package_info_plus_web.dart'; + /// Application metadata. Provides application bundle information on iOS and /// application package information on Android. class PackageInfo { diff --git a/packages/package_info_plus/package_info_plus_windows/lib/src/file_version_info.dart b/packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart similarity index 100% rename from packages/package_info_plus/package_info_plus_windows/lib/src/file_version_info.dart rename to packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart diff --git a/packages/package_info_plus/package_info_plus_linux/lib/src/package_info.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_linux.dart similarity index 91% rename from packages/package_info_plus/package_info_plus_linux/lib/src/package_info.dart rename to packages/package_info_plus/package_info_plus/lib/src/package_info_plus_linux.dart index e9ca4607c8..4cf589a518 100644 --- a/packages/package_info_plus/package_info_plus_linux/lib/src/package_info.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_linux.dart @@ -6,10 +6,10 @@ import 'package:package_info_plus_platform_interface/package_info_platform_inter import 'package:path/path.dart' as path; /// The Linux implementation of [PackageInfoPlatform]. -class PackageInfoLinux extends PackageInfoPlatform { +class PackageInfoPlusLinuxPlugin extends PackageInfoPlatform { /// Register this dart class as the platform implementation for linux static void registerWith() { - PackageInfoPlatform.instance = PackageInfoLinux(); + PackageInfoPlatform.instance = PackageInfoPlusLinuxPlugin(); } /// Returns a map with the following keys: diff --git a/packages/package_info_plus/package_info_plus_macos/lib/package_info_plus_macos.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_macos.dart similarity index 100% rename from packages/package_info_plus/package_info_plus_macos/lib/package_info_plus_macos.dart rename to packages/package_info_plus/package_info_plus/lib/src/package_info_plus_macos.dart diff --git a/packages/package_info_plus/package_info_plus_web/lib/package_info_plus_web.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart similarity index 88% rename from packages/package_info_plus/package_info_plus_web/lib/package_info_plus_web.dart rename to packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart index cf66c6f3b9..b6d598936a 100644 --- a/packages/package_info_plus/package_info_plus_web/lib/package_info_plus_web.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart @@ -9,15 +9,15 @@ import 'package:package_info_plus_platform_interface/package_info_platform_inter /// The web implementation of [PackageInfoPlatform]. /// /// This class implements the `package:package_info_plus` functionality for the web. -class PackageInfoPlugin extends PackageInfoPlatform { +class PackageInfoPlusWebPlugin extends PackageInfoPlatform { final Client? _client; /// Create plugin with http client. - PackageInfoPlugin([this._client]); + PackageInfoPlusWebPlugin([this._client]); /// Registers this class as the default instance of [PackageInfoPlatform]. static void registerWith(Registrar registrar) { - PackageInfoPlatform.instance = PackageInfoPlugin(); + PackageInfoPlatform.instance = PackageInfoPlusWebPlugin(); } /// Get version.json full url. @@ -25,9 +25,7 @@ class PackageInfoPlugin extends PackageInfoPlatform { final baseUri = Uri.parse(baseUrl); final originPath = '${baseUri._origin}${baseUri.path}'; final versionJson = 'version.json?cachebuster=$cacheBuster'; - return Uri.parse(originPath.endsWith('/') - ? '$originPath$versionJson' - : '$originPath/$versionJson'); + return Uri.parse(originPath.endsWith('/') ? '$originPath$versionJson' : '$originPath/$versionJson'); } @override diff --git a/packages/package_info_plus/package_info_plus_windows/lib/src/package_info_plus_windows.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_windows.dart similarity index 90% rename from packages/package_info_plus/package_info_plus_windows/lib/src/package_info_plus_windows.dart rename to packages/package_info_plus/package_info_plus/lib/src/package_info_plus_windows.dart index b2a2ecd6b0..d1942bbbed 100644 --- a/packages/package_info_plus/package_info_plus_windows/lib/src/package_info_plus_windows.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_windows.dart @@ -1,8 +1,8 @@ /// The Windows implementation of `package_info_plus`. library package_info_plus_windows; -import 'dart:io'; import 'dart:ffi'; +import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:package_info_plus_platform_interface/package_info_data.dart'; @@ -12,10 +12,10 @@ import 'package:win32/win32.dart'; part 'file_version_info.dart'; /// The Windows implementation of [PackageInfoPlatform]. -class PackageInfoWindows extends PackageInfoPlatform { +class PackageInfoPlusWindowsPlugin extends PackageInfoPlatform { /// Register this dart class as the platform implementation for linux static void registerWith() { - PackageInfoPlatform.instance = PackageInfoWindows(); + PackageInfoPlatform.instance = PackageInfoPlusWindowsPlugin(); } /// Returns a map with the following keys: diff --git a/packages/package_info_plus/package_info_plus_macos/macos/Assets/.gitkeep b/packages/package_info_plus/package_info_plus/macos/Assets/.gitkeep similarity index 100% rename from packages/package_info_plus/package_info_plus_macos/macos/Assets/.gitkeep rename to packages/package_info_plus/package_info_plus/macos/Assets/.gitkeep diff --git a/packages/package_info_plus/package_info_plus_macos/macos/Classes/FLTPackageInfoPlusPlugin.h b/packages/package_info_plus/package_info_plus/macos/Classes/FLTPackageInfoPlusPlugin.h similarity index 100% rename from packages/package_info_plus/package_info_plus_macos/macos/Classes/FLTPackageInfoPlusPlugin.h rename to packages/package_info_plus/package_info_plus/macos/Classes/FLTPackageInfoPlusPlugin.h diff --git a/packages/package_info_plus/package_info_plus_macos/macos/Classes/FLTPackageInfoPlusPlugin.m b/packages/package_info_plus/package_info_plus/macos/Classes/FLTPackageInfoPlusPlugin.m similarity index 100% rename from packages/package_info_plus/package_info_plus_macos/macos/Classes/FLTPackageInfoPlusPlugin.m rename to packages/package_info_plus/package_info_plus/macos/Classes/FLTPackageInfoPlusPlugin.m diff --git a/packages/package_info_plus/package_info_plus/macos/package_info_plus.podspec b/packages/package_info_plus/package_info_plus/macos/package_info_plus.podspec index e74c4c11b2..24b53631ac 100644 --- a/packages/package_info_plus/package_info_plus/macos/package_info_plus.podspec +++ b/packages/package_info_plus/package_info_plus/macos/package_info_plus.podspec @@ -3,10 +3,10 @@ # Pod::Spec.new do |s| s.name = 'package_info_plus' - s.version = '0.4.5' + s.version = '0.0.1' s.summary = 'Flutter Package Info' s.description = <<-DESC -A new flutter plugin project. + A macOS implementation of the package_info_plus plugin. DESC s.homepage = 'https://github.com/fluttercommunity/package_info_plus' s.license = { :file => '../LICENSE' } diff --git a/packages/package_info_plus/package_info_plus/pubspec.yaml b/packages/package_info_plus/package_info_plus/pubspec.yaml index a4020ff1f3..8409664f65 100644 --- a/packages/package_info_plus/package_info_plus/pubspec.yaml +++ b/packages/package_info_plus/package_info_plus/pubspec.yaml @@ -14,27 +14,34 @@ flutter: ios: pluginClass: FLTPackageInfoPlusPlugin linux: - default_package: package_info_plus_linux + dartPluginClass: PackageInfoPlusLinuxPlugin macos: - default_package: package_info_plus_macos + pluginClass: FLTPackageInfoPlusPlugin web: - default_package: package_info_plus_web + pluginClass: PackageInfoPlusWebPlugin + fileName: src/package_info_plus_web.dart windows: - default_package: package_info_plus_windows + dartPluginClass: PackageInfoPlusWindowsPlugin dependencies: + ffi: ^2.0.1 flutter: sdk: flutter + flutter_web_plugins: + sdk: flutter + http: ^0.13.0 + meta: ^1.3.0 + path: ^1.8.0 package_info_plus_platform_interface: ^2.0.0 - package_info_plus_linux: ^2.0.0 - package_info_plus_macos: ^2.0.0 - package_info_plus_windows: ^3.0.0 - package_info_plus_web: ^2.0.0 + win32: ">=2.7.0 <4.0.0" + dev_dependencies: + build_runner: ^2.0.3 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter + mockito: ^5.0.7 test: ^1.21.1 - flutter_lints: ^2.0.1 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/packages/package_info_plus/package_info_plus_linux/test/package_info_plus_linux_test.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_linux_test.dart similarity index 52% rename from packages/package_info_plus/package_info_plus_linux/test/package_info_plus_linux_test.dart rename to packages/package_info_plus/package_info_plus/test/package_info_plus_linux_test.dart index c496908e60..26748f2e4b 100644 --- a/packages/package_info_plus/package_info_plus_linux/test/package_info_plus_linux_test.dart +++ b/packages/package_info_plus/package_info_plus/test/package_info_plus_linux_test.dart @@ -1,10 +1,10 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:package_info_plus_linux/src/package_info.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus_platform_interface/package_info_platform_interface.dart'; void main() { test('registered instance', () { - PackageInfoLinux.registerWith(); - expect(PackageInfoPlatform.instance, isA()); + PackageInfoPlusLinuxPlugin.registerWith(); + expect(PackageInfoPlatform.instance, isA()); }); } diff --git a/packages/package_info_plus/package_info_plus_web/test/package_info_plus_web_test.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart similarity index 82% rename from packages/package_info_plus/package_info_plus_web/test/package_info_plus_web_test.dart rename to packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart index c6bb8208bc..cf20979c9d 100644 --- a/packages/package_info_plus/package_info_plus_web/test/package_info_plus_web_test.dart +++ b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart @@ -1,10 +1,10 @@ import 'dart:convert'; import 'package:flutter_test/flutter_test.dart'; +import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:package_info_plus_web/package_info_plus_web.dart'; -import 'package:http/http.dart' as http; +import 'package:package_info_plus/src/package_info_plus_web.dart'; import 'package_info_plus_web_test.mocks.dart'; @@ -20,12 +20,12 @@ void main() { 'build_signature': '', }; - late PackageInfoPlugin plugin; + late PackageInfoPlusWebPlugin plugin; late MockClient client; setUp(() { client = MockClient(); - plugin = PackageInfoPlugin(client); + plugin = PackageInfoPlusWebPlugin(client); }); group( @@ -85,18 +85,15 @@ void main() { Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl( - 'https://example.com/?hello_world=true#/my-page', 1), + plugin.versionJsonUrl('https://example.com/?hello_world=true#/my-page', 1), Uri.parse('https://example.com/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl( - 'https://example.com/a/b/c/?hello_world=true#/my-page', 1), + plugin.versionJsonUrl('https://example.com/a/b/c/?hello_world=true#/my-page', 1), Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl( - 'https://example.com/a/b/c?hello_world=true#/my-page', 1), + plugin.versionJsonUrl('https://example.com/a/b/c?hello_world=true#/my-page', 1), Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); }, @@ -109,18 +106,15 @@ void main() { ); expect( plugin.versionJsonUrl('chrome-extension://abcdefgh/a/b/c', 1), - Uri.parse( - 'chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), + Uri.parse('chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), ); expect( plugin.versionJsonUrl('chrome-extension://abcdefgh/#my-page', 1), Uri.parse('chrome-extension://abcdefgh/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl( - 'chrome-extension://abcdefgh/a/b/c/#my-page', 1), - Uri.parse( - 'chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), + plugin.versionJsonUrl('chrome-extension://abcdefgh/a/b/c/#my-page', 1), + Uri.parse('chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), ); }); }, diff --git a/packages/package_info_plus/package_info_plus_web/test/package_info_plus_web_test.mocks.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart similarity index 100% rename from packages/package_info_plus/package_info_plus_web/test/package_info_plus_web_test.mocks.dart rename to packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart diff --git a/packages/package_info_plus/package_info_plus_windows/test/package_info_plus_windows_test.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_windows_test.dart similarity index 50% rename from packages/package_info_plus/package_info_plus_windows/test/package_info_plus_windows_test.dart rename to packages/package_info_plus/package_info_plus/test/package_info_plus_windows_test.dart index 416d48f9b0..47425b31d0 100644 --- a/packages/package_info_plus/package_info_plus_windows/test/package_info_plus_windows_test.dart +++ b/packages/package_info_plus/package_info_plus/test/package_info_plus_windows_test.dart @@ -1,10 +1,10 @@ import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/src/package_info_plus_windows.dart'; import 'package:package_info_plus_platform_interface/package_info_platform_interface.dart'; -import 'package:package_info_plus_windows/src/package_info_plus_windows.dart'; void main() { test('registered instance', () { - PackageInfoWindows.registerWith(); - expect(PackageInfoPlatform.instance, isA()); + PackageInfoPlusWindowsPlugin.registerWith(); + expect(PackageInfoPlatform.instance, isA()); }); } diff --git a/packages/package_info_plus/package_info_plus_linux/.gitignore b/packages/package_info_plus/package_info_plus_linux/.gitignore deleted file mode 100644 index e9dc58d3d6..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.dart_tool/ - -.packages -.pub/ - -build/ diff --git a/packages/package_info_plus/package_info_plus_linux/.metadata b/packages/package_info_plus/package_info_plus_linux/.metadata deleted file mode 100644 index fd128294d1..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: be6f496e463b995c36d49fd509cff1fc8652402a - channel: unknown - -project_type: plugin diff --git a/packages/package_info_plus/package_info_plus_linux/CHANGELOG.md b/packages/package_info_plus/package_info_plus_linux/CHANGELOG.md deleted file mode 100644 index b3580c4d3c..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -## 2.0.0 - - - Update a dependency to the latest release. - -## 1.0.5 - -- Resolve package_name - -## 1.0.4 - -- Fix MissingPluginException - -## 1.0.3 -- Add `buildSignature` to Android package info to retrieve the signing certifiate SHA1 at runtime. - -## 1.0.2 - -- Fix async loading: #247 - -## 1.0.1 - -- Improve documentation - -## 1.0.0 - -- Migrate to null-safety -- Update dependencies -- Fix dart SDK constraints - -## 0.1.1 - -- Fix platform interface dependency version - -## [0.1.0] - -- Initial version for Linux. diff --git a/packages/package_info_plus/package_info_plus_linux/LICENSE b/packages/package_info_plus/package_info_plus_linux/LICENSE deleted file mode 100644 index 0c91662b3f..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/package_info_plus/package_info_plus_linux/README.md b/packages/package_info_plus/package_info_plus_linux/README.md deleted file mode 100644 index 5504349a2e..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Package Info Plus Linux - -[![Flutter Community: package_info_plus_linux](https://fluttercommunity.dev/_github/header/package_info_plus_linux)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/package_info_plus_linux.svg)](https://pub.dev/packages/package_info_plus_linux) - -The Linux implementation of [`package_info_plus`](https://pub.dev/packages/package_info_plus). - -## Usage - -This package is already included as part of the `package_info_plus` package dependency, and will -be included when using `package_info_plus` as normal. diff --git a/packages/package_info_plus/package_info_plus_linux/lib/package_info_plus_linux.dart b/packages/package_info_plus/package_info_plus_linux/lib/package_info_plus_linux.dart deleted file mode 100644 index 6fe2d17dd2..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/lib/package_info_plus_linux.dart +++ /dev/null @@ -1,4 +0,0 @@ -/// The Linux implementation of `package_info_plus`. -library package_info_plus_linux; - -export 'src/package_info.dart'; diff --git a/packages/package_info_plus/package_info_plus_linux/pubspec.yaml b/packages/package_info_plus/package_info_plus_linux/pubspec.yaml deleted file mode 100644 index db44274d2c..0000000000 --- a/packages/package_info_plus/package_info_plus_linux/pubspec.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: package_info_plus_linux -description: Linux implementation of the package_info_plus plugin -version: 2.0.0 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - package_info_plus_platform_interface: ^2.0.0 - flutter: - sdk: flutter - path: ^1.8.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ">=1.0.4 <3.0.0" - -flutter: - plugin: - implements: package_info_plus - platforms: - linux: - dartPluginClass: PackageInfoLinux - pluginClass: none diff --git a/packages/package_info_plus/package_info_plus_macos/CHANGELOG.md b/packages/package_info_plus/package_info_plus_macos/CHANGELOG.md deleted file mode 100644 index ea9610f1bc..0000000000 --- a/packages/package_info_plus/package_info_plus_macos/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -## 2.0.0 - -> Note: This release has breaking changes. - - - **BREAKING** **FEAT**: Add information about the installer store (#1135). - -## 1.3.0 - -- Removed `Reachability` dependency - -## 1.2.0 - -- fix app name on macOS - -## 1.1.1 - -- Improve documentation - -## 1.1.0 - -- Renamed plugin class to avoid collision with package_info - -## 1.0.0 - -- Migrate to null-safety -- Update dependencies -- Fix dart SDK constraints - -## 0.2.0 - -- Changed method channel name - -## 0.1.0 - -- Transfer to plus-plugins monorepo - -# 0.0.1 - -- Initial release. diff --git a/packages/package_info_plus/package_info_plus_macos/LICENSE b/packages/package_info_plus/package_info_plus_macos/LICENSE deleted file mode 100644 index 758c714fad..0000000000 --- a/packages/package_info_plus/package_info_plus_macos/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright 2019 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/package_info_plus/package_info_plus_macos/README.md b/packages/package_info_plus/package_info_plus_macos/README.md deleted file mode 100644 index aa1a12b289..0000000000 --- a/packages/package_info_plus/package_info_plus_macos/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Package Info Plus macOS - -[![Flutter Community: package_info_plus_macos](https://fluttercommunity.dev/_github/header/package_info_plus_macos)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/package_info_plus_macos.svg)](https://pub.dev/packages/package_info_plus_macos) - -The macOS implementation of [`package_info_plus`](https://pub.dev/packages/package_info_plus). - -## Usage - -This package is already included as part of the `package_info_plus` package dependency, and will -be included when using `package_info_plus` as normal. diff --git a/packages/package_info_plus/package_info_plus_macos/macos/package_info_plus_macos.podspec b/packages/package_info_plus/package_info_plus_macos/macos/package_info_plus_macos.podspec deleted file mode 100644 index d6bc24161c..0000000000 --- a/packages/package_info_plus/package_info_plus_macos/macos/package_info_plus_macos.podspec +++ /dev/null @@ -1,20 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'package_info_plus_macos' - s.version = '0.0.1' - s.summary = 'Flutter Package Info' - s.description = <<-DESC - A macOS implementation of the package_info_plus plugin. - DESC - s.homepage = 'https://github.com/fluttercommunity/package_info_plus/tree/main/package_info_plus/package_info_plus_macos' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Community' => 'authors@fluttercommunity.dev' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'FlutterMacOS' - s.platform = :osx, '10.11' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } -end diff --git a/packages/package_info_plus/package_info_plus_macos/pubspec.yaml b/packages/package_info_plus/package_info_plus_macos/pubspec.yaml deleted file mode 100644 index 2ffb13355a..0000000000 --- a/packages/package_info_plus/package_info_plus_macos/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: package_info_plus_macos -description: macOS implementation of the package_info_plus plugin. -version: 2.0.0 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -flutter: - plugin: - platforms: - macos: - pluginClass: FLTPackageInfoPlusPlugin - fileName: package_info_plus_macos.dart - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - flutter: - sdk: flutter diff --git a/packages/package_info_plus/package_info_plus_web/CHANGELOG.md b/packages/package_info_plus/package_info_plus_web/CHANGELOG.md deleted file mode 100644 index 79aad0aa79..0000000000 --- a/packages/package_info_plus/package_info_plus_web/CHANGELOG.md +++ /dev/null @@ -1,50 +0,0 @@ -## 2.0.0 - -> Note: This release has breaking changes. - - - **BREAKING** **FEAT**: Add information about the installer store (#1135). - -## 1.0.6 - -- Add support for chrome extensions - -## 1.0.5 - -- Resolve package_name - -## 1.0.4 - -- Fixed url resolving for the version.json - -## 1.0.3 -- Add `buildSignature` to Android package info to retrieve the signing certifiate SHA1 at runtime. - -## 1.0.2 - -- Add cache buster to version.json - -## 1.0.1 - -- Improve documentation - -## 1.0.0 - -- Migrate to null-safety -- Update dependencies -- Fix dart SDK constraints - -## 0.2.1 - -- Fix base URI resolving - -## 0.2.0 - -- Use interface plugin 0.3.0 - -## 0.1.0 - -- Transfer to plus-plugins monorepo - -## 0.0.1 - -- Initial release. diff --git a/packages/package_info_plus/package_info_plus_web/LICENSE b/packages/package_info_plus/package_info_plus_web/LICENSE deleted file mode 100644 index 2af62a93a3..0000000000 --- a/packages/package_info_plus/package_info_plus_web/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ - - -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/package_info_plus/package_info_plus_web/README.md b/packages/package_info_plus/package_info_plus_web/README.md deleted file mode 100644 index 6df1a8da9c..0000000000 --- a/packages/package_info_plus/package_info_plus_web/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Package Info Plus Web - -[![Flutter Community: package_info_plus_web](https://fluttercommunity.dev/_github/header/package_info_plus_web)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/package_info_plus_web.svg)](https://pub.dev/packages/package_info_plus_web) - -The Web implementation of [`package_info_plus`](https://pub.dev/packages/package_info_plus). - -## Usage - -This package is already included as part of the `package_info_plus` package dependency, and will -be included when using `package_info_plus` as normal. diff --git a/packages/package_info_plus/package_info_plus_web/pubspec.yaml b/packages/package_info_plus/package_info_plus_web/pubspec.yaml deleted file mode 100644 index 0bc9124834..0000000000 --- a/packages/package_info_plus/package_info_plus_web/pubspec.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: package_info_plus_web -description: Web platform implementation of package_info_plus -version: 2.0.0 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -flutter: - plugin: - platforms: - web: - pluginClass: PackageInfoPlugin - fileName: package_info_plus_web.dart - -dependencies: - flutter: - sdk: flutter - flutter_web_plugins: - sdk: flutter - http: ^0.13.0 - meta: ^1.3.0 - package_info_plus_platform_interface: ^2.0.0 -dev_dependencies: - flutter_test: - sdk: flutter - mockito: ^5.0.7 - build_runner: ^2.0.3 - flutter_lints: ">=1.0.4 <3.0.0" - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" diff --git a/packages/package_info_plus/package_info_plus_windows/.gitignore b/packages/package_info_plus/package_info_plus_windows/.gitignore deleted file mode 100644 index 1985397a2c..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/.gitignore +++ /dev/null @@ -1,74 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Flutter.podspec -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/Flutter/flutter_export_environment.sh -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 diff --git a/packages/package_info_plus/package_info_plus_windows/.metadata b/packages/package_info_plus/package_info_plus_windows/.metadata deleted file mode 100644 index 7e57c5f4a3..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: ec40df9576d6020dd56820b9b5aff8f828706e49 - channel: master - -project_type: package diff --git a/packages/package_info_plus/package_info_plus_windows/CHANGELOG.md b/packages/package_info_plus/package_info_plus_windows/CHANGELOG.md deleted file mode 100644 index 772215be75..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/CHANGELOG.md +++ /dev/null @@ -1,48 +0,0 @@ -## 3.0.0 - - - Update a dependency to the latest release. - -## 2.1.0 - -- Allow win32 3.x to be used. - -## 2.0.0 - -- **Breaking change**. Bump minimum dart version to 2.17.0. -- Updated ffi to 2.0.1. -- Updated win32 to 2.7.0. -- Updated flutter_lints to 2.0.1. - -## 1.0.5 - -- Fix MissingPluginException - -## 1.0.4 - -- Annotate int with external in preparation of Flutter 2.5 - -## 1.0.3 - -- Add `buildSignature` to Android package info to retrieve the signing certifiate SHA1 at runtime. - -## 1.0.2 - -- Remove trailing null characters - -## 1.0.1 - -- Improve documentation - -## 1.0.0 - -- Migrate to null-safety -- Update dependencies -- Fix dart SDK constraints - -## [0.2.0] - -- Use interface plugin 0.3.0 - -## [0.1.0] - -- Initial version for Windows. diff --git a/packages/package_info_plus/package_info_plus_windows/LICENSE b/packages/package_info_plus/package_info_plus_windows/LICENSE deleted file mode 100644 index 0c91662b3f..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/package_info_plus/package_info_plus_windows/README.md b/packages/package_info_plus/package_info_plus_windows/README.md deleted file mode 100644 index 5de64d4c60..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Package Info Plus Windows - -[![Flutter Community: package_info_plus_windows](https://fluttercommunity.dev/_github/header/package_info_plus_windows)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/package_info_plus_windows.svg)](https://pub.dev/packages/package_info_plus_windows) - -The Windows implementation of [`package_info_plus`](https://pub.dev/packages/package_info_plus). - -## Usage - -This package is already included as part of the `package_info_plus` package dependency, and will -be included when using `package_info_plus` as normal. diff --git a/packages/package_info_plus/package_info_plus_windows/lib/package_info_plus_windows.dart b/packages/package_info_plus/package_info_plus_windows/lib/package_info_plus_windows.dart deleted file mode 100644 index b94dd62f82..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/lib/package_info_plus_windows.dart +++ /dev/null @@ -1 +0,0 @@ -export 'src/package_info_plus_windows.dart'; diff --git a/packages/package_info_plus/package_info_plus_windows/pubspec.yaml b/packages/package_info_plus/package_info_plus_windows/pubspec.yaml deleted file mode 100644 index e19437a48b..0000000000 --- a/packages/package_info_plus/package_info_plus_windows/pubspec.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: package_info_plus_windows -description: Windows implementation of the package_info_plus plugin -version: 3.0.0 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - package_info_plus_platform_interface: ^2.0.0 - ffi: ^2.0.1 - flutter: - sdk: flutter - win32: ">=2.7.0 <4.0.0" - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - -flutter: - plugin: - implements: package_info_plus - platforms: - windows: - dartPluginClass: PackageInfoWindows - pluginClass: none From 4fe86a84e8ecf38109aaa0c38ecac8e7054be2df Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:23:37 +0200 Subject: [PATCH 2/3] melos run format --- .../example/windows/runner/flutter_window.cpp | 8 +- .../example/windows/runner/flutter_window.h | 10 +- .../example/windows/runner/main.cpp | 3 +- .../example/windows/runner/resource.h | 10 +- .../example/windows/runner/utils.cpp | 13 +-- .../example/windows/runner/utils.h | 4 +- .../example/windows/runner/win32_window.cpp | 110 ++++++++---------- .../example/windows/runner/win32_window.h | 21 ++-- .../lib/package_info_plus.dart | 3 +- .../lib/src/package_info_plus_web.dart | 4 +- .../test/package_info_plus_web_test.dart | 18 ++- 11 files changed, 100 insertions(+), 104 deletions(-) diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.cpp b/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.cpp index b43b9095ea..edfe54e14e 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.cpp +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.cpp @@ -4,7 +4,7 @@ #include "flutter/generated_plugin_registrant.h" -FlutterWindow::FlutterWindow(const flutter::DartProject& project) +FlutterWindow::FlutterWindow(const flutter::DartProject &project) : project_(project) {} FlutterWindow::~FlutterWindow() {} @@ -52,9 +52,9 @@ FlutterWindow::MessageHandler(HWND hwnd, UINT const message, } switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; } return Win32Window::MessageHandler(hwnd, message, wparam, lparam); diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.h b/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.h index 6da0652f05..7fa026bf24 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.h +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.h @@ -10,19 +10,19 @@ // A window that does nothing but host a Flutter view. class FlutterWindow : public Win32Window { - public: +public: // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); + explicit FlutterWindow(const flutter::DartProject &project); virtual ~FlutterWindow(); - protected: +protected: // Win32Window: bool OnCreate() override; void OnDestroy() override; LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept override; - private: +private: // The project to run. flutter::DartProject project_; @@ -30,4 +30,4 @@ class FlutterWindow : public Win32Window { std::unique_ptr flutter_controller_; }; -#endif // RUNNER_FLUTTER_WINDOW_H_ +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/main.cpp b/packages/package_info_plus/package_info_plus/example/windows/runner/main.cpp index bcb57b0e2a..261f186935 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/main.cpp +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/main.cpp @@ -19,8 +19,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, flutter::DartProject project(L"data"); - std::vector command_line_arguments = - GetCommandLineArguments(); + std::vector command_line_arguments = GetCommandLineArguments(); project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/resource.h b/packages/package_info_plus/package_info_plus/example/windows/runner/resource.h index 66a65d1e4a..d5d958dc42 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/resource.h +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/resource.h @@ -2,15 +2,15 @@ // Microsoft Visual C++ generated include file. // Used by Runner.rc // -#define IDI_APP_ICON 101 +#define IDI_APP_ICON 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/utils.cpp b/packages/package_info_plus/package_info_plus/example/windows/runner/utils.cpp index f5bf9fa0f5..739b61f203 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/utils.cpp +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/utils.cpp @@ -24,7 +24,7 @@ void CreateAndAttachConsole() { std::vector GetCommandLineArguments() { // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + wchar_t **argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); if (argv == nullptr) { return std::vector(); } @@ -41,21 +41,20 @@ std::vector GetCommandLineArguments() { return command_line_arguments; } -std::string Utf8FromUtf16(const wchar_t* utf16_string) { +std::string Utf8FromUtf16(const wchar_t *utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr); + int target_length = + ::WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, + nullptr, 0, nullptr, nullptr); std::string utf8_string; if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, utf8_string.data(), + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, utf8_string.data(), target_length, nullptr, nullptr); if (converted_length == 0) { return std::string(); diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/utils.h b/packages/package_info_plus/package_info_plus/example/windows/runner/utils.h index 3879d54755..ff43ce2ce5 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/utils.h +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/utils.h @@ -10,10 +10,10 @@ void CreateAndAttachConsole(); // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string // encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); +std::string Utf8FromUtf16(const wchar_t *utf16_string); // Gets the command line arguments passed in as a std::vector, // encoded in UTF-8. Returns an empty std::vector on failure. std::vector GetCommandLineArguments(); -#endif // RUNNER_UTILS_H_ +#endif // RUNNER_UTILS_H_ diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.cpp b/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.cpp index c10f08dc7d..90ff01e592 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.cpp +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.cpp @@ -27,7 +27,7 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { return; } auto enable_non_client_dpi_scaling = - reinterpret_cast( + reinterpret_cast( GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); @@ -35,15 +35,15 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { } } -} // namespace +} // namespace // Manages the Win32Window's window class registration. class WindowClassRegistrar { - public: +public: ~WindowClassRegistrar() = default; // Returns the singleton registar instance. - static WindowClassRegistrar* GetInstance() { + static WindowClassRegistrar *GetInstance() { if (!instance_) { instance_ = new WindowClassRegistrar(); } @@ -52,23 +52,23 @@ class WindowClassRegistrar { // Returns the name of the window class, registering the class if it hasn't // previously been registered. - const wchar_t* GetWindowClass(); + const wchar_t *GetWindowClass(); // Unregisters the window class. Should only be called if there are no // instances of the window. void UnregisterWindowClass(); - private: +private: WindowClassRegistrar() = default; - static WindowClassRegistrar* instance_; + static WindowClassRegistrar *instance_; bool class_registered_ = false; }; -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; +WindowClassRegistrar *WindowClassRegistrar::instance_ = nullptr; -const wchar_t* WindowClassRegistrar::GetWindowClass() { +const wchar_t *WindowClassRegistrar::GetWindowClass() { if (!class_registered_) { WNDCLASS window_class{}; window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); @@ -93,21 +93,18 @@ void WindowClassRegistrar::UnregisterWindowClass() { class_registered_ = false; } -Win32Window::Win32Window() { - ++g_active_window_count; -} +Win32Window::Win32Window() { ++g_active_window_count; } Win32Window::~Win32Window() { --g_active_window_count; Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::CreateAndShow(const std::wstring &title, const Point &origin, + const Size &size) { Destroy(); - const wchar_t* window_class = + const wchar_t *window_class = WindowClassRegistrar::GetInstance()->GetWindowClass(); const POINT target_point = {static_cast(origin.x), @@ -130,19 +127,18 @@ bool Win32Window::CreateAndShow(const std::wstring& title, } // static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, +LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); + auto window_struct = reinterpret_cast(lparam); SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast(window_struct->lpCreateParams)); - auto that = static_cast(window_struct->lpCreateParams); + auto that = static_cast(window_struct->lpCreateParams); EnableFullDpiSupportIfAvailable(window); that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { + } else if (Win32Window *that = GetThisFromHandle(window)) { return that->MessageHandler(window, message, wparam, lparam); } @@ -150,44 +146,42 @@ LRESULT CALLBACK Win32Window::WndProc(HWND const window, } LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, +Win32Window::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); } + return 0; + } - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -205,8 +199,8 @@ void Win32Window::Destroy() { } } -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( +Win32Window *Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( GetWindowLongPtr(window, GWLP_USERDATA)); } @@ -227,9 +221,7 @@ RECT Win32Window::GetClientArea() { return frame; } -HWND Win32Window::GetHandle() { - return window_handle_; -} +HWND Win32Window::GetHandle() { return window_handle_; } void Win32Window::SetQuitOnClose(bool quit_on_close) { quit_on_close_ = quit_on_close; diff --git a/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.h b/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.h index 17ba431125..7b518125bb 100644 --- a/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.h +++ b/packages/package_info_plus/package_info_plus/example/windows/runner/win32_window.h @@ -11,7 +11,7 @@ // inherited from by classes that wish to specialize with custom // rendering and input handling class Win32Window { - public: +public: struct Point { unsigned int x; unsigned int y; @@ -34,9 +34,8 @@ class Win32Window { // consistent size to will treat the width height passed in to this function // as logical pixels and scale to appropriate for the default monitor. Returns // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + bool CreateAndShow(const std::wstring &title, const Point &origin, + const Size &size); // Release OS resources associated with window. void Destroy(); @@ -54,12 +53,11 @@ class Win32Window { // Return a RECT representing the bounds of the current client area. RECT GetClientArea(); - protected: +protected: // Processes and route salient window messages for mouse handling, // size change and DPI. Delegates handling of these to member overloads that // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, + virtual LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; @@ -70,7 +68,7 @@ class Win32Window { // Called when Destroy is called. virtual void OnDestroy(); - private: +private: friend class WindowClassRegistrar; // OS callback called by message pump. Handles the WM_NCCREATE message which @@ -78,13 +76,12 @@ class Win32Window { // non-client DPI scaling so that the non-client area automatically // responsponds to changes in DPI. All other messages are handled by // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, + static LRESULT CALLBACK WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; + static Win32Window *GetThisFromHandle(HWND const window) noexcept; bool quit_on_close_ = false; @@ -95,4 +92,4 @@ class Win32Window { HWND child_content_ = nullptr; }; -#endif // RUNNER_WIN32_WINDOW_H_ +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart b/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart index 53f29952f0..a70c1e98ff 100644 --- a/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart +++ b/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart @@ -8,7 +8,8 @@ import 'package:flutter/foundation.dart' show visibleForTesting; import 'package:package_info_plus_platform_interface/package_info_platform_interface.dart'; export 'src/package_info_plus_linux.dart'; -export 'src/package_info_plus_windows.dart' if (dart.library.html) 'src/package_info_plus_web.dart'; +export 'src/package_info_plus_windows.dart' + if (dart.library.html) 'src/package_info_plus_web.dart'; /// Application metadata. Provides application bundle information on iOS and /// application package information on Android. diff --git a/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart index b6d598936a..ac6a38a1b6 100644 --- a/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart @@ -25,7 +25,9 @@ class PackageInfoPlusWebPlugin extends PackageInfoPlatform { final baseUri = Uri.parse(baseUrl); final originPath = '${baseUri._origin}${baseUri.path}'; final versionJson = 'version.json?cachebuster=$cacheBuster'; - return Uri.parse(originPath.endsWith('/') ? '$originPath$versionJson' : '$originPath/$versionJson'); + return Uri.parse(originPath.endsWith('/') + ? '$originPath$versionJson' + : '$originPath/$versionJson'); } @override diff --git a/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart index cf20979c9d..b50071e556 100644 --- a/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart +++ b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart @@ -85,15 +85,18 @@ void main() { Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl('https://example.com/?hello_world=true#/my-page', 1), + plugin.versionJsonUrl( + 'https://example.com/?hello_world=true#/my-page', 1), Uri.parse('https://example.com/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl('https://example.com/a/b/c/?hello_world=true#/my-page', 1), + plugin.versionJsonUrl( + 'https://example.com/a/b/c/?hello_world=true#/my-page', 1), Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl('https://example.com/a/b/c?hello_world=true#/my-page', 1), + plugin.versionJsonUrl( + 'https://example.com/a/b/c?hello_world=true#/my-page', 1), Uri.parse('https://example.com/a/b/c/version.json?cachebuster=1'), ); }, @@ -106,15 +109,18 @@ void main() { ); expect( plugin.versionJsonUrl('chrome-extension://abcdefgh/a/b/c', 1), - Uri.parse('chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), + Uri.parse( + 'chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), ); expect( plugin.versionJsonUrl('chrome-extension://abcdefgh/#my-page', 1), Uri.parse('chrome-extension://abcdefgh/version.json?cachebuster=1'), ); expect( - plugin.versionJsonUrl('chrome-extension://abcdefgh/a/b/c/#my-page', 1), - Uri.parse('chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), + plugin.versionJsonUrl( + 'chrome-extension://abcdefgh/a/b/c/#my-page', 1), + Uri.parse( + 'chrome-extension://abcdefgh/a/b/c/version.json?cachebuster=1'), ); }); }, From 11e93b3337c9d1547dcda28d359a6fd19e254801 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 14 Oct 2022 15:13:17 +0200 Subject: [PATCH 3/3] Disable web test --- .../test/package_info_plus_web_test.mocks.dart | 2 +- ...s_web_test.dart => package_info_plus_web_test_disabled.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/package_info_plus/package_info_plus/test/{package_info_plus_web_test.dart => package_info_plus_web_test_disabled.dart} (100%) diff --git a/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart index 7c8163a2e0..efa5d1051c 100644 --- a/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart +++ b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.0.14 from annotations -// in package_info_plus_web/test/package_info_plus_web_test.dart. +// in package_info_plus_web/test/package_info_plus_web_test_disabled.dart. // Do not manually edit this file. // ignore_for_file: camel_case_types, unnecessary_overrides diff --git a/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart b/packages/package_info_plus/package_info_plus/test/package_info_plus_web_test_disabled.dart similarity index 100% rename from packages/package_info_plus/package_info_plus/test/package_info_plus_web_test.dart rename to packages/package_info_plus/package_info_plus/test/package_info_plus_web_test_disabled.dart