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

gcp na support implementation #52

Merged
merged 5 commits into from
May 13, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ lib/
src/androidTest/java/com/builtio/contentstack/ApplicationTest.java
src/main/res/
contentstack/src/androidTest/java/com/contentstack/sdk/SyncTestCase.java

# key file
key.keystore
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# CHANGELOG

## Version 3.14.0

### Date: 13-May-2024

- GCP support implementation

---

## Version 3.13.0

### Date: 02-Feb-2024

- Fixed dependency installing issue
- Fixed Download Issue
- Error Status Code added
- Support of early access headers

---

## Version 3.12.4

Expand Down
16 changes: 8 additions & 8 deletions contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
coordinates("com.contentstack.sdk", "android", "3.13.0")
coordinates("com.contentstack.sdk", "android", "3.14.0")

pom {
name = "contentstack-android"
Expand Down Expand Up @@ -71,20 +71,20 @@ android {

testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
// jacoco {
// includeNoLocationClasses = true
// }
}
}
signingConfigs {
debug {
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
storeFile file("../key.keystore")
storePassword 'android'
keyAlias 'key0'
keyPassword 'android'
}
release {
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
storeFile file("../key.keystore")
storePassword 'android'
keyAlias 'key0'
keyPassword 'android'
Expand All @@ -98,7 +98,7 @@ android {
versionCode 1
versionName "1.0"
useLibrary 'org.apache.http.legacy'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
signingConfig signingConfigs.release
}

Expand Down Expand Up @@ -143,7 +143,7 @@ dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,17 @@ public void test_AZURE_NA() throws Exception {
stack = Contentstack.stack(appContext, DEFAULT_API_KEY, DEFAULT_DELIVERY_TOKEN, DEFAULT_ENV, config);
}

@Test
public void test_GCP_NA() throws Exception {
Config config = new Config();
String DEFAULT_API_KEY = BuildConfig.APIKey;
String DEFAULT_DELIVERY_TOKEN = BuildConfig.deliveryToken;
String DEFAULT_ENV = BuildConfig.environment;
String DEFAULT_HOST = BuildConfig.host;
config.setHost(DEFAULT_HOST);
config.setRegion(Config.ContentstackRegion.GCP_NA);
Context appContext = InstrumentationRegistry.getTargetContext();
stack = Contentstack.stack(appContext, DEFAULT_API_KEY, DEFAULT_DELIVERY_TOKEN, DEFAULT_ENV, config);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void setBranch(String branch) {
* config.setRegion(ContentstackRegion.EU);
* config.setRegion(ContentstackRegion.AZURE_EU);
* config.setRegion(ContentstackRegion.AZURE_NA);
* config.setRegion(ContentstackRegion.GCP_NA);
* }
* </pre>
*/
Expand All @@ -77,7 +78,7 @@ public Config earlyAccess(String[] earlyAccess) {
return this;
}

public enum ContentstackRegion {US, EU, AZURE_NA, AZURE_EU}
public enum ContentstackRegion {US, EU, AZURE_NA, AZURE_EU, GCP_NA}

/**
* Config constructor
Expand Down
2 changes: 2 additions & 0 deletions contentstack/src/main/java/com/contentstack/sdk/Stack.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ protected void setConfig(Config config) {
URL = "azure-na-cdn.contentstack.com";
} else if (region.equalsIgnoreCase("azure_eu")) {
URL = "azure-eu-cdn.contentstack.com";
} else if (region.equalsIgnoreCase("gcp_na")) {
URL = "gcp-na-cdn.contentstack.com";
} else {
URL = region + "-" + URL;
}
Expand Down
Loading