-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have ext.PUBLISH_VERSION be source of truth (#118)
It turns out we can use variables in groovy to declare the release version of our package in one variable (the variable that our sonatype repository happens to look for the release version) and then reference that variable in another place location (in our case we want to reference it so we can expose it on the `BuildConfig` to reference it in logs at runtime) NOTE: * I moved the ext block to the top of the build.gradle file so that the PUBLISH_VERSION variable would exist by the time the android block executes * To reduce coupling on `BuildConfig`, I opted to continue the pattern of exposing the PUBLISH_VERSION via the `EnvConfig` object. We can change this later if not a good idea
- Loading branch information
1 parent
7b193b5
commit 6949418
Showing
2 changed files
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 = '[email protected]' | ||
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 = '[email protected]' | ||
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" |
This file contains 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