Skip to content

Commit

Permalink
feat: updating dependencies and library tools/languages versions (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 authored Oct 31, 2023
1 parent 0a1435f commit 9433d32
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 54 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
buildscript {
ext {
compose_ui_version = '1.3.2'
compose_ui_version = '1.5.3'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.21' apply false
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
}
12 changes: 6 additions & 6 deletions compose-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace 'com.basistheory.android.compose.example'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.basistheory.android.compose.example"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -29,17 +29,17 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.7'
kotlinCompilerExtensionVersion '1.5.3'
}
packagingOptions {
resources {
Expand Down
32 changes: 18 additions & 14 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace 'com.basistheory.android.example'
compileSdk 32
compileSdk 33

defaultConfig {
applicationId 'com.basistheory.android.example'
minSdk 21
targetSdk 32
targetSdk 33
versionCode 1
versionName "1.0"

Expand All @@ -27,11 +27,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
buildFeatures {
viewBinding true
Expand All @@ -55,7 +55,9 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.threeten:threetenbp:1.6.8'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.27'
implementation 'com.github.basis-theory:basistheory-java:0.5.0'
implementation('com.github.basis-theory:basistheory-java:1.1.0') {
exclude group: 'javax.ws.rs', module: 'javax.ws.rs-api'
}

androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
Expand All @@ -65,9 +67,14 @@ dependencies {
androidTestImplementation 'com.github.javafaker:javafaker:1.0.2'
}

configurations.all {
resolutionStrategy {
force 'org.yaml:snakeyaml:1.33'
configurations.configureEach {
resolutionStrategy.eachDependency { details ->
if (details.requested.module.toString() == 'org.yaml:snakeyaml') {
details.artifactSelection {
it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
details.useVersion("2.2")
}
}
}

Expand All @@ -77,15 +84,12 @@ configurations.all {
* <p>
* Note: buildConfigField requires a string value that is entered literally into an autogenerated source
* file. Strings must be wrapped in quotes to be rendered as [String property = "value"] and the
* string "null" is rendered as [String property = null] in the autogenerated BuildConfig file.
*/
* string "null" is rendered as [String property = null] in the autogenerated BuildConfig file.*/
String tryFindProperty(String name) {
var localProperties = tryReadLocalProperties()
var propertyValue = localProperties[name] ?: findProperty(name)

return propertyValue != null
? "\"${propertyValue}\""
: "null"
return propertyValue != null ? "\"${propertyValue}\"" : "null"
}

Properties tryReadLocalProperties() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.basistheory.android.example

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.action.ViewActions.typeText
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isEnabled
import androidx.test.espresso.matcher.ViewMatchers.withHint
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.rules.activityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.basistheory.android.example.util.waitUntilVisible
import com.basistheory.android.example.view.MainActivity
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.not
import org.junit.Assert.*
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import java.time.LocalDate

class ProxyRevealTests {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ kotlin.code.style=official
android.nonTransitiveRClass=true
# Configures the library to use the maven-publish plugin
# https://stackoverflow.com/questions/71365373/software-components-will-not-be-created-automatically-for-maven-publishing-from
android.disableAutomaticComponentCreation=true
android.defaults.buildfeatures.buildconfig=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 24 15:39:27 MDT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
36 changes: 21 additions & 15 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ plugins {

android {
namespace 'com.basistheory.android'
compileSdk 32
compileSdk 34

defaultConfig {
minSdk 21
targetSdk 32
versionName = '3.1.0'
targetSdk 34

buildConfigField 'String', 'VERSION_NAME', "\"${defaultConfig.versionName}\""

Expand All @@ -28,11 +27,11 @@ android {
compileOptions {
coreLibraryDesugaringEnabled = true

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
testOptions {
unitTests {
Expand Down Expand Up @@ -69,25 +68,32 @@ dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'org.threeten:threetenbp:1.6.8'
implementation 'com.github.basis-theory:basistheory-java:1.0.0'
implementation('com.github.basis-theory:basistheory-java:1.1.0') {
exclude group: 'javax.ws.rs', module: 'javax.ws.rs-api'
}
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
implementation 'com.google.code.gson:gson:2.10.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'io.strikt:strikt-core:0.34.1'
testImplementation 'com.github.javafaker:javafaker:1.0.2'
testImplementation 'io.mockk:mockk:1.13.5'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation("com.squareup.okhttp3:mockwebserver:4.11.0")
testImplementation 'com.github.javafaker:javafaker:1.0.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}

configurations.all {
resolutionStrategy {
force 'org.yaml:snakeyaml:1.33'
configurations.configureEach {
resolutionStrategy.eachDependency { details ->
if (details.requested.module.toString() == 'org.yaml:snakeyaml') {
details.artifactSelection {
it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
details.useVersion("2.2")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.android.controller.ActivityController
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.hasSize
import strikt.assertions.isEmpty
import strikt.assertions.isFalse
import strikt.assertions.isTrue


@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class BlurEventTests {
private lateinit var activityController: ActivityController<Activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.android.controller.ActivityController
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.hasSize
import strikt.assertions.isFalse
import strikt.assertions.isTrue
import strikt.assertions.single


@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class ChangeEventTests {
private lateinit var activityController: ActivityController<Activity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package com.basistheory.android.event

import android.app.Activity
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.widget.EditText
import android.widget.FrameLayout
import android.widget.LinearLayout
import com.basistheory.android.view.TextElement
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.android.controller.ActivityController
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.*


@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class FocusEventTests {
private lateinit var activityController: ActivityController<Activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import strikt.api.expectCatching
import strikt.api.expectThat
import strikt.assertions.isA
Expand All @@ -49,6 +50,7 @@ import java.time.temporal.ChronoUnit
import java.util.*
import javax.inject.Inject

@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class BasisTheoryElementsTests {
private val faker = Faker()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import com.basistheory.android.util.mapObjToRequestBody
import com.basistheory.android.util.convertObjectToFormUrlEncoded
import com.basistheory.android.util.encodeParamsToFormUrlEncoded
import com.github.javafaker.Faker
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.isEqualTo
import strikt.assertions.isFalse
import strikt.assertions.isTrue
import strikt.assertions.single
import java.time.LocalDate

@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class CardExpirationDateElementTests {
private lateinit var cardExpirationDateElement: CardExpirationDateElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.*

@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class CardNumberElementTests {
private lateinit var cardNumberElement: CardNumberElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.*
import kotlin.text.get

@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class CardVerificationCodeElementTests {
private lateinit var cvcElement: CardVerificationCodeElement
Expand Down Expand Up @@ -84,7 +85,8 @@ class CardVerificationCodeElementTests {

@Test
fun `setting card number element multiple times does not duplicate listeners`() {
val cardNumberElement = spyk(CardNumberElement(Robolectric.buildActivity(Activity::class.java).get()))
val cardNumberElement =
spyk(CardNumberElement(Robolectric.buildActivity(Activity::class.java).get()))
cvcElement.cardNumberElement = cardNumberElement
cvcElement.cardNumberElement = cardNumberElement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import strikt.api.expectThat
import strikt.assertions.*

@Config(sdk = [33]) // TODO remove once Roboelectric releases a new version supporting SDK 34 https://github.com/robolectric/robolectric/issues/8404
@RunWith(RobolectricTestRunner::class)
class TextElementTests {
private lateinit var textElement: TextElement
Expand Down

0 comments on commit 9433d32

Please sign in to comment.