Skip to content

Commit d9c8bed

Browse files
authored
Update Kotlin and Gradle (#58)
1 parent 2cedcbe commit d9c8bed

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

readium/opds/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ All notable changes to this project will be documented in this file.
1010

1111
* New APIs using coroutines and R2's `HttpClient` instead of Fuel and kovenant (contributed by [@stevenzeck](https://github.com/readium/r2-opds-kotlin/pull/55)).
1212

13+
### Changed
14+
15+
* Upgraded to Kotlin 1.5.20.
16+
1317
### Fixed
1418

1519
* Links in an OPDS 2 feed are normalized to the feed base URL.

readium/opds/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.4.31'
4+
ext.kotlin_version = '1.5.20'
55

66
repositories {
77
google()
88
jcenter()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.1.2'
11+
classpath 'com.android.tools.build:gradle:4.2.2'
1212

1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Oct 29 14:00:53 CET 2020
1+
#Fri Jun 25 13:45:04 CEST 2021
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

readium/opds/r2-opds/build.gradle

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/*
2-
* Module: r2-opds-kotlin
3-
* Developers: Aferdita Muriqi, Clément Baumann
4-
*
5-
* Copyright (c) 2018. Readium Foundation. All rights reserved.
6-
* Use of this source code is governed by a BSD-style license which is detailed in the
7-
* LICENSE file present in the project repository where this source code is maintained.
2+
* Copyright 2018 Readium Foundation. All rights reserved.
3+
* Use of this source code is governed by the BSD-style license
4+
* available in the top-level LICENSE file of the project.
85
*/
96

107
apply plugin: 'com.android.library'
@@ -45,18 +42,18 @@ dependencies {
4542
implementation "com.github.readium:r2-shared-kotlin:develop-SNAPSHOT"
4643
}
4744

48-
implementation "androidx.appcompat:appcompat:1.3.0-beta1"
45+
implementation "androidx.appcompat:appcompat:1.3.0"
4946
implementation "com.jakewharton.timber:timber:4.7.1"
50-
implementation "joda-time:joda-time:2.10.5"
47+
implementation "joda-time:joda-time:2.10.10"
5148
implementation "nl.komponents.kovenant:kovenant:3.3.0"
52-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
49+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-native-mt"
5350

5451
testImplementation "androidx.test.ext:junit-ktx:1.1.2"
5552
testImplementation "androidx.test:core-ktx:1.3.0"
5653
testImplementation "junit:junit:4.13.2"
5754
testImplementation "net.sf.kxml:kxml2:2.3.0"
5855
testImplementation 'org.assertj:assertj-core:3.19.0'
59-
testImplementation "org.jetbrains.kotlin:kotlin-reflect"
56+
testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.5.20"
6057
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
6158
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2"
6259
testImplementation "org.json:json:20200518"

readium/opds/r2-opds/src/test/java/org/readium/r2/opds/OPDS1ParserTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ import org.joda.time.DateTime
44
import org.json.JSONObject
55
import org.junit.Assert.*
66
import org.junit.Test
7+
import org.junit.runner.RunWith
78
import org.readium.r2.shared.opds.Facet
89
import org.readium.r2.shared.opds.Feed
910
import org.readium.r2.shared.opds.OpdsMetadata
1011
import org.readium.r2.shared.opds.ParseData
1112
import org.readium.r2.shared.publication.*
1213
import org.readium.r2.shared.publication.Properties
14+
import org.robolectric.RobolectricTestRunner
1315
import java.net.URL
1416
import java.util.*
1517

18+
@RunWith(RobolectricTestRunner::class)
1619
class OPDS1ParserTest {
1720

1821
private val fixtures = Fixtures("opds1")

readium/opds/r2-opds/src/test/java/org/readium/r2/opds/TestUtils.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@ package org.readium.r2.opds
1212
import org.json.JSONArray
1313
import org.json.JSONObject
1414
import org.junit.Assert
15-
import org.readium.r2.shared.extensions.toList
16-
import org.readium.r2.shared.extensions.toMap
1715
import java.io.File
1816
import java.net.URL
1917

2018
/**
2119
* Asserts that two [JSONObject] are equal.
2220
*/
2321
fun assertJSONEquals(expected: JSONObject, actual: JSONObject) {
24-
Assert.assertEquals(expected.toMap(), actual.toMap())
22+
Assert.assertEquals(expected.toString(), actual.toString())
2523
}
2624

2725
/**
2826
* Asserts that two [JSONArray] are equal.
2927
*/
3028
fun assertJSONEquals(expected: JSONArray, actual: JSONArray) {
31-
Assert.assertEquals(expected.toList(), actual.toList())
29+
Assert.assertEquals(expected.toString(), actual.toString())
3230
}
3331

3432
class Fixtures(val path: String? = null) {
@@ -47,4 +45,4 @@ class Fixtures(val path: String? = null) {
4745
fun bytesAt(resourcePath: String): ByteArray =
4846
fileAt(resourcePath).readBytes()
4947

50-
}
48+
}

0 commit comments

Comments
 (0)