-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dynamic configuration files #3141
Comments
FWIW we patched exactly this feature into our app project, because we needed separate configurations (e.g. This is working quite nicely so far and I'm much in favor of making When you update fields like Probably this would not be desirable anyway, as when you're running these types of multi-builds, you'll likely want to have a more sophisticated native build pipeline, with different product flavors on Android and build schemes on iOS. I can't really speak for iOS, as I don't have a lot of experience with the platform, but at least on Android, you would likely prefer to run the full build matrix in one step instead of individually for performance & caching reasons. This however does not work with the current copy-one-config-at-a-time approach. From my POV what we'd need ideally is being able to generate a whole set of configs, copy all of them over into the native projects (with different file names), and then have the native build pipeline select the right config for the right flavor. Alternatively the dependency could be inverted so that the native build pipeline calls The dependency inversion would have these additional neat side-effects:
As neither of these proposed solutions (multi-config generation, dependency inversion) are implemented yet, we need to come up with a workaround. The generated config includes another {
"build": {
"environment": {
"APP_COUNTRY": "DE",
"APP_DEBUG": "true"
}
}
} These variables are exported as environment variables and then used to determine what flavor / scheme to build. |
@buschtoens We cannot dynamically rename Capacitor native projects at this time (I'm referring to reading |
Whether or not dynamic renaming is supported, for obvious reasons js/ts is infinitely preferable as a config file format. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Capacitor should allow a
capacitor.config.{ts,js}
file so that configuration can be generated based on environment.Related: #1741, #1478
The text was updated successfully, but these errors were encountered: