ionic-team / trapeze

The mobile project configuration toolbox. Manage native iOS, Android, Ionic/Capacitor, React Native, and Flutter apps through a simple YAML format.
https://trapeze.dev
Other
328 stars 40 forks source link

How to automatically configure the capacitor plug-in key when adding a plug-in #178

Closed Ryanccl closed 1 year ago

Ryanccl commented 1 year ago

image

npx @trapezedev/configure run ./node_modules/capacitor-example/install.yaml

The yaml in the capacitor plug-in directory does not modify the plug-in project AndroidManifest.xml after running, but actually modifies the android of the main project

image

mlynch commented 1 year ago

Sorry I'm not following, can you clarify what this issue is describing? Thanks

Ryanccl commented 1 year ago

企业微信截图_cb4f9ebd-ecd6-45fc-a0d3-7f9f894ecdf4 I want to automatically modify the apikey of the plug-in project after adding the capacitor plug-in, but now after executing trapeze, the xml of the main project is modified image

mlynch commented 1 year ago

Why would you want to modify the plugin project? The only setting that matters is the setting in your main app project. I suppose you could just configure the directory of the android project if you want to be specific though. https://trapeze.dev/docs/Operations/getting-started#usage

Ryanccl commented 1 year ago

Why would you want to modify the plugin project? The only setting that matters is the setting in your main app project. I suppose you could just configure the directory of the android project if you want to be specific though. https://trapeze.dev/docs/Operations/getting-started#usage

My need is to achieve the same effect as the cordova plugin

cordova plugin add cordova-example-plugin --variable APP_KEY=your_appkey

There will be no actual APP_KEY in the developed third-party plug-in code. When using, the package name of each package is different, and the APP_KEY inside will also be different. APP_KEY needs to be updated when adding plugins

mlynch commented 1 year ago

Yes, the way this is done is how I described it: plugins that require variables ultimately require you adding config values to your app's configuration files which then apply to the rest of the app. The way Trapeze does this is correct, this is working as expected. You wouldn't modify the actual plugin project which is probably in a node_modules folder and going to be recreated every time the plugin is installed.