diff --git a/README.md b/README.md index 9ac5ee47b79c394d9ea67c58667afb23c5429e0b..0c09782a92827ca1beea71cdd05522a077959279 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,15 @@ A repository showcasing my journey to mastering Flutter, including all my projec - [开发资料梳理](./Flutter%20开发资料整理.md) - [Flutter 踩坑记录](./Flutter%20踩坑注意.md) -## 常用命令整理 +### 常用命令整理 -```dart -# 创建ohos package项目 -flutter create --platforms ohos multi_entry_ohos +```shell +# 创建 package项目 +flutter create --platforms ohos,android,ios multi_entry_ohos + +# 创建 plugin 项目 +flutter create --platforms ohos,android,ios multi_entry_ohos --template=plugin + +# 添加平台支持(插件) +flutter create -t plugin --platforms ``` \ No newline at end of file diff --git a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/lib/main.dart b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/lib/main.dart index c087797531d21dbb3cf74aa2f2939201d5d6cf6e..38803ef9c2485d980b21d63dbade4713796e5f41 100644 --- a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/lib/main.dart +++ b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/lib/main.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'package:flutter/services.dart'; import 'package:flutter_background_service_ohos/flutter_background_service_ohos.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:device_info_plus/device_info_plus.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -35,8 +36,9 @@ Future initializeService() async { class _MyAppState extends State { String _platformVersion = 'Unknown'; + String _deviceInfo = 'Unknown'; final _flutterBackgroundServiceOhosPlugin = FlutterBackgroundServiceOhos(); - + final deviceInfo = DeviceInfoPlugin(); @override void initState() { super.initState(); @@ -46,14 +48,20 @@ class _MyAppState extends State { // Platform messages are asynchronous, so we initialize in an async method. Future initPlatformState() async { String platformVersion; + String deviceInfomation = ''; // Platform messages may fail, so we use a try/catch PlatformException. // We also handle the message potentially returning null. try { platformVersion = await _flutterBackgroundServiceOhosPlugin.getPlatformVersion() ?? 'Unknown platform version'; + if (Platform.isOhos) { + final info = await deviceInfo.ohosInfo; + deviceInfomation = info.marketName ?? 'Unknown'; + } } on PlatformException { platformVersion = 'Failed to get platform version.'; + _deviceInfo = 'Failed to get device info.'; } // If the widget was removed from the tree while the asynchronous platform @@ -63,6 +71,7 @@ class _MyAppState extends State { setState(() { _platformVersion = platformVersion; + _deviceInfo = deviceInfomation; }); } @@ -78,6 +87,7 @@ class _MyAppState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Running on: $_platformVersion\n'), + Text('Device Info: $_deviceInfo\n'), ElevatedButton( onPressed: () async { flutterLocalNotificationsPlugin.show( diff --git a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.lock b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.lock index 74d0053a78d04a2122c265c508efcce68591e1a7..4663cb12d09e15d1244b03a1fed311dd04a4926c 100644 --- a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.lock +++ b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.lock @@ -65,6 +65,23 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.7.11" + device_info_plus: + dependency: "direct main" + description: + path: "packages/device_info_plus/device_info_plus" + ref: "br_device_info_plus_v11.4.0_ohos" + resolved-ref: "03507cc39ab148fe9f5827cd991b3e04aed2bcc3" + url: "https://gitcode.com/openharmony-sig/flutter_plus_plugins.git" + source: git + version: "9.1.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.2" fake_async: dependency: transitive description: @@ -144,6 +161,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -343,6 +365,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.0.3" + win32: + dependency: transitive + description: + name: win32 + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.5.4" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.5" xdg_directories: dependency: transitive description: diff --git a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.yaml b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.yaml index 931b482bce658710ab5c0bcb3461a210c8fc5bde..c50395c86cae2effbaa5c26e7ae3f962ba242ebb 100644 --- a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.yaml +++ b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/pubspec.yaml @@ -23,8 +23,12 @@ dependencies: flutter_local_notifications: git: url: https://gitcode.com/openharmony-sig/fluttertpc_flutter_local_notifications.git - path: flutter_local_notifications - + path: flutter_local_notifications + device_info_plus: + git: + url: https://gitcode.com/openharmony-sig/flutter_plus_plugins.git + path: packages/device_info_plus/device_info_plus + ref: br_device_info_plus_v11.4.0_ohos dev_dependencies: integration_test: sdk: flutter diff --git a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/test/widget_test.dart b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/test/widget_test.dart index 954a23b49b26f9ca76c962ad8cd111d67dff0d93..ccb02216b869dd7bf21bbc95112b119f392b0f5d 100644 --- a/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/test/widget_test.dart +++ b/flutter_service/flutter_test_background_service/flutter_background_service_ohos/example/test/widget_test.dart @@ -1,27 +1,134 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_background_service_ohos/flutter_background_service_ohos.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:mockito/mockito.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +class MockFlutterBackgroundServiceOhos extends Mock + implements FlutterBackgroundServiceOhos {} -import 'package:flutter_background_service_ohos_example/main.dart'; +class MockFlutterLocalNotificationsPlugin extends Mock + implements FlutterLocalNotificationsPlugin {} void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data!.startsWith('Running on:'), + late MockFlutterBackgroundServiceOhos mockService; + late MockFlutterLocalNotificationsPlugin mockNotifications; + + setUp(() { + mockService = MockFlutterBackgroundServiceOhos(); + mockNotifications = MockFlutterLocalNotificationsPlugin(); + }); + + /// Test the initialization of the service. + testWidgets('Test service initialization', (WidgetTester tester) async { + when(mockService.getPlatformVersion()).thenAnswer((_) async => 'Ohos 10'); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Center( + child: Builder( + builder: (context) { + return ElevatedButton( + onPressed: () async { + await mockService.getPlatformVersion(); + }, + child: const Text('Get Platform Version'), + ); + }, + ), + ), + ), + ), + ); + + await tester.tap(find.byType(ElevatedButton)); + await tester.pump(); + + verify(mockService.getPlatformVersion()).called(1); + }); + + /// Test the notification functionality. + testWidgets('Test notification sending', (WidgetTester tester) async { + when(mockNotifications.show( + 888, + 'COOL SERVICE', + any, + any, + )).thenAnswer((_) async => true); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Center( + child: Builder( + builder: (context) { + return ElevatedButton( + onPressed: () async { + await mockNotifications.show( + 888, + 'COOL SERVICE', + 'Awesome ${DateTime.now()}', + const NotificationDetails( + ohos: OhosNotificationDetails( + OhosNotificationSlotType.SERVICE_INFORMATION, + icon: '', + ongoing: true, + ), + ), + ); + }, + child: const Text('Send Notification'), + ); + }, + ), + ), + ), ), - findsOneWidget, ); + + await tester.tap(find.byType(ElevatedButton)); + await tester.pump(); + + verify(mockNotifications.show( + 888, + 'COOL SERVICE', + any, + any, + )).called(1); + }); + + /// Test error handling for platform version retrieval. + testWidgets('Test platform version error handling', (WidgetTester tester) async { + when(mockService.getPlatformVersion()).thenThrow(PlatformException(code: 'ERROR')); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Center( + child: Builder( + builder: (context) { + return ElevatedButton( + onPressed: () async { + try { + await mockService.getPlatformVersion(); + } catch (e) { + // Handle error + } + }, + child: const Text('Get Platform Version'), + ); + }, + ), + ), + ), + ), + ); + + await tester.tap(find.byType(ElevatedButton)); + await tester.pump(); + + verify(mockService.getPlatformVersion()).called(1); }); -} +} \ No newline at end of file diff --git a/multi_entry_app/.gitignore b/multi_entry_app/.gitignore deleted file mode 100644 index 29a3a5017f048d6d8e6a450eef64435ddee44fb7..0000000000000000000000000000000000000000 --- a/multi_entry_app/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# 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/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/multi_entry_app/.metadata b/multi_entry_app/.metadata deleted file mode 100644 index 04e5767d8b1760b255c9d1718eb374d35870527b..0000000000000000000000000000000000000000 --- a/multi_entry_app/.metadata +++ /dev/null @@ -1,33 +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: "c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd" - channel: "[user-branch]" - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - - platform: android - create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - - platform: ohos - create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/multi_entry_app/README.md b/multi_entry_app/README.md deleted file mode 100644 index bbea1a40a6e7c9fe22966eb13e309f8138ab86b6..0000000000000000000000000000000000000000 --- a/multi_entry_app/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# multi_entry_app - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/multi_entry_app/analysis_options.yaml b/multi_entry_app/analysis_options.yaml deleted file mode 100644 index 0d2902135caece481a035652d88970c80e29cc7e..0000000000000000000000000000000000000000 --- a/multi_entry_app/analysis_options.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/multi_entry_app/android/.gitignore b/multi_entry_app/android/.gitignore deleted file mode 100644 index 6f568019d3c69d4966bb5a0f759980a1472afc1e..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/multi_entry_app/android/app/build.gradle b/multi_entry_app/android/app/build.gradle deleted file mode 100644 index b23a41b7d1280a4fcb669aefb07c200b39f75949..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file("local.properties") -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader("UTF-8") { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty("flutter.versionCode") -if (flutterVersionCode == null) { - flutterVersionCode = "1" -} - -def flutterVersionName = localProperties.getProperty("flutter.versionName") -if (flutterVersionName == null) { - flutterVersionName = "1.0" -} - -android { - namespace = "com.example.multi_entry_app" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.multi_entry_app" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutterVersionCode.toInteger() - versionName = flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug - } - } -} - -flutter { - source = "../.." -} diff --git a/multi_entry_app/android/app/src/debug/AndroidManifest.xml b/multi_entry_app/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 399f6981d5d35475eb18e6068ae67cdd7c731978..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/multi_entry_app/android/app/src/main/AndroidManifest.xml b/multi_entry_app/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 1c414650f65bfe8a15b9b2b0f8915c4069352e7c..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/multi_entry_app/android/app/src/main/kotlin/com/example/multi_entry_app/MainActivity.kt b/multi_entry_app/android/app/src/main/kotlin/com/example/multi_entry_app/MainActivity.kt deleted file mode 100644 index 78b6d16070d0b8cc54b46b556a5e1f25c814b9b6..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/kotlin/com/example/multi_entry_app/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.multi_entry_app - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() diff --git a/multi_entry_app/android/app/src/main/res/drawable-v21/launch_background.xml b/multi_entry_app/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f3f6a2b995f8ad1f9ff7b2c46dc118a9e0..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/multi_entry_app/android/app/src/main/res/drawable/launch_background.xml b/multi_entry_app/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f8842013497e14bd02f67a55f2614fb8f7..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/multi_entry_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/multi_entry_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/multi_entry_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/multi_entry_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/multi_entry_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/multi_entry_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be68e9e4a07fab769b5de337d16eb1..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/multi_entry_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/multi_entry_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/multi_entry_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/multi_entry_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/multi_entry_app/android/app/src/main/res/values-night/styles.xml b/multi_entry_app/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be745f9fa6fa75196e830d9578eb2ee631d..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/multi_entry_app/android/app/src/main/res/values/styles.xml b/multi_entry_app/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef88056edd1caf99a935e434e7ff6943a0ef6..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/multi_entry_app/android/app/src/profile/AndroidManifest.xml b/multi_entry_app/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 399f6981d5d35475eb18e6068ae67cdd7c731978..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/multi_entry_app/android/build.gradle b/multi_entry_app/android/build.gradle deleted file mode 100644 index d2ffbffa4cd251cc00b2b93a5efc2a0213460220..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = "../build" -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/multi_entry_app/android/gradle.properties b/multi_entry_app/android/gradle.properties deleted file mode 100644 index 3b5b324f6e3f162acfb54a7c423f4566fe04bae1..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError -android.useAndroidX=true -android.enableJetifier=true diff --git a/multi_entry_app/android/gradle/wrapper/gradle-wrapper.properties b/multi_entry_app/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e1ca574ef017c1bc00556b96ea372e2c07948771..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/multi_entry_app/android/settings.gradle b/multi_entry_app/android/settings.gradle deleted file mode 100644 index 536165d35a42ac4ce974f9cf7ac24a9ba0645acd..0000000000000000000000000000000000000000 --- a/multi_entry_app/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false -} - -include ":app" diff --git a/multi_entry_app/ohos/.gitignore b/multi_entry_app/ohos/.gitignore deleted file mode 100644 index e32649140581211002e81e849a2a04c93b605ebb..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -**/BuildProfile.ets -**/oh-package-lock.json5 -/package.json -/package-lock.json - -**/src/main/resources/rawfile/flutter_assets/ -**/libs/**/libapp.so -**/libs/**/libflutter.so -**/libs/**/libvmservice_snapshot.so diff --git a/multi_entry_app/ohos/AppScope/app.json5 b/multi_entry_app/ohos/AppScope/app.json5 deleted file mode 100644 index b55664e60105207223179d69f7736a6959b11e1f..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multi_entry_app", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/multi_entry_app/ohos/AppScope/resources/base/element/string.json b/multi_entry_app/ohos/AppScope/resources/base/element/string.json deleted file mode 100644 index d3cfdfd52960e1809e89652deebc572e1972ae07..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "multi_entry_app" - } - ] -} diff --git a/multi_entry_app/ohos/AppScope/resources/base/media/app_icon.png b/multi_entry_app/ohos/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/ohos/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/multi_entry_app/ohos/build-profile.json5 b/multi_entry_app/ohos/build-profile.json5 deleted file mode 100644 index 1c112b1a1be6ba7c138b690f189bccbd427c9e64..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/build-profile.json5 +++ /dev/null @@ -1,39 +0,0 @@ - -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "5.1.0(18)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "profile" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/.gitignore b/multi_entry_app/ohos/entry/.gitignore deleted file mode 100644 index 5254b880d9bc9c95f2c95e46a958845bdc3ab470..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test -GeneratedPluginRegistrant.ets \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/build-profile.json5 b/multi_entry_app/ohos/entry/build-profile.json5 deleted file mode 100644 index 6de31ee2243926392c90c572c00a052f7c3fa9e9..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/build-profile.json5 +++ /dev/null @@ -1,15 +0,0 @@ - -{ - "apiType": 'stageMode', - "buildOption": { - }, - "targets": [ - { - "name": "default", - "runtimeOS": "HarmonyOS" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/hvigorfile.ts b/multi_entry_app/ohos/entry/hvigorfile.ts deleted file mode 100644 index ff3bfe082b896f58e6c5001262ef90ae7fe90093..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/hvigorfile.ts +++ /dev/null @@ -1,7 +0,0 @@ - -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -import { hapTasks } from '@ohos/hvigor-ohos-plugin'; -export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/multi_entry_app/ohos/entry/oh-package.json5 b/multi_entry_app/ohos/entry/oh-package.json5 deleted file mode 100644 index 854eec208da5f8dccfe8c2ff41b1d9d856059f97..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/oh-package.json5 +++ /dev/null @@ -1,11 +0,0 @@ - -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {}, -} - diff --git a/multi_entry_app/ohos/entry/src/main/ets/entryability/EntryAbility.ets b/multi_entry_app/ohos/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index f85a65508a6140721404097998b77be622c93d5d..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,10 +0,0 @@ - -import { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos'; -import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant'; - -export default class EntryAbility extends FlutterAbility { - configureFlutterEngine(flutterEngine: FlutterEngine) { - super.configureFlutterEngine(flutterEngine) - GeneratedPluginRegistrant.registerWith(flutterEngine) - } -} diff --git a/multi_entry_app/ohos/entry/src/main/ets/pages/Index.ets b/multi_entry_app/ohos/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 7bb6543fe7ad7539f0167c4fbf56113e101662a1..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,24 +0,0 @@ - -import common from '@ohos.app.ability.common'; -import { FlutterPage } from '@ohos/flutter_ohos' - -let storage = LocalStorage.getShared() -const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS' - -@Entry(storage) -@Component -struct Index { - private context = getContext(this) as common.UIAbilityContext - @LocalStorageLink('viewId') viewId: string = ""; - - build() { - Column() { - FlutterPage({ viewId: this.viewId }) - } - } - - onBackPress(): boolean { - this.context.eventHub.emit(EVENT_BACK_PRESS) - return true - } -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/module.json5 b/multi_entry_app/ohos/entry/src/main/module.json5 deleted file mode 100644 index 5bd7950ba5343abd89b475921bca8bbbacd3629c..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/module.json5 +++ /dev/null @@ -1,40 +0,0 @@ - -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - {"name" : "ohos.permission.INTERNET"}, - ] - } -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/resources/base/element/color.json b/multi_entry_app/ohos/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/resources/base/element/string.json b/multi_entry_app/ohos/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 016448bfb320fc5015e48953ad83945f56d9b6ab..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "multi_entry_app" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/resources/base/media/icon.png b/multi_entry_app/ohos/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/ohos/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multi_entry_app/ohos/entry/src/main/resources/base/profile/buildinfo.json5 b/multi_entry_app/ohos/entry/src/main/resources/base/profile/buildinfo.json5 deleted file mode 100644 index 6125c99c00f88253e2c22ea2e8f45bbadbd56675..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/base/profile/buildinfo.json5 +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "enable_impeller", - "value": "true" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/resources/base/profile/main_pages.json b/multi_entry_app/ohos/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/multi_entry_app/ohos/entry/src/main/resources/en_US/element/string.json b/multi_entry_app/ohos/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 016448bfb320fc5015e48953ad83945f56d9b6ab..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "multi_entry_app" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/main/resources/zh_CN/element/string.json b/multi_entry_app/ohos/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index f7f888ee8a3b79bc90eee0e81ff2f44166edf710..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "multi_entry_app" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/ets/test/Ability.test.ets b/multi_entry_app/ohos/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 8abf7f2f44c0e56110df8c09b2524a4ca37bc993..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import hilog from '@ohos.hilog'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function abilityTest() { - describe('ActsAbilityTest', function () { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(function () { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(function () { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(function () { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(function () { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain',0, function () { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc' - let b = 'b' - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) - }) -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/ets/test/List.test.ets b/multi_entry_app/ohos/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index d766fe249dfc3ada636f27e64d9b64451ce32c93..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets b/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index e3f6e911d3fffba1e1795c60ed1ee4db15b386fd..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; - -export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets b/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 545843d3949e383b7bdd6ebbf5681d28c3e6ef71..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,36 +0,0 @@ - - -import hilog from '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/multi_entry_app/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 47fc89b4f05bf2efc6e863b8c2569705a4c56fd9..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,50 +0,0 @@ - -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/module.json5 b/multi_entry_app/ohos/entry/src/ohosTest/module.json5 deleted file mode 100644 index 3b02a75a22d44e7ed129f102197a3050a8f922be..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,37 +0,0 @@ - -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/color.json b/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/string.json b/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/media/icon.png b/multi_entry_app/ohos/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json b/multi_entry_app/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/multi_entry_app/ohos/hvigor/hvigor-config.json5 b/multi_entry_app/ohos/hvigor/hvigor-config.json5 deleted file mode 100644 index ad3ecab4a02b30749e4ead70ed4970c7d237a9d6..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,6 +0,0 @@ - -{ - "modelVersion": "5.1.0", - "dependencies": { - } -} \ No newline at end of file diff --git a/multi_entry_app/ohos/hvigorconfig.ts b/multi_entry_app/ohos/hvigorconfig.ts deleted file mode 100644 index fc2b208637340e3f7956671c0bf108ae4deb43d1..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/hvigorconfig.ts +++ /dev/null @@ -1,4 +0,0 @@ -import path from 'path' -import { injectNativeModules } from 'flutter-hvigor-plugin'; - -injectNativeModules(__dirname, path.dirname(__dirname)) \ No newline at end of file diff --git a/multi_entry_app/ohos/hvigorfile.ts b/multi_entry_app/ohos/hvigorfile.ts deleted file mode 100644 index a64db460c843b13700bd56d79a4f2e208350d22a..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/hvigorfile.ts +++ /dev/null @@ -1,8 +0,0 @@ -import path from 'path' -import { appTasks } from '@ohos/hvigor-ohos-plugin'; -import { flutterHvigorPlugin } from 'flutter-hvigor-plugin'; - -export default { - system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[flutterHvigorPlugin(path.dirname(__dirname))] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/multi_entry_app/ohos/oh-package.json5 b/multi_entry_app/ohos/oh-package.json5 deleted file mode 100644 index ce4f9fa472adc47a3502c1ba4457c2231ad7477e..0000000000000000000000000000000000000000 --- a/multi_entry_app/ohos/oh-package.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "modelVersion": "5.1.0", - "name": "multi_entry_app", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {}, - "devDependencies": { - "@ohos/hypium": "1.0.6" - } -} diff --git a/multi_entry_app/pubspec.lock b/multi_entry_app/pubspec.lock deleted file mode 100644 index 14834415c6d10f6e74f87912e1245ac3f1bd4dcb..0000000000000000000000000000000000000000 --- a/multi_entry_app/pubspec.lock +++ /dev/null @@ -1,370 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.18.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.8" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.3" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.flutter-io.cn" - source: hosted - version: "7.0.1" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.3" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" - url: "https://pub.flutter-io.cn" - source: hosted - version: "10.0.4" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.0.3" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.0.1" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.8.0" - meta: - dependency: transitive - description: - name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.12.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.9.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.5" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.2.10" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.1" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.3.0" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.1.6" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.8" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.3.3" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.3.2" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.5.4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.1" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.1" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.3" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.2" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.7.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" - url: "https://pub.flutter-io.cn" - source: hosted - version: "14.2.1" - web: - dependency: transitive - description: - name: web - sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.0" -sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" diff --git a/multi_entry_app/pubspec.yaml b/multi_entry_app/pubspec.yaml deleted file mode 100644 index deed80296e4c5a2957b808281eb35c645cfedce1..0000000000000000000000000000000000000000 --- a/multi_entry_app/pubspec.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: multi_entry_app -description: Flutter多入口应用示例,包含主入口和后台服务入口 -publish_to: 'none' -version: 1.0.0+1 - -environment: - sdk: '>=3.0.0 <4.0.0' - -dependencies: - flutter: - sdk: flutter - cupertino_icons: ^1.0.5 - shared_preferences: - git: - url: https://gitcode.com/openharmony-tpc/flutter_packages.git - path: packages/shared_preferences/shared_preferences - - path_provider: - git: - url: https://gitcode.com/openharmony-tpc/flutter_packages.git - path: packages/path_provider/path_provider - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.2 - -flutter: - uses-material-design: true \ No newline at end of file diff --git a/multi_entry_app/test/widget_test.dart b/multi_entry_app/test/widget_test.dart deleted file mode 100644 index 401c81f9998d623975dba1ce712d3aedfef6879d..0000000000000000000000000000000000000000 --- a/multi_entry_app/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:multi_entry_app/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}