Skip to content

Commit

Permalink
[APT-10202] Gradle 8 Pre-Migration
Browse files Browse the repository at this point in the history
Performs changes needed to the gradle build script to Gradle 8.
  • Loading branch information
kabliz committed Jul 8, 2024
1 parent 4da44c0 commit eaf5291
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
13 changes: 9 additions & 4 deletions Armadillo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ plugins {
id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlin_version}"
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdk 34

Expand All @@ -28,8 +34,6 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName project.LIBRARY_VERSION
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'proguard-rules.pro'
buildConfigField("String", "VERSION_NAME", "\"${project.LIBRARY_VERSION}\"")
Expand All @@ -47,6 +51,7 @@ android {
buildFeatures {
buildConfig true
}
namespace 'com.scribd.armadillo'
}

dependencies {
Expand All @@ -68,8 +73,8 @@ dependencies {
testImplementation "org.robolectric:robolectric:4.5.1"
testImplementation 'junit:junit:4.13.2'
testImplementation("org.assertj:assertj-core:3.10.0")
testImplementation "org.mockito:mockito-core:2.28.2"
testImplementation("org.mockito.kotlin:mockito-kotlin:3.2.0") {
testImplementation "org.mockito:mockito-core:5.6.0"
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
Expand Down
3 changes: 1 addition & 2 deletions Armadillo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.scribd.armadillo">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.mockito.Mockito.times
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.whenever

class ExoplayerPlaybackEngineTest {
Expand Down Expand Up @@ -197,7 +197,7 @@ class ExoplayerPlaybackEngineTest {

playbackEngine.updateProgress()

verifyZeroInteractions(stateModifier)
verify(stateModifier, times(0)).dispatch(any())
}

@Test
Expand All @@ -208,7 +208,7 @@ class ExoplayerPlaybackEngineTest {

playbackEngine.updateProgress()

verifyZeroInteractions(stateModifier)
verify(stateModifier, times(0)).dispatch(any())
}

@Test
Expand All @@ -219,7 +219,7 @@ class ExoplayerPlaybackEngineTest {

playbackEngine.updateProgress()

verifyZeroInteractions(stateModifier)
verify(stateModifier, times(0)).dispatch(any())
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.whenever
import org.robolectric.RobolectricTestRunner
import org.robolectric.Shadows
Expand Down Expand Up @@ -128,7 +128,7 @@ class MediaSessionCallbackTest {
mediaSessionCallback.isPlaying = true
whenever(playbackInfo.audioPlayable).thenReturn(audiobookOne)
mediaSessionCallback.onPlayFromUri(URL.toUri(), bundleOne)
verifyZeroInteractions(mediaSessionCallback.playbackEngine!!)
verify(mediaSessionCallback, Mockito.times(0)).playbackEngine!!
}

@Test
Expand Down
11 changes: 9 additions & 2 deletions TestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdkVersion 32
compileSdk 34

compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -16,7 +22,7 @@ android {
defaultConfig {
applicationId "com.scribd.armadillotestapp"
minSdkVersion 21
targetSdkVersion 32
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -49,6 +55,7 @@ android {
dimension "ARMADILLO_SOURCE"
}
}
namespace 'com.scribd.armadillotestapp'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions TestApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.scribd.armadillotestapp">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ DAGGER_VERSION=2.16
MAVEN_PUBLISH_VERSION=3.6.2
DOKKA_VERSION=1.6.10
SERIALIZATON_VERSION=1.4.1
# Update package-list when updating build tools version
BUILD_TOOLS_VERSION=29.0.3
BUILD_TOOLS_VERSION=34.0.0
android.useAndroidX=true
android.enableJetifier=true
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.suppressUnsupportedCompileSdk=34

0 comments on commit eaf5291

Please sign in to comment.