Skip to content

Commit 872a327

Browse files
committed
chore (build): Update some values, add exts value
1 parent c815b69 commit 872a327

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

app/build.gradle

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ android {
3838
localProperties.load(new FileInputStream(localPropertiesFile))
3939
}
4040

41-
def ghUser = System.getProperty("github_updates_repo")
42-
?: localProperties.getProperty("github_updates_repo", "")
41+
// Put your GitHub username in this flag when building for in-app update feature
42+
// -Dgh_username=
43+
def ghUser = System.getProperty("gh_username")
44+
?: localProperties.getProperty("gh_username", "")
45+
resValue "string", "gh_username", ghUser
46+
47+
// Put your Telegram bot token in this flag when building for Telegram backup feature
48+
// -Dtg_backup_bot_token=
4349
def tgKey = System.getProperty("tg_backup_bot_token")
4450
?: localProperties.getProperty("tg_backup_bot_token", "")
45-
46-
resValue "string", "github_updates_repo", ghUser
4751
resValue 'string', 'tg_backup_bot_token', tgKey
4852
}
4953
signingConfigs {
@@ -142,9 +146,16 @@ android {
142146
}
143147
}
144148
dependencies {
145-
implementation(libs.doki.exts) {
146-
exclude group: 'org.json', module: 'json'
147-
}
149+
def exts = libs.versions.exts.get()
150+
if (System.properties.containsKey('exts')) {
151+
// Use this flag with build command for auto-fetch and replace:
152+
// -Dexts=$(curl -s https://api.github.com/repos/DokiTeam/doki-exts/commits/base -H "Accept: application/vnd.github.sha" | cut -c -10)
153+
exts = System.getProperty('exts')
154+
}
155+
//noinspection UseTomlInstead
156+
implementation("com.github.DokiTeam:doki-exts:$exts") {
157+
exclude group: 'org.json', module: 'json'
158+
}
148159

149160
coreLibraryDesugaring libs.desugar.jdk.libs
150161
implementation libs.kotlin.stdlib

app/src/main/kotlin/org/dokiteam/doki/core/github/AppUpdateRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AppUpdateRepository @Inject constructor(
3737
@ApplicationContext context: Context,
3838
) {
3939

40-
private val user: String = context.getString(R.string.github_updates_repo)
40+
private val user: String = context.getString(R.string.gh_username)
4141
private val availableUpdate = MutableStateFlow<AppVersion?>(null)
4242
private val releasesUrl = buildString {
4343
append("https://api.github.com/repos/")

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ coil-svg = { module = "io.coil-kt.coil3:coil-svg", version.ref = "coil" }
9090
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "conscrypt" }
9191
desugar_jdk_libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar" }
9292
disk-lru-cache = { module = "com.github.solkin:disk-lru-cache", version.ref = "diskLruCache" }
93-
doki-exts = { module = "com.github.DokiTeam:doki-exts", version.ref = "exts" }
9493
guava = { module = "com.google.guava:guava", version.ref = "guava" }
9594
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "dagger" }
9695
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" }

0 commit comments

Comments
 (0)