diff --git a/forage-android/build.gradle b/forage-android/build.gradle index 5c6a42be..e51db653 100644 --- a/forage-android/build.gradle +++ b/forage-android/build.gradle @@ -5,6 +5,26 @@ plugins { id("org.jetbrains.kotlinx.kover") version "0.6.1" } +ext { + PUBLISH_GROUP_ID = 'com.joinforage' + PUBLISH_VERSION = '3.3.0' + PUBLISH_ARTIFACT_ID = 'forage-android' + PUBLISH_DESCRIPTION = 'Forage Android SDK' + PUBLISH_URL = 'https://github.com/teamforage/forage-android-sdk' + PUBLISH_LICENSE_NAME = 'MIT License' + PUBLISH_LICENSE_URL = + 'https://github.com/teamforage/forage-android-sdk/blob/main/LICENSE' + PUBLISH_DEVELOPER_ID = 'owenkim' + PUBLISH_DEVELOPER_NAME = 'Owen Kim' + PUBLISH_DEVELOPER_EMAIL = 'owenkim@forage.com' + PUBLISH_SCM_CONNECTION = + 'scm:git:github.com:teamforage/forage-android-sdk.git' + PUBLISH_SCM_DEVELOPER_CONNECTION = + 'scm:git:ssh://github.com:teamforage/forage-android-sdk.git' + PUBLISH_SCM_URL = + 'https://github.com/teamforage/forage-android-sdk/tree/main' +} + android { namespace 'com.joinforage.forage.android' compileSdk 33 @@ -15,6 +35,8 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" + + buildConfigField 'String', 'PUBLISH_VERSION', "\"${PUBLISH_VERSION}\"" } buildTypes { @@ -81,24 +103,6 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' } -ext { - PUBLISH_GROUP_ID = 'com.joinforage' - PUBLISH_VERSION = '3.2.0' - PUBLISH_ARTIFACT_ID = 'forage-android' - PUBLISH_DESCRIPTION = 'Forage Android SDK' - PUBLISH_URL = 'https://github.com/teamforage/forage-android-sdk' - PUBLISH_LICENSE_NAME = 'MIT License' - PUBLISH_LICENSE_URL = - 'https://github.com/teamforage/forage-android-sdk/blob/main/LICENSE' - PUBLISH_DEVELOPER_ID = 'owenkim' - PUBLISH_DEVELOPER_NAME = 'Owen Kim' - PUBLISH_DEVELOPER_EMAIL = 'owenkim@forage.com' - PUBLISH_SCM_CONNECTION = - 'scm:git:github.com:teamforage/forage-android-sdk.git' - PUBLISH_SCM_DEVELOPER_CONNECTION = - 'scm:git:ssh://github.com:teamforage/forage-android-sdk.git' - PUBLISH_SCM_URL = - 'https://github.com/teamforage/forage-android-sdk/tree/main' -} + apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" diff --git a/forage-android/src/main/java/com/joinforage/forage/android/core/EnvConfig.kt b/forage-android/src/main/java/com/joinforage/forage/android/core/EnvConfig.kt index 5082237d..768d6f16 100644 --- a/forage-android/src/main/java/com/joinforage/forage/android/core/EnvConfig.kt +++ b/forage-android/src/main/java/com/joinforage/forage/android/core/EnvConfig.kt @@ -1,5 +1,6 @@ package com.joinforage.forage.android.core +import com.joinforage.forage.android.BuildConfig import com.joinforage.forage.android.ui.ForageConfig internal enum class EnvOption(val value: String) { @@ -20,11 +21,10 @@ internal sealed class EnvConfig( val ldMobileKey: String, val ddClientToken: String ) { - // This is how we currently offer access to the the release - // version to code at runtime. It is essential that this - // value stay in sync with forage-android/build.gradle's - // PUBLISH_VERSION value. - val PUBLISH_VERSION: String = "3.2.0" + // For the time being, I figure we can consume BuildConfig in exactly + // one spot (here) to reduce the pieces of source code have to couple + // to BuildConfig. + val PUBLISH_VERSION: String = BuildConfig.PUBLISH_VERSION object Dev : EnvConfig( FLAVOR = EnvOption.DEV,