Skip to content

Commit dc60df2

Browse files
committed
update all dependencies, gradle 9, read version code from git
1 parent a60c7c9 commit dc60df2

File tree

11 files changed

+156
-47
lines changed

11 files changed

+156
-47
lines changed

app/build.gradle.kts

Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
@file:Suppress("UnstableApiUsage")
22

3+
import org.gradle.internal.extensions.core.extra
4+
35
plugins {
46
alias(libs.plugins.android)
5-
alias(libs.plugins.kotlin.android)
67
alias(libs.plugins.kotlin.ksp)
78
alias(libs.plugins.kotlin.serialization.plugin)
89
alias(libs.plugins.compose.compiler)
@@ -15,14 +16,17 @@ plugins {
1516
id("com.google.android.gms.oss-licenses-plugin")
1617
}
1718

19+
val gitVersionName: String by rootProject.extra
20+
val gitVersionCode: String by rootProject.extra
1821
android {
22+
namespace = "com.pnuema.bible.android"
1923
compileSdk = libs.versions.targetSdk.get().toInt()
2024
defaultConfig {
2125
applicationId = "com.pnuema.bible.android"
2226
minSdk = libs.versions.minSdk.get().toInt()
2327
targetSdk = libs.versions.targetSdk.get().toInt()
24-
versionCode = 1
25-
versionName = "1.0"
28+
versionCode = gitVersionCode.toInt()
29+
versionName = gitVersionName
2630
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2731
vectorDrawables {
2832
useSupportLibrary = true
@@ -36,34 +40,85 @@ android {
3640
}
3741
}
3842
}
43+
44+
signingConfigs {
45+
val bibleCertLocation: String? by rootProject.extra
46+
val certLocation: String = if (System.getenv("bibleCertLocation") == null) bibleCertLocation!! else System.getenv("bibleCertLocation")
47+
48+
val bibleKeystorePassword: String? by rootProject.extra
49+
val certPass: String = if (System.getenv("bibleKeystorePassword") == null) bibleKeystorePassword!! else System.getenv("bibleKeystorePassword")
50+
51+
register("release") {
52+
storeFile = file(certLocation)
53+
storePassword = certPass
54+
keyAlias = "bible"
55+
keyPassword = certPass
56+
}
57+
named("debug") {
58+
storeFile = file("debug.keystore")
59+
storePassword = "android"
60+
keyAlias = "androiddebugkey"
61+
keyPassword = "android"
62+
}
63+
}
64+
3965
buildTypes {
40-
named("release") {
66+
release {
67+
proguardFiles(
68+
getDefaultProguardFile("proguard-android-optimize.txt"),
69+
"proguard-rules.pro"
70+
)
71+
isDebuggable = false
72+
isMinifyEnabled = false
73+
isShrinkResources = false
74+
enableUnitTestCoverage = false
75+
signingConfig = signingConfigs.getByName("release")
76+
}
77+
debug {
78+
versionNameSuffix = "-debug"
79+
applicationIdSuffix = ".debug"
80+
isDebuggable = true
4181
isMinifyEnabled = false
42-
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
82+
isShrinkResources = false
83+
proguardFiles(
84+
getDefaultProguardFile("proguard-android-optimize.txt"),
85+
"proguard-rules.pro"
86+
)
87+
enableUnitTestCoverage = true
88+
signingConfig = signingConfigs.getByName("debug")
4389
}
4490
}
4591

4692
compileOptions {
47-
sourceCompatibility = JavaVersion.VERSION_17
48-
targetCompatibility = JavaVersion.VERSION_17
49-
}
50-
51-
kotlin {
52-
jvmToolchain(JavaVersion.VERSION_17.toString().toInt())
93+
sourceCompatibility = JavaVersion.VERSION_21
94+
targetCompatibility = JavaVersion.VERSION_21
5395
}
5496

5597
buildFeatures {
56-
buildConfig = true
5798
compose = true
99+
buildConfig = true
58100
}
59101

60-
namespace = "com.pnuema.bible.android"
102+
testOptions {
103+
unitTests.isReturnDefaultValues = true
104+
}
61105

62106
sourceSets {
63-
getByName("main").java.srcDirs("src/main/kotlin")
107+
getByName("test") {
108+
kotlin.directories += "src/test/java"
109+
kotlin.directories += "src/test/kotlin"
110+
}
111+
getByName("androidTest") {
112+
kotlin.directories += "src/androidTest/java"
113+
kotlin.directories += "src/androidTest/kotlin"
114+
}
64115
}
65116
}
66117

118+
kotlin {
119+
jvmToolchain(JavaVersion.VERSION_21.toString().toInt())
120+
}
121+
67122
tasks.named<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask>("dependencyUpdates").configure {
68123
// optional parameters
69124
checkForGradleUpdate = true

app/debug.keystore

2.54 KB
Binary file not shown.

app/google-services.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"project_number": "502741197718",
44
"firebase_url": "https://fireflyapp-fe9f5.firebaseio.com",
55
"project_id": "fireflyapp-fe9f5",
6-
"storage_bucket": "fireflyapp-fe9f5.appspot.com"
6+
"storage_bucket": "fireflyapp-fe9f5.firebasestorage.app"
77
},
88
"client": [
99
{
@@ -42,6 +42,35 @@
4242
]
4343
}
4444
}
45+
},
46+
{
47+
"client_info": {
48+
"mobilesdk_app_id": "1:502741197718:android:b4bae16c7b34142ab133b7",
49+
"android_client_info": {
50+
"package_name": "com.pnuema.bible.android.debug"
51+
}
52+
},
53+
"oauth_client": [
54+
{
55+
"client_id": "502741197718-473d1vgh9iihepoprgk4a69ol90m9bh2.apps.googleusercontent.com",
56+
"client_type": 3
57+
}
58+
],
59+
"api_key": [
60+
{
61+
"current_key": "AIzaSyAx3psYNordbZdD5xUdl2JXxIBgXlBMiMM"
62+
}
63+
],
64+
"services": {
65+
"appinvite_service": {
66+
"other_platform_oauth_client": [
67+
{
68+
"client_id": "502741197718-473d1vgh9iihepoprgk4a69ol90m9bh2.apps.googleusercontent.com",
69+
"client_type": 3
70+
}
71+
]
72+
}
73+
}
4574
}
4675
],
4776
"configuration_version": "1"

