Skip to content

Commit

Permalink
chore: latest from the common package and move /api to baseUrl (#132)
Browse files Browse the repository at this point in the history
* chore: latest common package and move api to baseUrl
* bump version for release
  • Loading branch information
typotter authored Jan 6, 2025
1 parent 7121162 commit c30c719
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ feature flagging and experimentation for Eppo customers. An API key is required

```groovy
dependencies {
implementation 'cloud.eppo:android-sdk:4.3.3'
implementation 'cloud.eppo:android-sdk:4.4.0'
}
dependencyResolutionManagement {
Expand Down
4 changes: 2 additions & 2 deletions eppo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "cloud.eppo"
version = "4.3.6-SNAPSHOT"
version = "4.4.0"

android {
buildFeatures.buildConfig true
Expand Down Expand Up @@ -68,7 +68,7 @@ ext.versions = [
]

dependencies {
api 'cloud.eppo:sdk-common-jvm:3.5.4'
api 'cloud.eppo:sdk-common-jvm:3.6.0'

implementation 'org.slf4j:slf4j-api:2.0.16'

Expand Down
22 changes: 16 additions & 6 deletions eppo/src/main/java/cloud/eppo/android/EppoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@

public class EppoClient extends BaseEppoClient {
private static final String TAG = logTag(EppoClient.class);
private static final String DEFAULT_HOST = "https://fscdn.eppo.cloud";
private static final boolean DEFAULT_IS_GRACEFUL_MODE = true;
private static final boolean DEFAULT_OBFUSCATE_CONFIG = true;

@Nullable private static EppoClient instance;

private EppoClient(
String apiKey,
String host,
String sdkName,
String sdkVersion,
@Deprecated @Nullable String host,
@Nullable String apiBaseUrl,
@Nullable AssignmentLogger assignmentLogger,
IConfigurationStore configurationStore,
boolean isGracefulMode,
Expand All @@ -48,6 +48,7 @@ private EppoClient(
sdkName,
sdkVersion,
host,
apiBaseUrl,
assignmentLogger,
null,
configurationStore,
Expand All @@ -65,11 +66,13 @@ private EppoClient(
public static EppoClient init(
@NonNull Application application,
@NonNull String apiKey,
@NonNull String host,
@Nullable String host,
@Nullable String apiBaseUrl,
@Nullable AssignmentLogger assignmentLogger,
boolean isGracefulMode) {
return new Builder(apiKey, application)
.host(host)
.apiBaseUrl(apiBaseUrl)
.assignmentLogger(assignmentLogger)
.isGracefulMode(isGracefulMode)
.obfuscateConfig(DEFAULT_OBFUSCATE_CONFIG)
Expand Down Expand Up @@ -112,7 +115,8 @@ protected EppoValue getTypedAssignment(
}

public static class Builder {
@NonNull private String host = DEFAULT_HOST;
private String host;
private String apiBaseUrl;
private final Application application;
private final String apiKey;
@Nullable private AssignmentLogger assignmentLogger;
Expand All @@ -132,11 +136,16 @@ public Builder(@NonNull String apiKey, @NonNull Application application) {
this.apiKey = apiKey;
}

public Builder host(String host) {
public Builder host(@Nullable String host) {
this.host = host;
return this;
}

public Builder apiBaseUrl(@Nullable String apiBaseUrl) {
this.apiBaseUrl = apiBaseUrl;
return this;
}

public Builder assignmentLogger(AssignmentLogger assignmentLogger) {
this.assignmentLogger = assignmentLogger;
return this;
Expand Down Expand Up @@ -225,9 +234,10 @@ public CompletableFuture<EppoClient> buildAndInitAsync() {
instance =
new EppoClient(
apiKey,
host,
sdkName,
sdkVersion,
host,
apiBaseUrl,
assignmentLogger,
configStore,
isGracefulMode,
Expand Down

0 comments on commit c30c719

Please sign in to comment.