Skip to content

Commit f807756

Browse files
authored
Update Android Gradle Plugin to 7.1.0 (#84)
1 parent 251d7ca commit f807756

File tree

15 files changed

+78
-77
lines changed

15 files changed

+78
-77
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,5 @@ lint/reports/
8080

8181
# Docs
8282
docs/readium
83+
docs/index.md
84+
docs/package-list

build.gradle.kts

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,11 @@
66

77
import org.jetbrains.dokka.gradle.DokkaTaskPartial
88

9-
buildscript {
10-
val kotlinVersion by extra("1.6.10")
11-
val dokkaVersion by extra("1.5.30")
12-
13-
repositories {
14-
google()
15-
jcenter()
16-
mavenLocal()
17-
mavenCentral()
18-
maven(url = "https://jitpack.io")
19-
maven(url = "https://s3.amazonaws.com/repo.commonsware.com")
20-
}
21-
dependencies {
22-
classpath("com.android.tools.build:gradle:7.0.4")
23-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
24-
classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion")
25-
}
26-
}
27-
28-
apply(plugin = "org.jetbrains.dokka")
29-
30-
allprojects {
31-
repositories {
32-
google()
33-
jcenter()
34-
mavenLocal()
35-
mavenCentral()
36-
maven(url = "https://jitpack.io")
37-
maven(url = "https://s3.amazonaws.com/repo.commonsware.com")
38-
}
9+
plugins {
10+
id("com.android.application") version ("7.1.0") apply false
11+
id("com.android.library") version ("7.1.0") apply false
12+
id("org.jetbrains.kotlin.android") version ("1.6.10") apply false
13+
id("org.jetbrains.dokka") version ("1.6.10") apply true
3914
}
4015

4116
subprojects {

readium/lcp/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ afterEvaluate {
5555
dependencies {
5656
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
5757

58-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
58+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
5959

6060
api(project(":readium:shared"))
6161

62-
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
62+
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
6363
implementation("androidx.core:core-ktx:1.7.0")
64-
implementation("com.google.android.material:material:1.4.0")
64+
implementation("com.google.android.material:material:1.5.0")
6565
implementation("com.jakewharton.timber:timber:5.0.1")
6666
implementation("com.mcxiaoke.koi:async:0.5.5") {
6767
exclude(module = "support-v4")
@@ -74,7 +74,7 @@ dependencies {
7474
implementation("androidx.browser:browser:1.4.0")
7575

7676
// Room database
77-
val roomVersion = "2.4.0"
77+
val roomVersion = "2.4.1"
7878
implementation("androidx.room:room-runtime:$roomVersion")
7979
implementation("androidx.room:room-ktx:$roomVersion")
8080
kapt("androidx.room:room-compiler:$roomVersion")

readium/lcp/src/main/java/org/readium/r2/lcp/service/DeviceService.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99

1010
package org.readium.r2.lcp.service
1111

12+
import android.Manifest
1213
import android.bluetooth.BluetoothManager
1314
import android.content.Context
1415
import android.content.SharedPreferences
16+
import android.content.pm.PackageManager
17+
import androidx.core.app.ActivityCompat
1518
import org.readium.r2.lcp.license.model.LicenseDocument
1619
import org.readium.r2.lcp.license.model.components.Link
1720
import timber.log.Timber
@@ -36,7 +39,15 @@ internal class DeviceService(private val repository: DeviceRepository, private v
3639
context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager
3740
val bluetoothName =
3841
try {
39-
bluetoothManager.adapter.name
42+
if (ActivityCompat.checkSelfPermission(
43+
context,
44+
Manifest.permission.BLUETOOTH_CONNECT
45+
) != PackageManager.PERMISSION_GRANTED
46+
) {
47+
null
48+
} else {
49+
bluetoothManager.adapter.name
50+
}
4051
} catch (e: Exception) {
4152
Timber.e(e)
4253
null

readium/navigator-media2/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
}
1414

1515
android {
16-
resourcePrefix = "readium_"
16+
resourcePrefix = "readium_"
1717

1818
compileSdk = 31
1919

@@ -61,8 +61,8 @@ dependencies {
6161
api(project(":readium:shared"))
6262
api(project(":readium:navigator"))
6363

64-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2")
65-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
64+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
65+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
6666

6767
implementation("com.jakewharton.timber:timber:5.0.1")
6868

readium/navigator/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ dependencies {
6262
api(project(":readium:shared"))
6363

6464
implementation("androidx.activity:activity-ktx:1.4.0")
65-
implementation("androidx.appcompat:appcompat:1.4.0")
65+
implementation("androidx.appcompat:appcompat:1.4.1")
6666
implementation("androidx.browser:browser:1.4.0")
67-
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
67+
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
6868
implementation("androidx.core:core-ktx:1.7.0")
6969
implementation("androidx.fragment:fragment-ktx:1.4.0")
7070
implementation("androidx.legacy:legacy-support-core-ui:1.0.0")
@@ -92,12 +92,12 @@ dependencies {
9292
api("com.google.android.exoplayer:extension-mediasession:2.16.1")
9393
api("com.google.android.exoplayer:extension-media2:2.16.1")
9494
api("com.google.android.exoplayer:extension-workmanager:2.16.1")
95-
implementation("com.google.android.material:material:1.4.0")
95+
implementation("com.google.android.material:material:1.5.0")
9696
implementation("com.jakewharton.timber:timber:5.0.1")
9797
implementation("com.shopgun.android:utils:1.0.9")
9898
implementation("joda-time:joda-time:2.10.13")
99-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2")
100-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
99+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
100+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
101101
// AM NOTE: needs to stay this version for now (June 24,2020)
102102
//noinspection GradleDependency
103103
implementation("org.jsoup:jsoup:1.14.3")

readium/opds/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ dependencies {
5353

5454
api(project(":readium:shared"))
5555

56-
implementation("androidx.appcompat:appcompat:1.4.0")
56+
implementation("androidx.appcompat:appcompat:1.4.1")
5757
implementation("com.jakewharton.timber:timber:5.0.1")
5858
implementation("joda-time:joda-time:2.10.13")
5959
implementation("nl.komponents.kovenant:kovenant:3.3.0")
60-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
60+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
6161

6262
// Tests
6363
testImplementation("junit:junit:4.13.2")

readium/shared/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ afterEvaluate {
5555
dependencies {
5656
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
5757

58-
implementation("androidx.appcompat:appcompat:1.4.0")
58+
implementation("androidx.appcompat:appcompat:1.4.1")
5959
implementation("androidx.browser:browser:1.4.0")
6060
implementation("com.github.kittinunf.fuel:fuel-android:2.3.1")
6161
implementation("com.github.kittinunf.fuel:fuel:2.3.1")
@@ -68,14 +68,14 @@ dependencies {
6868
implementation("nl.komponents.kovenant:kovenant-jvm:3.3.0")
6969
implementation("nl.komponents.kovenant:kovenant:3.3.0")
7070
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.10")
71-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
71+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
7272
implementation("org.jsoup:jsoup:1.14.3")
7373

7474
// Tests
7575
testImplementation("junit:junit:4.13.2")
76-
testImplementation("org.assertj:assertj-core:3.21.0")
76+
testImplementation("org.assertj:assertj-core:3.22.0")
7777
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.6.10")
78-
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2")
78+
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
7979
testImplementation("org.robolectric:robolectric:4.7.3")
8080

8181
androidTestImplementation("androidx.test.ext:junit:1.1.3")

readium/shared/src/test/java/org/readium/r2/shared/publication/services/LocatorServiceTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package org.readium.r2.shared.publication.services
88

99
import kotlinx.coroutines.ExperimentalCoroutinesApi
10-
import kotlinx.coroutines.test.runBlockingTest
10+
import kotlinx.coroutines.test.runTest
1111
import org.junit.Test
1212
import org.readium.r2.shared.publication.Link
1313
import org.readium.r2.shared.publication.Locator
@@ -19,7 +19,7 @@ class LocatorServiceTest {
1919

2020
// locate(Locator) checks that the href exists.
2121
@Test
22-
fun `locate from Locator`() = runBlockingTest {
22+
fun `locate from Locator`() = runTest {
2323
val service = createService(readingOrder = listOf(
2424
Link(href = "chap1", type = "application/xml"),
2525
Link(href = "chap2", type = "application/xml"),
@@ -30,14 +30,14 @@ class LocatorServiceTest {
3030
}
3131

3232
@Test
33-
fun `locate from Locator with empty reading order`() = runBlockingTest {
33+
fun `locate from Locator with empty reading order`() = runTest {
3434
val service = createService(readingOrder = emptyList())
3535
val locator = Locator(href = "chap2", type = "text/html", text = Locator.Text(highlight = "Highlight"))
3636
assertNull(service.locate(locator))
3737
}
3838

3939
@Test
40-
fun `locate from Locator not found`() = runBlockingTest {
40+
fun `locate from Locator not found`() = runTest {
4141
val service = createService(readingOrder = listOf(
4242
Link(href = "chap1", type = "application/xml"),
4343
Link(href = "chap3", type = "application/xml")
@@ -47,7 +47,7 @@ class LocatorServiceTest {
4747
}
4848

4949
@Test
50-
fun `locate from progression`() = runBlockingTest {
50+
fun `locate from progression`() = runTest {
5151
val service = createService(positions = positionsFixtures)
5252

5353
assertEquals(Locator(
@@ -116,14 +116,14 @@ class LocatorServiceTest {
116116
}
117117

118118
@Test
119-
fun `locate from incorrect progression`() = runBlockingTest {
119+
fun `locate from incorrect progression`() = runTest {
120120
val service = createService(positions = positionsFixtures)
121121
assertNull(service.locateProgression(-0.2))
122122
assertNull(service.locateProgression(1.2))
123123
}
124124

125125
@Test
126-
fun `locate from progression with empty positions`() = runBlockingTest {
126+
fun `locate from progression with empty positions`() = runTest {
127127
val service = createService(positions = emptyList())
128128
assertNull(service.locateProgression(0.5))
129129
}

readium/streamer/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import android.annotation.SuppressLint
2-
31
/*
42
* Copyright 2018 Readium Foundation. All rights reserved.
53
* Use of this source code is governed by the BSD-style license
@@ -59,7 +57,7 @@ dependencies {
5957

6058
api(project(":readium:shared"))
6159

62-
implementation("androidx.appcompat:appcompat:1.4.0")
60+
implementation("androidx.appcompat:appcompat:1.4.1")
6361
@Suppress("GradleDependency")
6462
implementation("com.github.barteksc:pdfium-android:1.8.2")
6563
implementation("com.jakewharton.timber:timber:5.0.1")
@@ -78,11 +76,11 @@ dependencies {
7876
exclude(module = "support-v4")
7977
}
8078
implementation("joda-time:joda-time:2.10.13")
81-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
79+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
8280

8381
// Tests
8482
testImplementation("junit:junit:4.13.2")
85-
testImplementation("org.assertj:assertj-core:3.21.0")
83+
testImplementation("org.assertj:assertj-core:3.22.0")
8684
testImplementation("org.robolectric:robolectric:4.7.3")
8785
androidTestImplementation("androidx.test.ext:junit:1.1.3")
8886
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")

0 commit comments

Comments
 (0)