Skip to content

Commit 2f75ab2

Browse files
authored
Update dependencies and JVM target (#717)
1 parent d302865 commit 2f75ab2

File tree

21 files changed

+119
-134
lines changed

21 files changed

+119
-134
lines changed

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import com.vanniktech.maven.publish.SonatypeHost
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
23

34
plugins {
45
// FIXME: For now, we cannot use the versions catalog in precompiled scripts: https://github.com/gradle/gradle/issues/15383
@@ -21,16 +22,11 @@ android {
2122
}
2223

2324
compileOptions {
24-
sourceCompatibility = JavaVersion.VERSION_1_8
25-
targetCompatibility = JavaVersion.VERSION_1_8
25+
sourceCompatibility = JavaVersion.VERSION_11
26+
targetCompatibility = JavaVersion.VERSION_11
2627
isCoreLibraryDesugaringEnabled = true
2728
}
2829

29-
kotlinOptions {
30-
jvmTarget = JavaVersion.VERSION_1_8.toString()
31-
allWarningsAsErrors = true
32-
}
33-
3430
testOptions {
3531
unitTests.isIncludeAndroidResources = true
3632
}
@@ -50,10 +46,17 @@ android {
5046

5147
kotlin {
5248
explicitApi()
49+
50+
compilerOptions {
51+
freeCompilerArgs.add("-Xannotation-default-target=param-property")
52+
jvmTarget = JvmTarget.JVM_11
53+
allWarningsAsErrors = true
54+
}
5355
}
5456

5557
dependencies {
56-
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
58+
//noinspection UseTomlInstead
59+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
5760
}
5861

5962
mavenPublishing {

demos/navigator/build.gradle.kts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id("com.android.application")
35
kotlin("android")
@@ -10,7 +12,7 @@ android {
1012
compileSdk = (property("android.compileSdk") as String).toInt()
1113

1214
defaultConfig {
13-
minSdk = 23
15+
minSdk = (property("android.minSdk") as String).toInt()
1416
targetSdk = (property("android.targetSdk") as String).toInt()
1517

1618
applicationId = "org.readium.navigator.demo"
@@ -22,14 +24,11 @@ android {
2224
}
2325

2426
compileOptions {
25-
sourceCompatibility = JavaVersion.VERSION_1_8
26-
targetCompatibility = JavaVersion.VERSION_1_8
27+
sourceCompatibility = JavaVersion.VERSION_11
28+
targetCompatibility = JavaVersion.VERSION_11
2729
isCoreLibraryDesugaringEnabled = true
2830
}
29-
kotlinOptions {
30-
jvmTarget = JavaVersion.VERSION_1_8.toString()
31-
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
32-
}
31+
3332
buildFeatures {
3433
viewBinding = true
3534
compose = true
@@ -59,6 +58,14 @@ android {
5958
namespace = "org.readium.demo.navigator"
6059
}
6160

61+
kotlin {
62+
63+
compilerOptions {
64+
jvmTarget = JvmTarget.JVM_11
65+
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
66+
}
67+
}
68+
6269
dependencies {
6370
implementation(project(":readium:readium-shared"))
6471
implementation(project(":readium:readium-streamer"))

demos/navigator/src/main/java/org/readium/demo/navigator/decorations/CustomDecorationStyles.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.readium.r2.shared.publication.epub.pageList
2626
*
2727
* This is an example of a custom Decoration Style declaration.
2828
*/
29-
data class DecorationStyleAnnotationMark(@ColorInt val tint: Int) : Decoration.Style
29+
data class DecorationStyleAnnotationMark(@param:ColorInt val tint: Int) : Decoration.Style
3030

3131
/**
3232
* Decoration Style for a page number label.

gradle/libs.versions.toml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
[versions]
22

3-
kotlin = "2.1.21"
4-
agp = "8.10.1"
3+
kotlin = "2.2.20"
4+
agp = "8.11.1"
55
desugar_jdk_libs = "2.1.5"
66
gradle-maven-publish-plugin = "0.32.0"
77

8-
androidx-activity = "1.10.1"
8+
androidx-activity = "1.11.0"
99
androidx-annotation = "1.9.1"
10-
androidx-appcompat = "1.7.0"
11-
androidx-browser = "1.8.0"
10+
androidx-appcompat = "1.7.1"
11+
androidx-browser = "1.9.0"
1212
androidx-cardview = "1.0.0"
13-
androidx-compose-animation = "1.8.2"
14-
androidx-compose-foundation = "1.8.2"
15-
androidx-compose-material = "1.8.2"
13+
androidx-compose-animation = "1.9.2"
14+
androidx-compose-foundation = "1.9.2"
15+
androidx-compose-material = "1.9.2"
1616
androidx-compose-material-icons = "1.7.8"
17-
androidx-compose-material3 = "1.3.2"
18-
androidx-compose-runtime = "1.8.2"
19-
androidx-compose-ui = "1.8.2"
17+
androidx-compose-material3 = "1.4.0"
18+
androidx-compose-runtime = "1.9.2"
19+
androidx-compose-ui = "1.9.2"
2020
androidx-constraintlayout = "2.2.1"
21-
androidx-core = "1.16.0"
21+
androidx-core = "1.17.0"
2222
androidx-datastore = "1.1.7"
23-
androidx-fragment-ktx = "1.8.7"
23+
androidx-fragment-ktx = "1.8.9"
2424
androidx-legacy = "1.0.0"
25-
androidx-lifecycle = "2.9.0"
26-
androidx-media3 = "1.7.1"
27-
androidx-navigation = "2.9.0"
25+
androidx-lifecycle = "2.9.4"
26+
androidx-media3 = "1.8.0"
27+
androidx-navigation = "2.9.5"
2828
androidx-paging = "3.3.6"
2929
androidx-recyclerview = "1.4.0"
30-
androidx-room = "2.7.1"
30+
androidx-room = "2.8.1"
3131
androidx-viewpager2 = "1.1.0"
32-
androidx-webkit = "1.13.0"
32+
androidx-webkit = "1.14.0"
3333

34-
assertj = "3.27.3"
34+
assertj = "3.27.6"
3535

3636
dokka = "1.9.20"
3737

38-
google-material = "1.12.0"
38+
google-material = "1.13.0"
3939

4040
joda-time = "2.14.0"
4141
#Do not upgrade without fixing unit tests in HtmlResourceContentIteratorTest and regression testing
@@ -52,7 +52,7 @@ kotlinx-collections-immutable = "0.4.0"
5252

5353
# Make sure to align with the Kotlin version.
5454
# See https://github.com/google/ksp/releases
55-
ksp = "2.1.21-2.0.1"
55+
ksp = "2.2.20-2.0.3"
5656

5757
ktlint = "12.1.1"
5858

@@ -62,8 +62,8 @@ pdf-viewer = "3.2.8"
6262
picasso = "2.8"
6363
pspdfkit = "8.4.1"
6464

65-
robolectric = "4.14.1"
66-
mockk = "1.14.2"
65+
robolectric = "4.16"
66+
mockk = "1.14.6"
6767

6868
timber = "5.0.1"
6969

readium/lcp/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ plugins {
1111

1212
android {
1313
namespace = "org.readium.r2.lcp"
14+
}
1415

15-
kotlinOptions {
16+
kotlin {
17+
compilerOptions {
1618
// See https://github.com/readium/kotlin-toolkit/pull/525#issuecomment-2300084041
17-
freeCompilerArgs = freeCompilerArgs + ("-Xconsistent-data-class-copy-visibility")
19+
freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility")
1820
}
1921
}
2022

readium/navigator/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ android {
1717
}
1818

1919
kotlinOptions {
20+
}
21+
}
22+
23+
kotlin {
24+
compilerOptions {
2025
// See https://github.com/readium/kotlin-toolkit/pull/525#issuecomment-2300084041
21-
freeCompilerArgs = freeCompilerArgs + ("-Xconsistent-data-class-copy-visibility")
26+
freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility")
2227
}
2328
}
2429

readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Extensions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import androidx.core.content.ContextCompat
1414
/** returns true if the resolved layout direction of the content view in this
1515
* activity is ViewCompat.LAYOUT_DIRECTION_RTL. Otherwise false. */
1616
internal fun Activity.layoutDirectionIsRTL(): Boolean {
17-
return findViewById<View?>(android.R.id.content).layoutDirection == View.LAYOUT_DIRECTION_RTL
17+
return findViewById<View>(android.R.id.content).layoutDirection == View.LAYOUT_DIRECTION_RTL
1818
}
1919

2020
@ColorInt

readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2RTLViewPager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import androidx.viewpager.widget.ViewPager;
3232

3333
import org.readium.r2.navigator.preferences.ReadingProgression;
34+
import org.readium.r2.shared.InternalReadiumApi;
3435

3536
import java.util.HashMap;
3637

@@ -44,7 +45,8 @@
4445
* <code>OnPageChangeListener</code>s so that clients can be agnostic to layout direction and
4546
* modifications are kept internal to <code>RtlViewPager</code>.
4647
*/
47-
class R2RTLViewPager extends ViewPager {
48+
@InternalReadiumApi
49+
public class R2RTLViewPager extends ViewPager {
4850
public ReadingProgression direction = ReadingProgression.LTR;
4951
private int mLayoutDirection = ViewCompat.LAYOUT_DIRECTION_LTR;
5052
private HashMap<OnPageChangeListener, ReversingOnPageChangeListener> mPageChangeListeners = new HashMap<>();
@@ -59,9 +61,9 @@ public R2RTLViewPager(Context context, AttributeSet attrs) {
5961
@Override
6062
public void onRtlPropertiesChanged(int layoutDirection) {
6163
super.onRtlPropertiesChanged(layoutDirection);
62-
int viewCompatLayoutDirection = layoutDirection == View.LAYOUT_DIRECTION_RTL ? ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR;
64+
int viewCompatLayoutDirection = layoutDirection == View.LAYOUT_DIRECTION_RTL ? View.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR;
6365
if (direction == ReadingProgression.RTL) {
64-
viewCompatLayoutDirection = ViewCompat.LAYOUT_DIRECTION_RTL;
66+
viewCompatLayoutDirection = View.LAYOUT_DIRECTION_RTL;
6567
}
6668
if (viewCompatLayoutDirection != mLayoutDirection) {
6769
PagerAdapter adapter = super.getAdapter();

readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2ViewPager.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import android.content.Context
1414
import android.util.AttributeSet
1515
import android.view.MotionEvent
1616
import org.readium.r2.navigator.BuildConfig.DEBUG
17+
import org.readium.r2.shared.InternalReadiumApi
1718
import timber.log.Timber
1819

19-
internal class R2ViewPager : R2RTLViewPager {
20+
// See https://youtrack.jetbrains.com/issue/KTLC-271 for visibility issue.
21+
@InternalReadiumApi
22+
public class R2ViewPager : R2RTLViewPager {
2023

2124
internal enum class PublicationType {
2225
EPUB,
@@ -29,8 +32,8 @@ internal class R2ViewPager : R2RTLViewPager {
2932

3033
internal lateinit var publicationType: PublicationType
3134

32-
constructor(context: Context) : super(context)
33-
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
35+
internal constructor(context: Context) : super(context)
36+
internal constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
3437

3538
override fun setCurrentItem(item: Int) {
3639
super.setCurrentItem(item, false)

0 commit comments

Comments
 (0)