app/src/main/kotlin/com/pnuema/bible/android/ui/elements/CircleImageView.java renamed to app/src/main/java/com/pnuema/bible/android/ui/elements/CircleImageView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ protected void onDraw( @NonNull final Canvas canvas ) {
3838
if (0 == getWidth() || 0 == getHeight()) {
3939
return;
4040
}
41+
42+
if (!(drawable instanceof BitmapDrawable)) {
43+
return;
44+
}
45+
4146
final Bitmap b = ( (BitmapDrawable) drawable ).getBitmap();
47+
if (b == null) {
48+
return;
49+
}
4250
final Bitmap bitmap = b.copy( Bitmap.Config.ARGB_8888, true );
4351

4452
final int w = getWidth( )/*, h = getHeight( )*/;

app/src/main/kotlin/com/pnuema/bible/android/ui/read/viewModel/ReadViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ReadViewModel @Inject constructor(private val fireflyRepository: FireflyRe
3232
fireflyRepository.getVersions().collect { versions ->
3333
_stateVersion.update {
3434
VersionUiState.Version(versions.versions.first {
35-
it.abbreviation.lowercase() == CurrentSelected.version.lowercase()
35+
it.abbreviation.equals(CurrentSelected.version, ignoreCase = true)
3636
}.toViewState())
3737
}
3838
}

app/src/main/res/values-night/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<item name="android:statusBarColor">@color/primary</item>
1313
</style>
1414

15-
<style name="AppTheme.NoActionBar">
15+
<style name="AppTheme.NoActionBar" parent="AppTheme">
1616
<item name="windowActionBar">false</item>
1717
<item name="windowNoTitle">true</item>
1818
</style>

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<item name="android:statusBarColor">@color/primary</item>
1313
</style>
1414

15-
<style name="AppTheme.NoActionBar">
15+
<style name="AppTheme.NoActionBar" parent="AppTheme">
1616
<item name="windowActionBar">false</item>
1717
<item name="windowNoTitle">true</item>
1818
</style>

build.gradle.kts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.internal.extensions.core.extra
2+
13
buildscript {
24
repositories {
35
google()
@@ -10,7 +12,6 @@ buildscript {
1012

1113
plugins {
1214
alias(libs.plugins.android) apply false
13-
alias(libs.plugins.kotlin.android) apply false
1415
alias(libs.plugins.kotlin.ksp) apply false
1516
alias(libs.plugins.kotlin.jvm) apply false
1617
alias(libs.plugins.google.services) apply false
@@ -29,3 +30,20 @@ tasks {
2930
distributionType = Wrapper.DistributionType.BIN
3031
}
3132
}
33+
34+
rootProject.extra.set("gitVersionName", fetchGitVersionName())
35+
rootProject.extra.set("gitVersionCode", fetchGitVersionCode())
36+
37+
fun fetchGitVersionCode(): String = "git rev-list HEAD --count".execute()
38+
39+
fun fetchGitVersionName(): String = "git describe HEAD".execute()
40+
41+
fun String.execute(): String {
42+
val process = ProcessBuilder(*split(" ").toTypedArray())
43+
.redirectOutput(ProcessBuilder.Redirect.PIPE)
44+
.redirectError(ProcessBuilder.Redirect.PIPE)
45+
.start()
46+
process.waitFor()
47+
return process.inputStream.bufferedReader().readText().trim()
48+
}
49+

gradle/libs.versions.toml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
[versions]
22
minSdk = "26"
33
targetSdk = "36"
4-
gradle = "8.14.3"
4+
gradle = "9.1.0"
55

66
#libs
7-
compose-bom = "2025.07.00"
8-
activityCompose = "1.10.1"
9-
hiltAndroid = "2.57"
10-
ktx = "1.16.0"
11-
fragment-ktx = "1.8.8"
12-
lifecycle-viewmodel-ktx = "2.9.2"
7+
compose-bom = "2026.01.01"
8+
activityCompose = "1.12.3"
9+
hiltAndroid = "2.59.1"
10+
ktx = "1.17.0"
11+
fragment-ktx = "1.8.9"
12+
lifecycle-viewmodel-ktx = "2.10.0"
1313
lifecycle-extensions = "2.2.0"
14-
ossLicensesPlugin = "0.10.6"
15-
room-version = "2.7.2"
16-
datastore-preferences = "1.2.0-alpha02"
17-
material = "1.12.0"
18-
play-services-oss-licenses = "17.2.1"
19-
ksp-symbol-processing = "2.2.0-2.0.2"
14+
ossLicensesPlugin = "0.10.10"
15+
room-version = "2.8.4"
16+
datastore-preferences = "1.2.0"
17+
material = "1.13.0"
18+
play-services-oss-licenses = "17.4.0"
19+
ksp-symbol-processing = "2.3.5"
2020
recyclerview = "1.4.0"
2121
constraintlayout = "2.2.1"
22-
firebase-bom = "34.0.0"
22+
firebase-bom = "34.8.0"
2323
retrofit = "3.0.0"
24-
kotlin-serialization = "1.9.0"
25-
okhttp = "5.1.0"
26-
navigation = "2.9.2"
24+
kotlin-serialization = "1.10.0"
25+
okhttp = "5.3.2"
26+
navigation = "2.9.7"
2727

2828
#plugins
29-
kotlin= "2.2.0"
30-
gradlePlugins-agp = "8.11.1"
31-
googleServices = "4.4.3"
32-
gradleCacheFix = "3.0.1"
33-
firebasePerfPlugin = "2.0.0"
34-
crashlyticsPlugin = "3.0.5"
35-
tomlChecker = "0.52.0"
36-
kotlin-serialization-plugin = "2.2.0"
29+
kotlin= "2.3.0"
30+
gradlePlugins-agp = "9.0.0"
31+
googleServices = "4.4.4"
32+
gradleCacheFix = "3.0.3"
33+
firebasePerfPlugin = "2.0.2"
34+
crashlyticsPlugin = "3.0.6"
35+
tomlChecker = "0.53.0"
36+
kotlin-serialization-plugin = "2.3.0"
3737

3838
[libraries]
3939
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
@@ -87,7 +87,6 @@ okhttp = [
8787

8888
[plugins]
8989
android = { id = "com.android.application", version.ref = "gradlePlugins-agp" }
90-
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
9190
kotlin-serialization-plugin = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-serialization-plugin" }
9291
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
9392
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-symbol-processing" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)