From 215f288425c63ffbc15d50fedbcc2fffa981a126 Mon Sep 17 00:00:00 2001 From: 13296578220 <542689970@qq.com> Date: Wed, 28 Aug 2024 16:52:58 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 13296578220 <542689970@qq.com> --- README.en.md | 5 ++++- README.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index 114ad9ac67..5d38bd66ea 100644 --- a/README.en.md +++ b/README.en.md @@ -121,6 +121,9 @@ This repository is a compatible extension of Flutter SDK for the OpenHarmony pla | run | application run | flutter run [--local-engine=\] | | attach | debug mode | flutter attach | | screenshot | screenshot | flutter screenshot | +| pub | download dependency | flutter pub get | +| clean | clear dependency | flutter clean | +| cache| clear global cache data | flutter pub cache clean | Attachment: [Flutter third-party library adaptation plan](https://docs.qq.com/sheet/DVVJDWWt1V09zUFN2) @@ -210,7 +213,7 @@ Attachment: [Flutter third-party library adaptation plan](https://docs.qq.com/sh ``` 14. If `flutter pub cache clean` is executed normally, `flutter clean` will report an error. If update command is executed according to the error message, it has no effect。 - 1. Solution:To avoid this problem, comment out the configuration in the build.json5 file。 + 1. Solution:To avoid this problem, comment out the configuration in the build.json5 file: "modules":[{ //The first object of the array is reserved }, { //The rest of the objects need comments }] 2. Error message: ``` #Parse ohos module. json5 error: Exception: Can not found module.json5 at diff --git a/README.md b/README.md index 7f294dbd41..3500bf3003 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,9 @@ Flutter SDK 仓库 | run | 应用运行 | flutter run [--local-engine=\<兼容ohos的engine产物路径\>] | | attach | 调试模式 | flutter attach | | screenshot | 截屏 | flutter screenshot | +| pub | 下载依赖 | flutter pub get | +| clean | 清除依赖 | flutter clean | +| cache| 清除全局缓存数据 | flutter pub cache clean | 附:[Flutter三方库适配计划](https://docs.qq.com/sheet/DVVJDWWt1V09zUFN2) @@ -210,7 +213,7 @@ Flutter SDK 仓库 ``` 14. 执行`flutter pub cache clean` 正常 执行`flutter clean` 报错,按照报错信息执行 update 命令也没有效果。 - 1. 解决方案:通过注释掉 build.json5 文件中的配置规避。 + 1. 解决方案:通过注释掉 build.json5 文件中的配置规避: "modules":[{ //数组第一个对象保留 }, { //其余对象注释掉 }] 2. 报错信息: ``` #Parse ohos module. json5 error: Exception: Can not found module.json5 at -- Gitee From 88d5885d96a9bdc93e777f1eb449961792bdce81 Mon Sep 17 00:00:00 2001 From: liuja <542689970@qq.com> Date: Thu, 29 Aug 2024 11:24:45 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuja <542689970@qq.com> --- README.en.md | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.en.md b/README.en.md index 5d38bd66ea..e92a2a7f04 100644 --- a/README.en.md +++ b/README.en.md @@ -122,8 +122,8 @@ This repository is a compatible extension of Flutter SDK for the OpenHarmony pla | attach | debug mode | flutter attach | | screenshot | screenshot | flutter screenshot | | pub | download dependency | flutter pub get | -| clean | clear dependency | flutter clean | -| cache| clear global cache data | flutter pub cache clean | +| clean | clear project artifacts | flutter clean | +| cache | clear global cache data | flutter pub cache clean | Attachment: [Flutter third-party library adaptation plan](https://docs.qq.com/sheet/DVVJDWWt1V09zUFN2) diff --git a/README.md b/README.md index 3500bf3003..abc6a8dc67 100644 --- a/README.md +++ b/README.md @@ -119,9 +119,9 @@ Flutter SDK 仓库 | run | 应用运行 | flutter run [--local-engine=\<兼容ohos的engine产物路径\>] | | attach | 调试模式 | flutter attach | | screenshot | 截屏 | flutter screenshot | -| pub | 下载依赖 | flutter pub get | -| clean | 清除依赖 | flutter clean | -| cache| 清除全局缓存数据 | flutter pub cache clean | +| pub | 获取依赖 | flutter pub get | +| clean | 清除项目依赖 | flutter clean | +| cache | 清除全局缓存数据 | flutter pub cache clean | 附:[Flutter三方库适配计划](https://docs.qq.com/sheet/DVVJDWWt1V09zUFN2) -- Gitee From 0de3776f1c0644b8466f19787e73ebc7431b03d9 Mon Sep 17 00:00:00 2001 From: liuja <542689970@qq.com> Date: Thu, 29 Aug 2024 17:27:42 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0readmeFAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuja <542689970@qq.com> --- README.en.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index e92a2a7f04..5935dade4e 100644 --- a/README.en.md +++ b/README.en.md @@ -213,7 +213,7 @@ Attachment: [Flutter third-party library adaptation plan](https://docs.qq.com/sh ``` 14. If `flutter pub cache clean` is executed normally, `flutter clean` will report an error. If update command is executed according to the error message, it has no effect。 - 1. Solution:To avoid this problem, comment out the configuration in the build.json5 file: "modules":[{ //The first object of the array is reserved }, { //The rest of the objects need comments }] + 1. Solution:To avoid this problem, comment out the configuration in the build.json5 file: "modules":[{ // Delete the entire object corresponding to the error }] 2. Error message: ``` #Parse ohos module. json5 error: Exception: Can not found module.json5 at diff --git a/README.md b/README.md index abc6a8dc67..a1f7530981 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ Flutter SDK 仓库 ``` 14. 执行`flutter pub cache clean` 正常 执行`flutter clean` 报错,按照报错信息执行 update 命令也没有效果。 - 1. 解决方案:通过注释掉 build.json5 文件中的配置规避: "modules":[{ //数组第一个对象保留 }, { //其余对象注释掉 }] + 1. 解决方案:通过注释掉 build.json5 文件中的配置规避: "modules":[{ // 删除报错对应的整个对象 }] 2. 报错信息: ``` #Parse ohos module. json5 error: Exception: Can not found module.json5 at -- Gitee From 6ac388a0aada16592a0c3cd27503bc751e3c961a Mon Sep 17 00:00:00 2001 From: SimpleLove520 <1960997571@qq.com> Date: Tue, 3 Sep 2024 14:37:33 +0800 Subject: [PATCH 4/7] =?UTF-8?q?Material3=E7=89=B9=E5=AE=9A=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=9C=A8debug=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BC=9A?= =?UTF-8?q?=E9=97=AA=E9=80=80=EF=BC=8C=E6=9A=82=E6=97=B6=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=9C=A8debug=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BD=BF=E7=94=A8Mate?= =?UTF-8?q?rial3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SimpleLove520 <1960997571@qq.com> --- packages/flutter/lib/src/material/theme_data.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 44c0d49855..4b325ac525 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -474,7 +474,7 @@ class ThemeData with Diagnosticable { pageTransitionsTheme ??= const PageTransitionsTheme(); scrollbarTheme ??= const ScrollbarThemeData(); visualDensity ??= VisualDensity.adaptivePlatformDensity; - useMaterial3 = (platform == TargetPlatform.ohos) ? false : (useMaterial3 ?? false); + useMaterial3 = (platform == TargetPlatform.ohos && kDebugMode) ? false : (useMaterial3 ?? false); final bool useInkSparkle = platform == TargetPlatform.android && !kIsWeb; splashFactory ??= useMaterial3 ? useInkSparkle ? InkSparkle.splashFactory : InkRipple.splashFactory @@ -2037,7 +2037,7 @@ class ThemeData with Diagnosticable { platform: platform ?? this.platform, scrollbarTheme: scrollbarTheme ?? this.scrollbarTheme, splashFactory: splashFactory ?? this.splashFactory, - useMaterial3: ((platform ?? this.platform ) == TargetPlatform.ohos) ? false : (useMaterial3 ?? this.useMaterial3), + useMaterial3: ((platform ?? this.platform ) == TargetPlatform.ohos && kDebugMode) ? false : (useMaterial3 ?? this.useMaterial3), visualDensity: visualDensity ?? this.visualDensity, // COLOR canvasColor: canvasColor ?? this.canvasColor, @@ -2237,7 +2237,7 @@ class ThemeData with Diagnosticable { platform: t < 0.5 ? a.platform : b.platform, scrollbarTheme: ScrollbarThemeData.lerp(a.scrollbarTheme, b.scrollbarTheme, t), splashFactory: t < 0.5 ? a.splashFactory : b.splashFactory, - useMaterial3: ((t < 0.5 ? a.platform : b.platform) == TargetPlatform.ohos) ? false : (t < 0.5 ? a.useMaterial3 : b.useMaterial3), + useMaterial3: ((t < 0.5 ? a.platform : b.platform) == TargetPlatform.ohos && kDebugMode) ? false : (t < 0.5 ? a.useMaterial3 : b.useMaterial3), visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t), // COLOR canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!, -- Gitee From 6bb6016587f011bfac4eb494a8828189bfc0d073 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Mon, 2 Sep 2024 14:59:31 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=BC=96=E8=AF=91app=E6=97=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8F=82=E6=95=B0--build-name=E5=92=8C--build-number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- packages/flutter_tools/lib/src/commands/build_app.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/flutter_tools/lib/src/commands/build_app.dart b/packages/flutter_tools/lib/src/commands/build_app.dart index d91b54c972..7233fe78bf 100644 --- a/packages/flutter_tools/lib/src/commands/build_app.dart +++ b/packages/flutter_tools/lib/src/commands/build_app.dart @@ -29,6 +29,8 @@ class BuildAppCommand extends BuildSubCommand { addBuildModeFlags(verboseHelp: verboseHelp); usesFlavorOption(); usesPubOption(); + usesBuildNumberOption(); + usesBuildNameOption(); addShrinkingFlag(verboseHelp: verboseHelp); addSplitDebugInfoOption(); addDartObfuscationOption(); -- Gitee From bda7fc35d32d069531c2247e76874ce3ea0957af Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Thu, 5 Sep 2024 23:27:58 +0800 Subject: [PATCH 6/7] Update engine.ohos.version to 584adb15 Signed-off-by: hezhengyi --- bin/internal/engine.ohos.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/internal/engine.ohos.version b/bin/internal/engine.ohos.version index d57635ec41..0797b785ca 100644 --- a/bin/internal/engine.ohos.version +++ b/bin/internal/engine.ohos.version @@ -1 +1 @@ -8ef94277f0029e61ff6a96f630d0f10b60330cd8 \ No newline at end of file +584adb15091363198bd0ae3988ebc195befa6ab0 \ No newline at end of file -- Gitee From 5dc94a3702e8738d4934f1d561ee26812f7073b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rulong=20Chen=EF=BC=88=E9=99=88=E6=B1=9D=E9=BE=99=EF=BC=89?= Date: Fri, 6 Sep 2024 20:10:50 +0800 Subject: [PATCH 7/7] =?UTF-8?q?Revert:=20"=E4=BF=AE=E6=94=B9ohos=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E7=BA=A7=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84"=20Reaso?= =?UTF-8?q?n:=20=E8=B7=AF=E5=BE=84=E4=B8=AD=E5=8C=85=E5=90=AB=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=9C=BA=E6=99=AF=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E8=AE=A1=E7=AE=97=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E9=94=99=E3=80=82=E8=BF=99=E9=87=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E6=98=8E=E6=98=BE=E6=94=B6=E7=9B=8A=EF=BC=8C?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=9B=9E=E6=BB=9A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 详情:https://gitee.com/openharmony-sig/flutter_flutter/issues/IAPISU This reverts commit f1692a55aeff9758713c805b7174209be82a38d0. --- .../lib/src/ohos/ohos_plugins_manager.dart | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/flutter_tools/lib/src/ohos/ohos_plugins_manager.dart b/packages/flutter_tools/lib/src/ohos/ohos_plugins_manager.dart index 0a89fe2dd6..e4e8e2ddf5 100644 --- a/packages/flutter_tools/lib/src/ohos/ohos_plugins_manager.dart +++ b/packages/flutter_tools/lib/src/ohos/ohos_plugins_manager.dart @@ -51,7 +51,7 @@ Future checkOhosPluginsDependencies(FlutterProject flutterProject) async { if (flutterProject.isModule) { dependencies[plugin.name] = 'file:$absolutePath'; } else { - final String relativePath = _relative(absolutePath, from: globals.fs.path.dirname(packageFile.path)); + final String relativePath = globals.fs.path.relative(absolutePath, from: globals.fs.path.dirname(packageFile.path)); dependencies[plugin.name] = 'file:$relativePath'; } } @@ -86,14 +86,13 @@ Future addPluginsModules(FlutterProject flutterProject) async { } modules.add({ 'name': plugin.name, - 'srcPath': _relative( - globals.fs.path.join(plugin.path, OhosPlugin.kConfigKey), - from: flutterProject.ohos.ohosRoot.path, - ), + 'srcPath': globals.fs.path.join(plugin.path, OhosPlugin.kConfigKey), 'targets': >[ { 'name': 'default', - 'applyToProducts': ['default'] + 'applyToProducts': [ + 'default' + ] } ], }); @@ -120,12 +119,9 @@ Future addFlutterModuleAndPluginsSrcOverrides(FlutterProject flutterProjec final Map overrides = config['overrides'] as Map? ?? {}; for (final Plugin plugin in plugins) { - overrides[plugin.name] = _relative( - globals.fs.path.join(plugin.path, OhosPlugin.kConfigKey), - from: flutterProject.ohos.ohosRoot.path, - ); + overrides[plugin.name] = globals.fs.path.join(plugin.path, OhosPlugin.kConfigKey); } - final String relativePath = _relative(flutterProject.ohos.flutterModuleDirectory.path, from: flutterProject.ohos.ohosRoot.path); + final String relativePath = globals.fs.path.relative(flutterProject.ohos.flutterModuleDirectory.path, from: flutterProject.ohos.ohosRoot.path); overrides['@ohos/flutter_module'] = 'file:./$relativePath'; overrides['@ohos/flutter_ohos'] = 'file:./har/flutter.har'; final String configNew = const JsonEncoder.withIndent(' ').convert(config); @@ -193,7 +189,3 @@ Future addFlutterModuleAndPluginsOverrides(FlutterProject flutterProject) final String configNew = const JsonEncoder.withIndent(' ').convert(config); packageFile.writeAsStringSync(configNew, flush: true); } - -String _relative(String path, {String? from}) { - return globals.fs.path.relative(path, from: from).replaceAll(r'\', '/'); -} -- Gitee