Add a new flag to support config constants pool by json file#107089
Add a new flag to support config constants pool by json file#107089hai046 wants to merge 3 commits intoflutter:masterfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
I'm not sure if you missed it in my last message (#105213 (comment)), but I actually think that you should start by first filing an issue for a new feature request (you can re-use a lot of your description from this PR), where we can discuss the approach BEFORE you do any coding. Sorry about the confusion! |
|
unfortunately this PR has been partially reverted, making --dart-define-from-file useless for automating builds.. |
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Add a new flag to support config constants pool by json file
The developer configures a json file, which will read all the contents of the configuration into the corresponding variables and parameters,then you can use it in android and iOS projects with custom variables
Scenes to be used:
build.gradle1、Define json file
You can use
flutter run --helpget usagefor example:
cn.com.test.pkg.jsoncontent2、Use environment in flutter
You can get all json raw content:
Or ,you can get field by
3、Android project
file:
build.gradle4、iOS project
file:
ios/Flutter/Generated.xcconfigfile:
ios/Flutter/flutter_export_environment.shYou can use in Info.plist
Thanks for the correction to the last PR
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.