Skip to content

Commit

Permalink
chore: upgrading dependencies (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 authored Jul 6, 2023
1 parent 4564980 commit 459fb1d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
31 changes: 31 additions & 0 deletions compose-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ android {
versionCode 1
versionName "1.0"

buildConfigField 'String', 'BASIS_THEORY_API_KEY', tryFindProperty('com.basistheory.android.compose.example.apiKey')

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
Expand Down Expand Up @@ -65,4 +67,33 @@ dependencies {
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
}

/**
* Searches for the value of a gradle property defined with the given name, preferring values
* defined in local.properties, if available.
* <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 tryFindProperty(String name) {
var localProperties = tryReadLocalProperties()
var propertyValue = localProperties[name] ?: findProperty(name)

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

Properties tryReadLocalProperties() {
def properties = new Properties()

try {
def propFile = rootProject.file("./local.properties")
properties.load(new FileInputStream(propFile))
} catch (ignored) {
}

return properties
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlinx.coroutines.runBlocking
class MainActivity : AppCompatActivity() {

private val bt = BasisTheoryElements.builder()
.apiKey("key_7jc18XCxYYozHbepjpWHqU")
.apiKey(BuildConfig.BASIS_THEORY_API_KEY)
.build()

private lateinit var cardNumberElement: CardNumberElement
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
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.25'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.26'
implementation 'com.github.basis-theory:basistheory-java:0.5.0'

androidTestImplementation 'junit:junit:4.13.2'
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ 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.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
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.threeten:threetenbp:1.6.8'
implementation 'com.github.basis-theory:basistheory-java:0.5.0'
Expand Down
1 change: 1 addition & 0 deletions local.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sdk.dir=/Users/[replace]/Library/Android/sdk
com.basistheory.android.example.apiUrl=https://api.basistheory.com
# [required] A Basis Theory API key with `token:create` permission on the `/` container
com.basistheory.android.example.apiKey=[replace]
com.basistheory.android.compose.example.apiKey=[replace]

0 comments on commit 459fb1d

Please sign in to comment.