Skip to content

Commit 6880aaa

Browse files
feat: lib upgrade (#457)
1 parent fbbf47e commit 6880aaa

File tree

18 files changed

+221
-182
lines changed

18 files changed

+221
-182
lines changed

app/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ if (firebaseEnabled) {
2828
}
2929

3030
android {
31-
compileSdk 34
31+
namespace 'org.openedx.app'
32+
compileSdkVersion compile_sdk_version
3233

3334
defaultConfig {
3435
applicationId appId
35-
minSdk 24
36-
targetSdk 34
36+
minSdk min_sdk_version
37+
targetSdk target_sdk_version
3738
versionCode 1
3839
versionName "1.0.0"
3940

@@ -42,7 +43,6 @@ android {
4243
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4344
}
4445

45-
namespace 'org.openedx.app'
4646

4747
flavorDimensions += "env"
4848
productFlavors {
@@ -88,11 +88,11 @@ android {
8888
}
8989
}
9090
compileOptions {
91-
sourceCompatibility JavaVersion.VERSION_17
92-
targetCompatibility JavaVersion.VERSION_17
91+
sourceCompatibility java_version
92+
targetCompatibility java_version
9393
}
9494
kotlinOptions {
95-
jvmTarget = JavaVersion.VERSION_17
95+
jvmTarget = java_version
9696
freeCompilerArgs = List.of("-Xstring-concat=inline")
9797
}
9898
buildFeatures {
@@ -129,19 +129,19 @@ dependencies {
129129

130130
ksp "androidx.room:room-compiler:$room_version"
131131

132-
implementation 'androidx.core:core-splashscreen:1.0.1'
132+
implementation "androidx.core:core-splashscreen:$core_splashscreen_version"
133133

134134
api platform("com.google.firebase:firebase-bom:$firebase_version")
135135
api "com.google.firebase:firebase-messaging"
136136

137137
// Braze SDK Integration
138-
implementation "com.braze:android-sdk-ui:30.2.0"
138+
implementation "com.braze:android-sdk-ui:$braze_sdk_version"
139139

140140
// Plugins
141-
implementation("com.github.openedx:openedx-app-firebase-analytics-android:1.0.1")
141+
implementation("com.github.openedx:openedx-app-firebase-analytics-android:$openedx_firebase_analytics_version")
142142

143-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
144-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
143+
androidTestImplementation "androidx.test.ext:junit:$test_ext_version"
144+
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
145145
testImplementation "junit:junit:$junit_version"
146146
testImplementation "io.mockk:mockk:$mockk_version"
147147
testImplementation "io.mockk:mockk-android:$mockk_version"

app/src/main/java/org/openedx/app/AppActivity.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package org.openedx.app
22

33
import android.content.Intent
44
import android.content.res.Configuration
5-
import android.graphics.Color
65
import android.net.Uri
76
import android.os.Bundle
87
import android.view.View
@@ -157,10 +156,10 @@ class AppActivity : AppCompatActivity(), InsetHolder, WindowSizeHolder {
157156
window.apply {
158157
addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
159158
WindowCompat.setDecorFitsSystemWindows(this, false)
160-
161159
val insetsController = WindowInsetsControllerCompat(this, binding.root)
162160
insetsController.isAppearanceLightStatusBars = !isUsingNightModeResources()
163-
statusBarColor = Color.TRANSPARENT
161+
insetsController.systemBarsBehavior =
162+
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
164163
}
165164
}
166165

@@ -214,21 +213,21 @@ class AppActivity : AppCompatActivity(), InsetHolder, WindowSizeHolder {
214213
}
215214
}
216215

217-
override fun onNewIntent(intent: Intent?) {
216+
override fun onNewIntent(intent: Intent) {
218217
super.onNewIntent(intent)
219218
this.intent = intent
220219

221220
if (authCode != null) {
222221
addFragment(SignInFragment.newInstance(null, null, authCode = authCode))
223222
}
224223

225-
val extras = intent?.extras
224+
val extras = intent.extras
226225
if (extras?.containsKey(DeepLink.Keys.NOTIFICATION_TYPE.value) == true) {
227226
handlePushNotification(extras)
228227
}
229228

230229
if (viewModel.isBranchEnabled) {
231-
if (intent?.getBooleanExtra(BRANCH_FORCE_NEW_SESSION, false) == true) {
230+
if (intent.getBooleanExtra(BRANCH_FORCE_NEW_SESSION, false)) {
232231
Branch.sessionBuilder(this)
233232
.withCallback(branchCallback)
234233
.reInit()

auth/build.gradle

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ plugins {
66
}
77

88
android {
9-
compileSdk 34
9+
namespace 'org.openedx.auth'
10+
compileSdkVersion compile_sdk_version
1011

1112
defaultConfig {
12-
minSdk 24
13-
targetSdk 34
13+
minSdk min_sdk_version
14+
targetSdk target_sdk_version
1415

1516
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1617
consumerProguardFiles "consumer-rules.pro"
1718
}
1819

19-
namespace 'org.openedx.auth'
2020

2121
flavorDimensions += "env"
2222
productFlavors {
@@ -33,17 +33,16 @@ android {
3333

3434
buildTypes {
3535
release {
36-
minifyEnabled true
36+
minifyEnabled false
3737
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3838
}
3939
}
4040
compileOptions {
41-
sourceCompatibility JavaVersion.VERSION_17
42-
targetCompatibility JavaVersion.VERSION_17
41+
sourceCompatibility java_version
42+
targetCompatibility java_version
4343
}
4444
kotlinOptions {
45-
jvmTarget = JavaVersion.VERSION_17
46-
freeCompilerArgs = List.of("-Xstring-concat=inline")
45+
jvmTarget = java_version
4746
}
4847
buildFeatures {
4948
viewBinding true
@@ -54,22 +53,28 @@ android {
5453
dependencies {
5554
implementation project(path: ':core')
5655

57-
implementation 'androidx.browser:browser:1.7.0'
58-
implementation "androidx.credentials:credentials:1.3.0"
59-
implementation "androidx.credentials:credentials-play-services-auth:1.3.0"
60-
implementation "com.facebook.android:facebook-login:16.2.0"
61-
implementation "com.google.android.gms:play-services-auth:21.2.0"
62-
implementation "com.google.android.libraries.identity.googleid:googleid:1.1.1"
63-
implementation("com.microsoft.identity.client:msal:4.9.0") {
64-
//Workaround for the error Failed to resolve: 'io.opentelemetry:opentelemetry-bom' for AS Iguana
65-
exclude(group: "io.opentelemetry")
56+
// AndroidX
57+
implementation "androidx.browser:browser:$browser_version"
58+
implementation "androidx.credentials:credentials:$credentials_version"
59+
implementation "androidx.credentials:credentials-play-services-auth:$credentials_version"
60+
61+
// Social Login
62+
implementation "com.facebook.android:facebook-login:$facebook_login_version"
63+
implementation "com.google.android.gms:play-services-auth:$play_services_auth_version"
64+
implementation "com.google.android.libraries.identity.googleid:googleid:$googleid_version"
65+
implementation("com.microsoft.identity.client:msal:$msal_version") {
66+
exclude group: 'com.microsoft.identity.client', module: 'msal-browser'
67+
exclude group: 'io.opentelemetry', module: 'opentelemetry-bom'
6668
}
67-
implementation("io.opentelemetry:opentelemetry-api:1.18.0")
68-
implementation("io.opentelemetry:opentelemetry-context:1.18.0")
69-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
70-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
69+
70+
// OpenTelemetry
71+
implementation("io.opentelemetry:opentelemetry-api:$opentelemetry_version")
72+
implementation("io.opentelemetry:opentelemetry-context:$opentelemetry_version")
73+
7174
testImplementation "junit:junit:$junit_version"
7275
testImplementation "io.mockk:mockk:$mockk_version"
73-
testImplementation "io.mockk:mockk-android:$mockk_version"
7476
testImplementation "androidx.arch.core:core-testing:$android_arch_version"
77+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinx_coroutines_test_version"
78+
androidTestImplementation "androidx.test.ext:junit:$test_ext_version"
79+
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
7580
}

build.gradle

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,70 @@ import java.util.regex.Pattern
66

77
buildscript {
88
ext {
9+
// Plugin versions
10+
android_gradle_plugin_version = '8.12.0'
11+
google_services_version = '4.4.3'
12+
firebase_crashlytics_version = '3.0.6'
13+
ksp_version = '2.0.0-1.0.24'
14+
915
//Depends on versions in OEXFoundation
1016
kotlin_version = '2.0.0'
1117
room_version = '2.6.1'
1218
detekt_version = '1.23.7'
19+
20+
// Library versions
21+
media3_version = "1.8.0"
22+
youtubeplayer_version = "11.1.0"
23+
firebase_version = "33.0.0"
24+
jsoup_version = '1.21.1'
25+
in_app_review = '2.0.2'
26+
extented_spans_version = "1.4.0"
27+
zip_version = '2.11.5'
28+
29+
// Third-party library versions
30+
branch_sdk_version = '5.20.0'
31+
play_services_ads_identifier_version = '18.2.0'
32+
install_referrer_version = '2.2'
33+
snakeyaml_version = '2.4'
34+
openedx_foundation_version = '1.0.1'
35+
openedx_firebase_analytics_version = '1.0.1'
36+
braze_sdk_version = '37.0.0'
37+
38+
// AndroidX library versions
39+
core_splashscreen_version = '1.0.1'
40+
activity_compose_version = '1.10.1'
41+
browser_version = '1.9.0'
42+
credentials_version = '1.5.0'
43+
44+
// Social login versions
45+
facebook_login_version = '18.1.3'
46+
play_services_auth_version = '21.4.0'
47+
googleid_version = '1.1.1'
48+
msal_version = '7.0.0'
49+
50+
// OpenTelemetry versions
51+
opentelemetry_version = '1.53.0'
52+
53+
// Testing versions
54+
compose_ui_tooling = '1.7.8'
55+
mockk_version = '1.14.5'
56+
android_arch_version = '2.2.0'
57+
junit_version = '4.13.2'
58+
test_ext_version = '1.3.0'
59+
espresso_version = '3.7.0'
60+
kotlinx_coroutines_test_version = '1.10.2'
1361
}
1462
}
1563

1664
plugins {
17-
id 'com.android.application' version '8.5.2' apply false
18-
id 'com.android.library' version '8.5.2' apply false
65+
//noinspection GradlePluginVersion
66+
id 'com.android.application' version "$android_gradle_plugin_version" apply false
67+
//noinspection GradlePluginVersion
68+
id 'com.android.library' version "$android_gradle_plugin_version" apply false
1969
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
20-
id 'com.google.gms.google-services' version '4.4.2' apply false
21-
id "com.google.firebase.crashlytics" version "3.0.2" apply false
22-
id "com.google.devtools.ksp" version "2.0.0-1.0.24" apply false
70+
id 'com.google.gms.google-services' version "$google_services_version" apply false
71+
id "com.google.firebase.crashlytics" version "$firebase_crashlytics_version" apply false
72+
id "com.google.devtools.ksp" version "$ksp_version" apply false
2373
id "org.jetbrains.kotlin.plugin.compose" version "$kotlin_version" apply false
2474
id 'io.gitlab.arturbosch.detekt' version "$detekt_version" apply false
2575
}
@@ -29,25 +79,13 @@ tasks.register('clean', Delete) {
2979
}
3080

3181
ext {
32-
media3_version = "1.4.1"
33-
youtubeplayer_version = "11.1.0"
34-
35-
firebase_version = "33.0.0"
36-
37-
jsoup_version = '1.13.1'
38-
39-
in_app_review = '2.0.1'
40-
41-
extented_spans_version = "1.3.0"
82+
// Android SDK versions
83+
compile_sdk_version = 36
84+
target_sdk_version = 36
85+
min_sdk_version = 24
86+
java_version = JavaVersion.VERSION_17
4287

4388
configHelper = new ConfigHelper(projectDir, getCurrentFlavor())
44-
45-
zip_version = '2.6.3'
46-
//testing
47-
compose_ui_tooling = '1.7.8'
48-
mockk_version = '1.13.12'
49-
android_arch_version = '2.2.0'
50-
junit_version = '4.13.2'
5189
}
5290

5391
def getCurrentFlavor() {

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ java {
1414
dependencies {
1515
implementation localGroovy()
1616
implementation gradleApi()
17-
implementation 'org.yaml:snakeyaml:1.33'
17+
implementation "org.yaml:snakeyaml:2.4"
1818
}

core/build.gradle

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'org.yaml:snakeyaml:2.0'
7+
classpath "org.yaml:snakeyaml:$snakeyaml_version"
88
}
99
}
1010

@@ -21,17 +21,17 @@ def config = configHelper.fetchConfig()
2121
def themeDirectory = config.getOrDefault("THEME_DIRECTORY", "openedx")
2222

2323
android {
24-
compileSdk 34
24+
namespace 'org.openedx.core'
25+
compileSdkVersion compile_sdk_version
2526

2627
defaultConfig {
27-
minSdk 24
28-
targetSdk 34
28+
minSdk min_sdk_version
29+
targetSdk target_sdk_version
2930

3031
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3132
consumerProguardFiles "consumer-rules.pro"
3233
}
3334

34-
namespace 'org.openedx.core'
3535

3636
flavorDimensions += "env"
3737
productFlavors {
@@ -76,11 +76,11 @@ android {
7676
}
7777
}
7878
compileOptions {
79-
sourceCompatibility JavaVersion.VERSION_17
80-
targetCompatibility JavaVersion.VERSION_17
79+
sourceCompatibility java_version
80+
targetCompatibility java_version
8181
}
8282
kotlinOptions {
83-
jvmTarget = JavaVersion.VERSION_17
83+
jvmTarget = java_version
8484
freeCompilerArgs = List.of("-Xstring-concat=inline")
8585
}
8686

@@ -109,22 +109,22 @@ dependencies {
109109
api "com.google.android.play:review-ktx:$in_app_review"
110110

111111
// Branch SDK Integration
112-
api "io.branch.sdk.android:library:5.9.0"
113-
api "com.google.android.gms:play-services-ads-identifier:18.1.0"
114-
api "com.android.installreferrer:installreferrer:2.2"
112+
api "io.branch.sdk.android:library:$branch_sdk_version"
113+
api "com.google.android.gms:play-services-ads-identifier:$play_services_ads_identifier_version"
114+
api "com.android.installreferrer:installreferrer:$install_referrer_version"
115115

116116
// Zip
117117
api "net.lingala.zip4j:zip4j:$zip_version"
118118

119119
// OpenEdx libs
120-
api("com.github.openedx:openedx-app-foundation-android:1.0.1")
120+
api("com.github.openedx:openedx-app-foundation-android:$openedx_foundation_version")
121121

122122
// Preview
123123
debugApi "androidx.compose.ui:ui-tooling:$compose_ui_tooling"
124124

125-
testImplementation 'junit:junit:4.13.2'
126-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
127-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
125+
testImplementation "junit:junit:$junit_version"
126+
androidTestImplementation "androidx.test.ext:junit:$test_ext_version"
127+
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
128128
}
129129

130130
def insertBuildConfigFields(currentFlavour, buildType) {

core/src/main/java/org/openedx/core/AppDataConstants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ object AppDataConstants {
66
const val USER_MIN_YEAR = 13
77
const val USER_MAX_YEAR = 77
88
const val DEFAULT_MIME_TYPE = "image/jpeg"
9-
val defaultLocale = Locale("en")
9+
val defaultLocale: Locale = Locale.Builder().setLanguage("en").build()
1010

1111
const val VIDEO_FORMAT_M3U8 = ".m3u8"
1212
const val VIDEO_FORMAT_MP4 = ".mp4"

0 commit comments

Comments
 (0)