From a25e108f838b8ee2f167d685c25d61f7e2d44a7d Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 23 Oct 2023 11:18:03 +0200 Subject: [PATCH] Adapt further --- pkgs/messages/example_json/build_script.dart | 9 +++++++-- pkgs/messages/example_json/lib/testarbctx2.g.dart | 10 ++-------- pkgs/messages/example_json/out.js.resources.json | 1 + pkgs/messages/lib/src/message_list_json.dart | 6 ------ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/pkgs/messages/example_json/build_script.dart b/pkgs/messages/example_json/build_script.dart index f8b624d2..81abefa1 100644 --- a/pkgs/messages/example_json/build_script.dart +++ b/pkgs/messages/example_json/build_script.dart @@ -1,6 +1,7 @@ import 'dart:io'; -import 'package:messages/build_files.dart'; +import 'package:native_assets_cli/build_files_code.dart'; +import 'package:data_assets_cli/build_files_data.dart'; import 'package:path/path.dart' as path; Future main(List args) async { @@ -17,5 +18,9 @@ Future main(List args) async { .toList(), }; - print(BuildOutput(filesPerPackage: filesPerPackage).toJson()); + final buildOutput = [ + CodeBuildOutput(filesPerPackage: filesPerPackage).toJson(), + DataBuildOutput(filesPerPackage: filesPerPackage).toJson(), + ]; + print(buildOutput); } diff --git a/pkgs/messages/example_json/lib/testarbctx2.g.dart b/pkgs/messages/example_json/lib/testarbctx2.g.dart index f95eb84b..b7d0da4c 100644 --- a/pkgs/messages/example_json/lib/testarbctx2.g.dart +++ b/pkgs/messages/example_json/lib/testarbctx2.g.dart @@ -32,16 +32,10 @@ class AboutPageMessages { @pragma('dart2js:tryInline') Future aboutMessage({required String websitename}) async { - return await generate( - bundle, - [websitename], - currentLocale, - intlObject, - 1, - ); + return await generate(bundle, [websitename], currentLocale, intlObject, 1); } - @Resource('messages') + @ResourceIdentifier('package:messages') @pragma('dart2js:resource-identifier') @pragma('dart2js:never-inline') static Future generate(MessagesAssetBundle bundle, List args, diff --git a/pkgs/messages/example_json/out.js.resources.json b/pkgs/messages/example_json/out.js.resources.json index 65a1823d..40fae895 100644 --- a/pkgs/messages/example_json/out.js.resources.json +++ b/pkgs/messages/example_json/out.js.resources.json @@ -12,6 +12,7 @@ "name": "generate", "uri": "file:///home/mosum/projects/i18n/pkgs/messages/example_json/lib/testarbctx2.g.dart", "nonconstant": true, + "id": "AboutPage", "files": [ { "filename": "out.js", diff --git a/pkgs/messages/lib/src/message_list_json.dart b/pkgs/messages/lib/src/message_list_json.dart index 31ea7c7c..ce1294df 100644 --- a/pkgs/messages/lib/src/message_list_json.dart +++ b/pkgs/messages/lib/src/message_list_json.dart @@ -76,9 +76,3 @@ class MessageListJson extends MessageList { ) => message.generateString(args, intl: intl); } - -const ResourceIdentifier resourceIdentifier = ResourceIdentifier(); - -class ResourceIdentifier { - const ResourceIdentifier(); -}