Skip to content

Commit cb41722

Browse files
author
Krzysztof Borowy
committed
small improvements
1 parent 9b19074 commit cb41722

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

android/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def getFlagOrDefault(flagName, defaultValue) {
2525
rootProject.hasProperty(flagName) ? rootProject.properties[flagName] == "true" : defaultValue
2626
}
2727

28-
def getVersionOfDefault(String flagName, String defaultVersion) {
28+
def getVersionOrDefault(String flagName, String defaultVersion) {
2929
rootProject.hasProperty(flagName) ? rootProject.properties[flagName] : defaultVersion
3030
}
3131

@@ -37,9 +37,7 @@ buildscript {
3737
// kotlin version is dictated by rootProject extension or property in gradle.properties
3838
ext.asyncStorageKtVersion = rootProject.ext.has('kotlinVersion')
3939
? rootProject.ext['kotlinVersion']
40-
: rootProject.hasProperty('AsyncStorage_kotlinVersion')
41-
? rootProject.properties['AsyncStorage_kotlinVersion']
42-
: '1.5.31'
40+
: getVersionOrDefault('AsyncStorage_kotlinVersion', '1.5.31')
4341

4442
repositories {
4543
google()
@@ -117,13 +115,13 @@ repositories {
117115
dependencies {
118116

119117
if (useNextStorage) {
120-
def room_version = getVersionOfDefault('AsyncStorage_next_roomVersion', '2.3.0')
118+
def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.3.0')
121119
def coroutines_version = "1.5.2"
122120
def coroutinesTest_version = "1.5.2"
123121
// if we don't provide explicit dependency on reflection, kotlin plugin
124122
// would add one automatically, probably a version that is not compatible with
125123
// used kotlin
126-
def kotlinReflect_version = "1.5.31"
124+
def kotlinReflect_version = project.ext.asyncStorageKtVersion
127125
def junit_version = "4.12"
128126
def robolectric_version = "4.5.1"
129127
def truth_version = "1.1.2"

example/android/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ buildscript {
4242
mavenCentral()
4343
jcenter()
4444
}
45+
ext.kotlinVersion = '1.5.31'
46+
4547
dependencies {
4648
classpath "com.android.tools.build:gradle:$androidPluginVersion"
4749
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"

0 commit comments

Comments
 (0)