Skip to content

Commit d47d9d3

Browse files
authored
Merge pull request #91 from Eragoneq/master-tribler
Upgrade dependencies
2 parents 5016502 + a606cae commit d47d9d3

File tree

9 files changed

+28
-30
lines changed

9 files changed

+28
-30
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ file needs to define these variables and dependencies, too. A working template w
4949
folder's `build.gradle` file.
5050
- Don't forget to `include ':ipv8'` into your own `settings.gradle`,
5151
as well as the module that you're going to use, presumably `ipv8-android` or `ipv8-jvm`.
52-
- This repository currently uses Gradle version `6.1.1`. Ensure that your `gradle-wrapper.properties` uses the same version.
53-
- This repository currently uses Java version `1.8`. Ensure that your Gradle builds with this, too.
54-
- By default, Gradle looks at the `JAVA_HOME` variable, which might not point to `1.8`.
55-
- This repository currently uses Kotlin version `1.4.21`. Ensure that your Gradle builds with this Kotlin version.
52+
- This repository currently uses Gradle version `8.8.0`. Ensure that your `gradle-wrapper.properties` uses the same version.
53+
- This repository currently uses Java version `17`. Ensure that your Gradle builds with this, too.
54+
- By default, Gradle looks at the `JAVA_HOME` variable, which might not point to `17`.
55+
- This repository currently uses Kotlin version `2.1.10`. Ensure that your Gradle builds with this Kotlin version.
5656

