Skip to content

Commit

Permalink
feat(*): upgrade AGP to 8.5 and dependencies.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Jul 10, 2024
1 parent accc2ed commit c5fbd1e
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 52 deletions.
30 changes: 15 additions & 15 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
compileSdk = AndroidVersions.COMPILE_SDK

defaultConfig {
minSdk = AndroidVersions.MIN_SDK
minSdk = 21
versionCode = 1
versionName = "$version"

Expand Down Expand Up @@ -41,19 +41,19 @@ android {

dependencies {
implementation(project(":srtdroid-ktx"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.22")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.multidex:multidex:2.0.1")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("com.google.guava:guava:32.1.2-jre")

testImplementation("junit:junit:4.13.2")

androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation(libs.kotlin.stdlib.jdk7)
implementation(libs.appcompat)
implementation(libs.core.ktx)
implementation(libs.constraintlayout)
implementation(libs.multidex)
implementation(libs.preference.ktx)
implementation(libs.navigation.fragment.ktx)
implementation(libs.navigation.ui.ktx)
implementation(libs.guava)

testImplementation(libs.junit)

androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
}

31 changes: 28 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
[versions]
agp = "8.3.2"
dokkaBase = "1.9.20"
agp = "8.5.0"
androidxJunit = "1.2.1"
appcompat = "1.7.0"
constraintlayout = "2.1.4"
coreKtx = "1.13.1"
dokka = "1.9.20"
espressoCore = "3.6.1"
guava = "32.1.3-jre"
junit = "4.13.2"
kotlin = "1.9.22"
multidex = "2.0.1"
navigationFragmentKtx = "2.7.7"
preferenceKtx = "1.2.1"
runner = "1.6.1"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidxJunit" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigationFragmentKtx" }
preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
rules = { module = "androidx.test:rules", version.ref = "runner" }
runner = { module = "androidx.test:runner", version.ref = "runner" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokkaBase" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 8 additions & 8 deletions srtdroid-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ android {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.22")
implementation("androidx.core:core-ktx:1.12.0")
implementation(libs.kotlin.stdlib.jdk7)
implementation(libs.core.ktx)

testImplementation("junit:junit:4.13.2")
testImplementation(libs.junit)

androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("com.google.guava:guava:32.1.2-jre")
androidTestImplementation(libs.junit)
androidTestImplementation(libs.runner)
androidTestImplementation(libs.rules)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.guava)
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RejectReasonCodeTest {

@Test
fun toStringTest() {
RejectReasonCode.values().forEach {
RejectReasonCode.entries.forEach {
assertNotNull(it.toString())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TranstypeTest {
@Test
fun nativeConversion() {
val socket = SrtSocket()
Transtype.values()
Transtype.entries
.filter { it != Transtype.INVALID }
.forEach {
socket.setSockFlag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@
*/
package io.github.thibaultbee.srtdroid.core.models

import androidx.test.ext.junit.runners.AndroidJUnit4
import io.github.thibaultbee.srtdroid.core.Srt
import io.github.thibaultbee.srtdroid.core.enums.ErrorType
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.runner.RunWith
import java.net.SocketException


/*
* Theses tests are written to check if SRT API can be called from the Kotlin part.
*/

@RunWith(AndroidJUnit4::class)
class ErrorTest {
private var socket = SrtSocket()

Expand All @@ -45,7 +42,7 @@ class ErrorTest {
fun getErrorTest() {
try {
socket.listen(3)
} catch (e: SocketException) {
} catch (_: SocketException) {
}
assertEquals(Error.lastError, ErrorType.EUNBOUNDSOCK)
assertEquals(Error.lastErrorMessage, ErrorType.EUNBOUNDSOCK.toString())
Expand All @@ -55,7 +52,7 @@ class ErrorTest {
fun clearErrorTest() {
try {
socket.listen(3)
} catch (e: SocketException) {
} catch (_: SocketException) {
}
assertEquals(Error.lastError, ErrorType.EUNBOUNDSOCK)
Error.clearLastError()
Expand All @@ -64,7 +61,7 @@ class ErrorTest {

@Test
fun allValuesTest() {
ErrorType.values().forEach {
ErrorType.entries.forEach {
assertNotNull(it.toString())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package io.github.thibaultbee.srtdroid.core.models

import androidx.test.ext.junit.runners.AndroidJUnit4
import io.github.thibaultbee.srtdroid.core.Srt
import io.github.thibaultbee.srtdroid.core.enums.ErrorType
import io.github.thibaultbee.srtdroid.core.enums.RejectReasonCode
Expand All @@ -30,15 +29,12 @@ import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.net.SocketException


/*
* Theses tests are written to check if SRT API can be called from the Kotlin part.
*/

@RunWith(AndroidJUnit4::class)
class SrtSocket6Test {
private lateinit var socket: SrtSocket

Expand Down Expand Up @@ -107,7 +103,7 @@ class SrtSocket6Test {
try {
assertNull(socket.sockName)
fail()
} catch (e: Exception) {
} catch (_: Exception) {
}
socket.bind("::1", 6666)
assertEquals(socket.sockName.address.hostAddress, "::1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package io.github.thibaultbee.srtdroid.core.models

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import io.github.thibaultbee.srtdroid.core.Srt
import io.github.thibaultbee.srtdroid.core.enums.Boundary
Expand All @@ -37,7 +36,6 @@ import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.io.File
import java.io.IOException
import java.net.SocketException
Expand All @@ -48,7 +46,6 @@ import java.nio.ByteBuffer
* Theses tests are written to check if SRT API can be called from the Kotlin part.
*/

@RunWith(AndroidJUnit4::class)
class SrtSocketTest {
private lateinit var socket: SrtSocket

Expand Down Expand Up @@ -134,7 +131,7 @@ class SrtSocketTest {
try {
assertNull(socket.sockName)
fail()
} catch (e: Exception) {
} catch (_: Exception) {
}
}

Expand All @@ -143,7 +140,7 @@ class SrtSocketTest {
try {
assertNull(socket.sockName)
fail()
} catch (e: Exception) {
} catch (_: Exception) {
}
socket.bind("127.0.3.1", 1239)
assertEquals("127.0.3.1", socket.sockName.address.hostAddress)
Expand All @@ -155,7 +152,7 @@ class SrtSocketTest {
try {
socket.getSockFlag(SockOpt.TRANSTYPE) // Write only property
fail()
} catch (e: IOException) {
} catch (_: IOException) {
}
assertEquals(true, socket.getSockFlag(SockOpt.RCVSYN))
assertEquals(-1, socket.getSockFlag(SockOpt.SNDTIMEO))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ private constructor(private val srtsocket: Int) : ConfigurableSrtSocket, Closeab
get() {
val code = nativeGetRejectReason()
return when {
code < RejectReasonCode.PREDEFINED_OFFSET -> InternalRejectReason(RejectReasonCode.values()[code])
code < RejectReasonCode.PREDEFINED_OFFSET -> InternalRejectReason(RejectReasonCode.entries[code])
code < RejectReasonCode.USERDEFINED_OFFSET -> PredefinedRejectReason(code - RejectReasonCode.PREDEFINED_OFFSET)
else -> UserDefinedRejectReason(
code - RejectReasonCode.USERDEFINED_OFFSET
Expand Down
10 changes: 5 additions & 5 deletions srtdroid-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ android {
dependencies {
api(project(":srtdroid-core"))

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation(libs.core.ktx)
implementation(libs.appcompat)

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
}

0 comments on commit c5fbd1e

Please sign in to comment.