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: Package move com.eppo.sdk -> cloud.eppo #83

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ java {
}

group = 'cloud.eppo'
version = '3.2.0-SNAPSHOT'
version = '4.0.0-SNAPSHOT'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumped major version since it's a breaking change

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

import org.apache.tools.ant.filters.ReplaceTokens
Expand All @@ -30,7 +30,6 @@ repositories {
}

dependencies {
// Re-export classes and interfaces that will be used upstream
api 'cloud.eppo:sdk-common-jvm:3.5.0'

implementation 'com.github.zafarkhaja:java-semver:0.10.2'
Expand All @@ -46,7 +45,7 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.2'
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'com.squareup.okhttp3:okhttp:4.9.1'
testImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
}

test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package com.eppo.sdk.helpers;
package cloud.eppo;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a conceptual level, is the android SDK a sub-implementation of the java SDK or are the android and java-server SDKs both parallel flavours of a jvm SDK?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both are separate, completely individual libraries. they can share the same package names though, AFAIK there are no constraints preventing that


import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AppDetails {
class AppDetails {
private static final Logger log = LoggerFactory.getLogger(AppDetails.class);
static AppDetails instance;
private final String version;
private final String name;

public static AppDetails getInstance() {
static AppDetails getInstance() {
if (instance == null) {
instance = new AppDetails();
}
return instance;
}

public AppDetails() {
AppDetails() {
Properties prop = new Properties();
try {
prop = readPropertiesFile("app.properties");
Expand All @@ -30,15 +30,15 @@ public AppDetails() {
this.name = prop.getProperty("app.name", "java-server-sdk");
}

public String getVersion() {
String getVersion() {
return this.version;
}

public String getName() {
String getName() {
return this.name;
}

public static Properties readPropertiesFile(String fileName) throws IOException {
static Properties readPropertiesFile(String fileName) throws IOException {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Properties props = new Properties();
InputStream resourceStream = loader.getResourceAsStream(fileName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.eppo.sdk;
package cloud.eppo;

import cloud.eppo.BaseEppoClient;
import cloud.eppo.api.IAssignmentCache;
import cloud.eppo.cache.ExpiringInMemoryAssignmentCache;
import cloud.eppo.cache.LRUInMemoryAssignmentCache;
import cloud.eppo.logging.AssignmentLogger;
import cloud.eppo.logging.BanditLogger;
import com.eppo.sdk.helpers.AppDetails;
import com.eppo.sdk.helpers.FetchConfigurationsTask;
import java.util.Timer;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.eppo.sdk.helpers;
package cloud.eppo;

import java.util.Timer;
import java.util.TimerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FetchConfigurationsTask extends TimerTask {
class FetchConfigurationsTask extends TimerTask {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

private static final Logger log = LoggerFactory.getLogger(FetchConfigurationsTask.class);
private final Runnable runnable;
private final Timer timer;
private final long intervalInMillis;
private final long jitterInMillis;

public FetchConfigurationsTask(
FetchConfigurationsTask(
Runnable runnable, Timer timer, long intervalInMillis, long jitterInMillis) {
this.runnable = runnable;
this.timer = timer;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/eppo/sdk/helpers/IPollerTask.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.eppo.sdk.helpers;
package cloud.eppo;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -15,7 +15,7 @@ public class AppDetailsTest {
@BeforeEach
public void nullOutInstanceToReset() {
try {
Class<?> appDetailsClass = Class.forName("com.eppo.sdk.helpers.AppDetails");
Class<?> appDetailsClass = Class.forName("cloud.eppo.AppDetails");
Field instanceField = appDetailsClass.getDeclaredField("instance");
instanceField.setAccessible(true);
instanceField.set(null, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.eppo.sdk;
package cloud.eppo;

import static cloud.eppo.helpers.AssignmentTestCase.parseTestCaseFile;
import static cloud.eppo.helpers.AssignmentTestCase.runTestCase;
Expand All @@ -8,8 +8,6 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.*;

import cloud.eppo.BaseEppoClient;
import cloud.eppo.EppoHttpClient;
import cloud.eppo.api.Attributes;
import cloud.eppo.api.BanditActions;
import cloud.eppo.api.BanditResult;
Expand Down