Skip to content

Commit

Permalink
feat: Bump AGP 8.0.2, Gradle 8.3.0, Kotlin 1.8.21, Prod & Test Libs t…
Browse files Browse the repository at this point in the history
…o latest
  • Loading branch information
abdallaadelessa committed Sep 13, 2023
1 parent 5028b14 commit 702e2fd
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 44 deletions.
7 changes: 5 additions & 2 deletions bento-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ext.projectDescription = 'A library which provides compatability for Jetpack Com
apply from: "$rootDir/publishing.gradle"

android {
namespace 'com.yelp.android.bento.compose'

compileSdkVersion Versions.COMPILE_SDK

defaultConfig {
Expand All @@ -16,8 +18,9 @@ android {
versionName Publishing.VERSION
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
compileOptions {
sourceCompatibility = Versions.SOURCE_COMPATIBILITY
targetCompatibility = Versions.TARGET_COMPATIBILITY
}

buildTypes {
Expand Down
7 changes: 5 additions & 2 deletions bento-sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
namespace 'com.yelp.android.bentosampleapp'

compileSdkVersion Versions.COMPILE_SDK

defaultConfig {
Expand All @@ -14,8 +16,9 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
compileOptions {
sourceCompatibility = Versions.SOURCE_COMPATIBILITY
targetCompatibility = Versions.TARGET_COMPATIBILITY
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ class MainActivityTest {
val rule: RuleChain = RuleChain.outerRule(beforeRule).around(intentsTestRule)

@Test
fun onData_atPosition2_clickOpensListViewActivity() {
BentoInteraction.onData(anything()).atPosition(6)
.check(ViewAssertions.matches(ViewMatchers.withText("List View")))
.perform(ViewActions.click())

fun onData_atPosition8_clickOpensListViewActivity() {
BentoInteraction.onData(anything()).atPosition(8).perform(ViewActions.click())
Intents.intended(IntentMatchers.hasComponent(ListViewActivity::class.qualifiedName))
}

@Test
fun onData_atPosition0_clickOpensRecyclerViewActivity() {
BentoInteraction.onData(anything()).atPosition(0).perform(ViewActions.click())

fun onData_atPosition2_clickOpensRecyclerViewActivity() {
BentoInteraction.onData(anything()).atPosition(2).perform(ViewActions.click())
Intents.intended(IntentMatchers.hasComponent(RecyclerViewActivity::class.qualifiedName))
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.yelp.android.bentosampleapp

import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
Expand All @@ -24,7 +26,9 @@ class RecyclerViewActivityTest {

@Test
fun withAsyncInflationEnabled_scrollingDownDoesntCrash_andDisplaysItems() {
onView(withId(R.id.recyclerView)).perform(ViewActions.swipeUp())
onView(withId(R.id.recyclerView)).perform(
RecyclerViewActions.scrollToPosition<RecyclerView.ViewHolder>(40)
)
onView(ViewMatchers.withText("List element 20"))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.viewpager.widget.ViewPager
import com.google.android.material.tabs.TabLayout
import com.yelp.android.bento.R
import com.yelp.android.bento.componentcontrollers.TabViewPagerComponentController
import com.yelp.android.bentosampleapp.components.LabeledComponent

Expand Down
7 changes: 5 additions & 2 deletions bento-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ext.projectDescription = 'A library for testing Android user interfaces created
apply from: "$rootDir/publishing.gradle"

android {
namespace 'com.yelp.android.bento.test'

compileSdkVersion Versions.COMPILE_SDK

defaultConfig {
Expand All @@ -16,8 +18,9 @@ android {
versionName Publishing.VERSION
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
compileOptions {
sourceCompatibility = Versions.SOURCE_COMPATIBILITY
targetCompatibility = Versions.TARGET_COMPATIBILITY
}

buildTypes {
Expand Down
10 changes: 7 additions & 3 deletions bento/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ext.projectDescription = 'A framework for building modularized Android user inte
apply from: "$rootDir/publishing.gradle"

android {
namespace 'com.yelp.android.bento'

compileSdkVersion Versions.COMPILE_SDK

defaultConfig {
Expand All @@ -18,8 +20,9 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
compileOptions {
sourceCompatibility = Versions.SOURCE_COMPATIBILITY
targetCompatibility = Versions.TARGET_COMPATIBILITY
}

buildTypes {
Expand All @@ -39,7 +42,8 @@ android {
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier.convention('sources');
archiveClassifier.set('sources');
from android.sourceSets.main.java.sourceFiles
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.yelp.android.bento.components

import androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup
import com.nhaarman.mockitokotlin2.never
import com.nhaarman.mockitokotlin2.spy
import com.nhaarman.mockitokotlin2.verify
import org.mockito.kotlin.never
import org.mockito.kotlin.spy
import org.mockito.kotlin.verify
import com.yelp.android.bento.core.TestComponentViewHolder
import org.junit.Assert.assertEquals
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.ApplicationProvider
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.spy
import com.nhaarman.mockitokotlin2.whenever
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.spy
import org.mockito.kotlin.whenever
import junit.framework.Assert.assertNotNull
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
Expand All @@ -19,6 +20,11 @@ subprojects {
google()
mavenCentral()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
}

// If you want to update the Gradle version, change this number and then run `./gradlew wrapper`.
Expand Down
40 changes: 22 additions & 18 deletions buildSrc/src/main/java/com/yelp/gradle/bento/GlobalDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@ object Publishing {
}

object Versions {
const val COMPILE_SDK = 33
const val COMPILE_SDK = 34
const val TARGET_SDK = 33
const val MIN_SDK = 21

// Java
const val SOURCE_COMPATIBILITY = 11
const val TARGET_COMPATIBILITY = 11

// In alphabetical order.
const val APACHE_COMMONS = "3.4"
const val ANDROID_GRADLE = "7.4.2"
const val ANDROID_X_APP_COMPAT = "1.0.0"
const val ANDROID_X_CONSTRAINT_LAYOUT = "1.1.2"
const val APACHE_COMMONS = "3.7"
const val ANDROID_GRADLE = "8.0.2"
const val ANDROID_X_APP_COMPAT = "1.3.1"
const val ANDROID_X_CONSTRAINT_LAYOUT = "2.0.1"
const val ANDROID_X_CORE_CTX = "1.4.0"
const val ANDROID_X_LIFECYCLE = "2.3.1"
const val ANDROID_X_MATERIAL = "1.0.0"
const val ANDROID_X_LIFECYCLE = "2.6.2"
const val ANDROID_X_MATERIAL = "1.3.0"
const val ANDROID_X_RECYCLER_VIEW = "1.3.0"
const val ANDROID_X_TEST = "1.1.0"
const val ANDROID_X_TEST = "1.4.0"
const val ANDROID_X_VIEW_PAGER2 = "1.0.0"
const val COMPOSE = "1.4.0"
const val COMPOSE_KOTLIN_COMPILER = "1.4.4"
const val COROUTINES = "1.4.0"
const val ESPRESSO = "3.1.0"
const val GRADLE = "7.5.1"
const val COMPOSE = "1.5.0"
const val COMPOSE_KOTLIN_COMPILER = "1.4.7"
const val COROUTINES = "1.5.1"
const val ESPRESSO = "3.5.0"
const val GRADLE = "8.3.0"
const val GUAVA = "28.1-android"
const val JUNIT = "4.12"
const val KOTLIN = "1.8.10"
const val KOTLIN = "1.8.21"
const val MAVEN_SETTINGS = "0.5"
const val MOCKITO = "3.11.2"
const val MOCKITO_KOTLIN = "2.1.0"
const val ROBOLECTRIC = "4.7.3"
const val MOCKITO = "5.1.1"
const val MOCKITO_KOTLIN = "5.0.0"
const val ROBOLECTRIC = "4.9.2"
const val RX_JAVA_3 = "3.0.7"
const val SUPPORT_TEST = "1.0.2"
}
Expand Down Expand Up @@ -80,7 +84,7 @@ object TestLibs {
const val ESPRESSO_INTENTS = "androidx.test.espresso:espresso-intents:${Versions.ESPRESSO}"
const val JUNIT = "junit:junit:${Versions.JUNIT}"
const val MOCKITO = "org.mockito:mockito-core:${Versions.MOCKITO}"
const val MOCKITO_KOTLIN = "com.nhaarman.mockitokotlin2:mockito-kotlin:${Versions.MOCKITO_KOTLIN}"
const val MOCKITO_KOTLIN = "org.mockito.kotlin:mockito-kotlin:${Versions.MOCKITO_KOTLIN}"
const val ROBOLECTRIC = "org.robolectric:robolectric:${Versions.ROBOLECTRIC}"
const val SUPPORT_TEST_RULES = "androidx.test:rules:${Versions.ANDROID_X_TEST}"
const val SUPPORT_TEST_RUNNER = "androidx.test:runner:${Versions.ANDROID_X_TEST}"
Expand Down
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-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
from components.getByName('release')
groupId = Publishing.GROUP
version = Publishing.VERSION

Expand Down

0 comments on commit 702e2fd

Please sign in to comment.