Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/fluwx/ohos

This file was deleted.

9 changes: 9 additions & 0 deletions packages/fluwx/ohos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
1 change: 1 addition & 0 deletions packages/fluwx/ohos/build-profile.json5
1 change: 1 addition & 0 deletions packages/fluwx/ohos/hvigorfile.ts
1 change: 1 addition & 0 deletions packages/fluwx/ohos/index.ets
1 change: 1 addition & 0 deletions packages/fluwx/ohos/src/main/ets
1 change: 0 additions & 1 deletion packages/fluwx_no_pay/ohos

This file was deleted.

9 changes: 9 additions & 0 deletions packages/fluwx_no_pay/ohos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
1 change: 1 addition & 0 deletions packages/fluwx_no_pay/ohos/build-profile.json5
1 change: 1 addition & 0 deletions packages/fluwx_no_pay/ohos/hvigorfile.ts
1 change: 1 addition & 0 deletions packages/fluwx_no_pay/ohos/index.ets
12 changes: 12 additions & 0 deletions packages/fluwx_no_pay/ohos/oh-package.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "fluwx_no_pay",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "index.ets",
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@ohos/flutter_ohos": "file:./har/flutter.har",
"@tencent/wechat_open_sdk": "1.0.19"
}
}
1 change: 1 addition & 0 deletions packages/fluwx_no_pay/ohos/src/main/ets
10 changes: 10 additions & 0 deletions packages/fluwx_no_pay/ohos/src/main/module.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": {
"name": "fluwx_no_pay",
"type": "har",
"deviceTypes": [
"default",
"tablet"
]
}
}
8 changes: 6 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ melos:
test -L packages/fluwx_no_pay/example/lib/pages || (echo "❌ fluwx_no_pay example pages symlink missing" && exit 1)
test -L packages/fluwx/example/images || (echo "❌ fluwx example images symlink missing" && exit 1)
test -L packages/fluwx_no_pay/example/images || (echo "❌ fluwx_no_pay example images symlink missing" && exit 1)
test -L packages/fluwx/ohos || (echo "❌ fluwx/ohos symlink missing" && exit 1)
test -L packages/fluwx_no_pay/ohos || (echo "❌ fluwx_no_pay/ohos symlink missing" && exit 1)
for package in fluwx fluwx_no_pay; do
for path in build-profile.json5 hvigorfile.ts index.ets src/main/ets; do
test -L "packages/$package/ohos/$path" && test -e "packages/$package/ohos/$path" || exit 1
done
done
dart tools/check_ohos_metadata.dart || exit 1
echo "✅ 所有 symlink 完好"

publish:all:
Expand Down
33 changes: 33 additions & 0 deletions tools/check_ohos_metadata.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ignore_for_file: avoid_print
import 'dart:convert';
import 'dart:io';

/// Run from the workspace root before publishing either package.
void main() {
for (final package in ['fluwx', 'fluwx_no_pay']) {
final root = 'packages/$package';
final pubspec = File('$root/pubspec.yaml').readAsStringSync();
final name = RegExp(
r'^name:\s*(\S+)\s*$',
multiLine: true,
).firstMatch(pubspec)?.group(1);
// These metadata files intentionally use the JSON subset of JSON5.
final ohPackage = jsonDecode(
File('$root/ohos/oh-package.json5').readAsStringSync(),
);
final module = jsonDecode(
File('$root/ohos/src/main/module.json5').readAsStringSync(),
);
if (name != package ||
ohPackage['name'] != name ||
module['module']['name'] != name) {
stderr.writeln(
'$package: inconsistent names: pubspec=$name, '
'OHPM=${ohPackage['name']}, module=${module['module']['name']}',
);
exitCode = 1;
}
}
if (exitCode == 0)
print('OHOS package and module names match both pubspecs.');
}
Loading