Use a single shared root .env for iOS and Android config#90
Draft
Brian Plattenburg (bplattenburg) wants to merge 1 commit into
Draft
Use a single shared root .env for iOS and Android config#90Brian Plattenburg (bplattenburg) wants to merge 1 commit into
Brian Plattenburg (bplattenburg) wants to merge 1 commit into
Conversation
8cd084d to
6646b6b
Compare
7e2f54c to
8688a7d
Compare
338c58b to
7874788
Compare
Both apps read DITTO_DATABASE_ID / DITTO_DEVELOPMENT_TOKEN / DITTO_URL from
one repo-root .env instead of separate iOS/.env and Android local.properties
entries.
- Add root .env.template (unquoted values); move it up from iOS/.
- iOS: "Generate Env.swift" build phase reads ${SRCROOT}/../.env.
- Android: read the repo-root .env via dittoEnv() and wrap values for
BuildConfig; local.properties keeps only the SDK location.
- Update iOS/Android READMEs to the shared-.env setup flow.
7874788 to
c5b1522
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the two separate config files (
iOS/.env+ Androidlocal.propertiesentries) with one shared repo-root.envas the single source of truth forDITTO_DATABASE_ID/DITTO_DEVELOPMENT_TOKEN/DITTO_URL. Stacked on #89.Changes
.env.template(moved up fromiOS/); values are unquoted.${SRCROOT}/../.env(the repo root).app/build.gradle.ktsreads the repo-root.envvia a newdittoEnv()helper and wraps each value forbuildConfigField.local.propertiesnow holds only the SDK location..envflow (also fixes stale v4 key names iniOS/README.md).Why unquoted values
iOS's
buildEnv.shwraps values in quotes when generatingEnv.swift, while Android'sbuildConfigFieldneeds a quoted code literal. The shared.envkeeps values unquoted; each platform adds its own quoting.Migration for devs
Copy
.env.template→.envat the repo root and fill in the three values. Remove the Ditto keys fromAndroid/local.properties(keepsdk.dir); delete the oldiOS/.env.cc Aaron LaBeau (@biozal) Walker Erekson (@texasRanger09) @getditto/commercial-solutions