Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Documentation/ConfigurationManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ android:
- feature_flags.yaml
```

## App Version

Set these top-level keys in the selected environment's `config.yaml` (including your custom config directory, if used):

```yaml
VERSION_CODE: 2
VERSION_NAME: '1.0.1'
```

- `VERSION_CODE` sets Android's `versionCode`. It must be an integer from `1` to `2100000000`; invalid values fail during Gradle configuration.
- `VERSION_NAME` sets the user-visible Android `versionName`; use a quoted string.
- If omitted, the values default to `1` and `'1.0.0'`, respectively.

Increment `VERSION_CODE` for each Google Play upload, using a value higher than any previously uploaded version for the same application ID. Changing `VERSION_NAME` alone does not satisfy this requirement.

## Available Third-Party Services
- **Firebase:** Analytics, Crashlytics, Cloud Messaging
- **Google:** Sign in and Sign up via Google
Expand Down
11 changes: 9 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
def config = configHelper.fetchConfig()
def appId = config.getOrDefault("APPLICATION_ID", "org.openedx.app")
def appVersionCode = config.getOrDefault("VERSION_CODE", 1)
def appVersionName = config.getOrDefault("VERSION_NAME", "1.0.0")

if (appVersionCode < 1 || appVersionCode > 2100000000) {
throw new GradleException("VERSION_CODE must be an integer between 1 and 2100000000 in the YAML config.")
}

def themeDirectory = config.getOrDefault("THEME_DIRECTORY", "openedx")
def firebaseConfig = config.get('FIREBASE')
def firebaseEnabled = firebaseConfig?.getOrDefault('ENABLED', false)
Expand Down Expand Up @@ -35,8 +42,8 @@ android {
applicationId appId
minSdk min_sdk_version
targetSdk target_sdk_version
versionCode 1
versionName "1.0.0"
versionCode appVersionCode
versionName appVersionName

resourceConfigurations += ["en", "uk"]

Expand Down
2 changes: 2 additions & 0 deletions default_config/dev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
API_HOST_URL: 'http://localhost:8000'
APPLICATION_ID: 'org.openedx.app'
VERSION_CODE: 1
VERSION_NAME: '1.0.0'
ENVIRONMENT_DISPLAY_NAME: 'Localhost'
URI_SCHEME: ''
FEEDBACK_EMAIL_ADDRESS: 'support@example.com'
Expand Down
2 changes: 2 additions & 0 deletions default_config/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
API_HOST_URL: 'http://localhost:8000'
APPLICATION_ID: 'org.openedx.app'
VERSION_CODE: 1
VERSION_NAME: '1.0.0'
ENVIRONMENT_DISPLAY_NAME: 'Localhost'
URI_SCHEME: ''
FEEDBACK_EMAIL_ADDRESS: 'support@example.com'
Expand Down
2 changes: 2 additions & 0 deletions default_config/stage/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
API_HOST_URL: 'http://localhost:8000'
APPLICATION_ID: 'org.openedx.app'
VERSION_CODE: 1
VERSION_NAME: '1.0.0'
ENVIRONMENT_DISPLAY_NAME: 'Localhost'
URI_SCHEME: ''
FEEDBACK_EMAIL_ADDRESS: 'support@example.com'
Expand Down
Loading