Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: latest from the common package and move /api to baseUrl #132

Merged
merged 6 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.5"
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
Loading