5757
For an example of a project that uses this repository, refer to
5858
[the Trustchain app](https://github.com/Tribler/trustchain-superapp/).

build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
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.9.22'
5-
ext.coroutines_version = '1.6.4'
6-
ext.ktlint_version = '1.1.1'
7-
ext.ktlint_gradle_version = '12.1.0'
4+
ext.kotlin_version = '2.1.10'
5+
ext.coroutines_version = '1.10.1'
6+
ext.ktlint_version = '1.5.0'
7+
ext.ktlint_gradle_version = '12.1.2'
88
ext.sqldelight_version = '2.0.1'
9-
ext.nav_version = '2.5.3'
10-
ext.fragment_version = '1.5.4'
11-
ext.lifecycle_version = '2.5.1'
9+
ext.nav_version = '2.8.6'
10+
ext.fragment_version = '1.8.5'
11+
ext.lifecycle_version = '2.8.7'
1212
ext.dokka_version = '0.10.1'
13-
ext.mockk_version = '1.13.9'
13+
ext.mockk_version = '1.13.16'
1414
repositories {
1515
google()
1616
mavenCentral()
1717
maven { url "https://plugins.gradle.org/m2/" }
1818
maven { url 'https://jitpack.io' }
1919
}
2020
dependencies {
21-
classpath 'com.android.tools.build:gradle:8.2.0'
21+
classpath 'com.android.tools.build:gradle:8.8.0'
2222
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2323
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlint_gradle_version"
2424
classpath "app.cash.sqldelight:gradle-plugin:$sqldelight_version"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Jan 12 11:23:56 CET 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

ipv8/src/main/java/nl/tudelft/ipv8/attestation/identity/Metadata.kt

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class Metadata(
2222
return arrayOf(this.tokenPointer, this.signature, this.serializedJSONObject)
2323
}
2424

25-
@ExperimentalStdlibApi
2625
override fun toString(): String {
2726
return "Metadata(${this.tokenPointer.toHex()},\n${this.serializedJSONObject.toString(Charsets.UTF_8)}"
2827
}

ipv8/src/main/java/nl/tudelft/ipv8/util/HexUtils.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ fun String.hexToBytes(): ByteArray {
3030
val result = ByteArray(length / 2)
3131

3232
for (i in 0 until length step 2) {
33-
@Suppress("DEPRECATION")
34-
val firstIndex = HEX_CHARS.indexOf(this[i].toLowerCase())
35-
@Suppress("DEPRECATION")
36-
val secondIndex = HEX_CHARS.indexOf(this[i + 1].toLowerCase())
33+
val firstIndex = HEX_CHARS.indexOf(this[i].lowercaseChar())
34+
val secondIndex = HEX_CHARS.indexOf(this[i + 1].lowercaseChar())
3735

3836
val octet = firstIndex.shl(4).or(secondIndex)
3937
result[i.shr(1)] = octet.toByte()

ipv8/src/test/java/nl/tudelft/ipv8/BaseCommunityTest.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import io.mockk.mockk
88
import io.mockk.spyk
99
import kotlinx.coroutines.Dispatchers
1010
import kotlinx.coroutines.ExperimentalCoroutinesApi
11-
import kotlinx.coroutines.test.TestCoroutineDispatcher
11+
import kotlinx.coroutines.test.UnconfinedTestDispatcher
1212
import kotlinx.coroutines.test.resetMain
1313
import kotlinx.coroutines.test.setMain
1414
import nl.tudelft.ipv8.keyvault.LibNaClSK
@@ -22,7 +22,7 @@ private val lazySodium = LazySodiumJava(SodiumJava())
2222

2323
@OptIn(ExperimentalCoroutinesApi::class)
2424
abstract class BaseCommunityTest {
25-
private val testDispatcher = TestCoroutineDispatcher()
25+
private val testDispatcher = UnconfinedTestDispatcher()
2626

2727
@Before
2828
fun setUp() {
@@ -32,7 +32,6 @@ abstract class BaseCommunityTest {
3232
@After
3333
fun tearDown() {
3434
Dispatchers.resetMain() // reset main dispatcher to the original Main dispatcher
35-
testDispatcher.cleanupTestCoroutines()
3635
}
3736

3837
protected fun getPrivateKey(): PrivateKey {

ipv8/src/test/java/nl/tudelft/ipv8/attestation/trustchain/TrustChainCrawlerTest.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import io.mockk.coEvery
66
import io.mockk.spyk
77
import kotlinx.coroutines.ExperimentalCoroutinesApi
88
import kotlinx.coroutines.test.runBlockingTest
9+
import kotlinx.coroutines.test.runTest
910
import nl.tudelft.ipv8.BaseCommunityTest
1011
import nl.tudelft.ipv8.Peer
1112
import nl.tudelft.ipv8.attestation.trustchain.store.TrustChainSQLiteStore
@@ -39,7 +40,7 @@ class TrustChainCrawlerTest : BaseCommunityTest() {
3940
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
4041
@Test
4142
fun crawlChain_noop() =
42-
runBlockingTest {
43+
runTest {
4344
val crawler = TrustChainCrawler()
4445
val trustChainCommunity = spyk(getCommunity())
4546
crawler.trustChainCommunity = trustChainCommunity
@@ -71,7 +72,7 @@ class TrustChainCrawlerTest : BaseCommunityTest() {
7172
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
7273
@Test
7374
fun crawlChain_singleBlock() =
74-
runBlockingTest {
75+
runTest {
7576
val crawler = TrustChainCrawler()
7677
val trustChainCommunity = spyk(getCommunity())
7778
crawler.trustChainCommunity = trustChainCommunity
@@ -124,7 +125,7 @@ class TrustChainCrawlerTest : BaseCommunityTest() {
124125
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
125126
@Test
126127
fun crawlChain_fillGap() =
127-
runBlockingTest {
128+
runTest {
128129
val crawler = TrustChainCrawler()
129130
val trustChainCommunity = spyk(getCommunity())
130131
crawler.trustChainCommunity = trustChainCommunity

ipv8/src/test/java/nl/tudelft/ipv8/messaging/tftp/TFTPEndpointTest.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package nl.tudelft.ipv8.messaging.tftp
33
import io.mockk.*
44
import kotlinx.coroutines.ExperimentalCoroutinesApi
55
import kotlinx.coroutines.test.runBlockingTest
6+
import kotlinx.coroutines.test.runTest
67
import nl.tudelft.ipv8.IPv4Address
78
import org.apache.commons.net.tftp.TFTP
89
import org.apache.commons.net.tftp.TFTPAckPacket
@@ -17,7 +18,7 @@ import java.net.InetAddress
1718
class TFTPEndpointTest {
1819
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
1920
@Test
20-
fun send() = runBlockingTest {
21+
fun send() = runTest {
2122
val tftpClient = spyk<TFTPClient>()
2223
val socket = mockk<DatagramSocket>(relaxed = true)
2324
val tftpEndpoint = TFTPEndpoint(tftpClient)
@@ -42,7 +43,7 @@ class TFTPEndpointTest {
4243

4344
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
4445
/* @Test */
45-
fun onPacket_forServer() = runBlockingTest {
46+
fun onPacket_forServer() = runTest {
4647
val tftpClient = mockk<TFTPClient>(relaxed = true)
4748
val socket = mockk<DatagramSocket>(relaxed = true)
4849
val tftpEndpoint = TFTPEndpoint(tftpClient)
@@ -73,7 +74,7 @@ class TFTPEndpointTest {
7374

7475
@Suppress("DEPRECATION") // TODO: rewrite usage of coroutines in testing.
7576
@Test
76-
fun onPacket_forClient() = runBlockingTest {
77+
fun onPacket_forClient() = runTest {
7778
val tftpClient = TFTPClient()
7879
val socket = mockk<DatagramSocket>(relaxed = true)
7980
val tftpEndpoint = TFTPEndpoint(tftpClient)

ipv8/src/test/java/nl/tudelft/ipv8/util/HexUtilsTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package nl.tudelft.ipv8.util
33
import org.junit.Assert
44
import org.junit.Test
55
import java.lang.IllegalArgumentException
6+
import java.util.*
67

78
class HexUtilsTest {
89
@Test
@@ -32,8 +33,7 @@ class HexUtilsTest {
3233
fun hexToBytesToHex() {
3334
val txid = "d19306e0"
3435
Assert.assertEquals(txid, txid.hexToBytes().toHex())
35-
@Suppress("DEPRECATION")
36-
Assert.assertEquals(txid, txid.toUpperCase().hexToBytes().toHex())
36+
Assert.assertEquals(txid, txid.uppercase(Locale.getDefault()).hexToBytes().toHex())
3737
}
3838

3939
@Test(expected = IllegalArgumentException::class)

0 commit comments

Comments
 (0)