Skip to content

Commit b8c7fd5

Browse files
committed
Add OpenHarmony (ohos) support to examples and cnativeapi
Introduces OpenHarmony (ohos) platform support for display_example and cnativeapi/example, including configuration files, resource files, build scripts, and test suites. Updates .metadata and pubspec.yaml files to reflect the new platform and adjusts SDK and lint versions. Minor code change in display_example to comment out cardTheme usage.
1 parent decf3a2 commit b8c7fd5

File tree

83 files changed

+1600
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1600
-33
lines changed

examples/display_example/.metadata

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "9f455d2486bcb28cad87b062475f42edc959f636"
8-
channel: "stable"
7+
revision: "c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd"
8+
channel: "[user-branch]"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
17-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
18-
- platform: ios
19-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
20-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
16+
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
17+
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
18+
- platform: ohos
19+
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
20+
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
2121

2222
# User provided section
2323

examples/display_example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
1515
theme: ThemeData(
1616
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
1717
useMaterial3: true,
18-
cardTheme: const CardThemeData(elevation: 2, margin: EdgeInsets.all(8)),
18+
// cardTheme: const CardThemeData(elevation: 2, margin: EdgeInsets.all(8)),
1919
),
2020
home: const DisplayManagerPage(),
2121
);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/node_modules
2+
/oh_modules
3+
/local.properties
4+
/.idea
5+
**/build
6+
/.hvigor
7+
.cxx
8+
/.clangd
9+
/.clang-format
10+
/.clang-tidy
11+
**/.test
12+
**/BuildProfile.ets
13+
**/oh-package-lock.json5
14+
/package.json
15+
/package-lock.json
16+
17+
**/src/main/resources/rawfile/flutter_assets/
18+
**/libs/**/libapp.so
19+
**/libs/**/libflutter.so
20+
**/libs/**/libvmservice_snapshot.so
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"app": {
3+
"bundleName": "com.example.display_example",
4+
"vendor": "example",
5+
"versionCode": 1000000,
6+
"versionName": "1.0.0",
7+
"icon": "$media:app_icon",
8+
"label": "$string:app_name"
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"string": [
3+
{
4+
"name": "app_name",
5+
"value": "display_example"
6+
}
7+
]
8+
}
6.63 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"app": {
3+
"signingConfigs": [
4+
],
5+
"products": [
6+
{
7+
"name": "default",
8+
"signingConfig": "default",
9+
"compatibleSdkVersion": "5.1.0(18)",
10+
"runtimeOS": "HarmonyOS",
11+
"targetSdkVersion": "6.0.0(20)"
12+
}
13+
],
14+
"buildModeSet": [
15+
{
16+
"name": "debug"
17+
},
18+
{
19+
"name": "profile"
20+
},
21+
{
22+
"name": "release"
23+
}
24+
]
25+
},
26+
"modules": [
27+
{
28+
"name": "entry",
29+
"srcPath": "./entry",
30+
"targets": [
31+
{
32+
"name": "default",
33+
"applyToProducts": [
34+
"default"
35+
]
36+
}
37+
]
38+
}
39+
]
40+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/node_modules
2+
/oh_modules
3+
/.preview
4+
/build
5+
/.cxx
6+
/.test
7+
GeneratedPluginRegistrant.ets
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{
3+
"apiType": 'stageMode',
4+
"buildOption": {
5+
},
6+
"targets": [
7+
{
8+
"name": "default",
9+
"runtimeOS": "HarmonyOS"
10+
},
11+
{
12+
"name": "ohosTest",
13+
}
14+
]
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
3+
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
4+
export default {
5+
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
6+
plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
7+
}

0 commit comments

Comments
 (0)