ionic-team/trapeze

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

Ryanccl opened this issue · 5 comments

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

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

企业微信截图_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

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

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

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.