Skip to content

Commit b3a446a

Browse files
authored
chore: use apiUrl param in latest android relay (#110)
* Use latest android SDK, use new baseUrl param * bump app version
1 parent 9504d98 commit b3a446a

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

package-testing/android-relay/app/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ val apiKey: String = gradleLocalProperties(
1515
val testRunnerHost: String = System.getenv("TEST_RUNNER_HOST") ?: "http://10.0.2.2"
1616
val testRunnerPort: String = System.getenv("TEST_RUNNER_PORT") ?: "3000"
1717

18-
val eppoAPIHost: String = System.getenv("EPPO_API_HOST") ?: "http://10.0.2.2"
19-
val eppoAPIPort: String = System.getenv("EPPO_API_PORT") ?: "5000"
18+
val eppoBaseUrl: String = System.getenv("EPPO_BASE_URL") ?: "http://10.0.2.2:5000/api"
2019

2120

2221
android {
@@ -30,7 +29,7 @@ android {
3029
minSdk = 26
3130
targetSdk = 34
3231
versionCode = 1
33-
versionName = "1.0"
32+
versionName = "1.1.0"
3433

3534
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3635
vectorDrawables {
@@ -40,8 +39,7 @@ android {
4039
buildConfigField( "String", "API_KEY", "\"" + apiKey + "\"")
4140
buildConfigField( "String", "TEST_RUNNER_HOST", "\"" +testRunnerHost+ "\"")
4241
buildConfigField( "String", "TEST_RUNNER_PORT", "\"" +testRunnerPort+ "\"")
43-
buildConfigField( "String", "EPPO_API_HOST", "\"" +eppoAPIHost+ "\"")
44-
buildConfigField( "String", "EPPO_API_PORT", "\"" +eppoAPIPort+ "\"")
42+
buildConfigField( "String", "EPPO_BASE_URL", "\"" +eppoBaseUrl+ "\"")
4543
}
4644

4745
buildTypes {

package-testing/android-relay/app/src/main/java/cloud/eppo/android/sdkrelay/TestClientActivity.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ class TestClientActivity : ComponentActivity() {
5454

5555
private fun assignmentLogger(assignment: Assignment) {
5656
val msg: String =
57-
((assignment.experiment + "-> subject: " + assignment.subject) +
57+
assignment.experiment +
58+
"-> subject: " +
59+
assignment.subject +
5860
" assigned to " +
59-
assignment.experiment)
61+
assignment.experiment
6062
Log.d(TAG, msg)
6163
appendAssignmentLog(msg)
6264
}
@@ -181,7 +183,7 @@ class TestClientActivity : ComponentActivity() {
181183
return EppoClient.Builder(API_KEY, application)
182184
.forceReinitialize(true)
183185
.ignoreCachedConfiguration(true)
184-
.host(EPPO_API_ADDRESS)
186+
.apiUrl(BuildConfig.EPPO_BASE_URL)
185187
.isGracefulMode(false) // Debug: surface exceptions
186188
.assignmentLogger(::assignmentLogger)
187189
.buildAndInitAsync()
@@ -241,7 +243,6 @@ class TestClientActivity : ComponentActivity() {
241243
private const val API_KEY = BuildConfig.API_KEY
242244
private const val READY_PACKET =
243245
"{\"sdkName\":\"example\", \"supportsBandits\" : false, \"sdkType\":\"client\"}"
244-
private const val EPPO_API_ADDRESS = "${BuildConfig.EPPO_API_HOST}:${BuildConfig.EPPO_API_PORT}"
245246
}
246247
}
247248

package-testing/android-relay/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
agp = "8.5.2"
3-
androidSdk = "4.3.0"
3+
androidSdk = "4.4.0"
44
jacksonDatabind = "2.18.0"
55
kotlin = "1.9.0"
66
coreKtx = "1.13.1"

0 commit comments

Comments
 (0)