From 81f3a738ba272353171fce8e28c20af25623fe45 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 6 May 2024 16:20:56 +0530 Subject: [PATCH 1/5] feat: gcp support implementation --- .gitignore | 3 +++ .../java/com/contentstack/sdk/AssetTestCase.java | 13 +++++++++++++ .../src/main/java/com/contentstack/sdk/Config.java | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 968028b6..66adfeb1 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java b/contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java index 5cca358e..7137b885 100644 --- a/contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java +++ b/contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java @@ -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); + } + } diff --git a/contentstack/src/main/java/com/contentstack/sdk/Config.java b/contentstack/src/main/java/com/contentstack/sdk/Config.java index 7d188ece..4391548a 100755 --- a/contentstack/src/main/java/com/contentstack/sdk/Config.java +++ b/contentstack/src/main/java/com/contentstack/sdk/Config.java @@ -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); * } * */ @@ -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 From 124817cdd4791024d789d867f527a9c3ef60ab17 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 6 May 2024 16:39:13 +0530 Subject: [PATCH 2/5] updated path for keystore --- contentstack/build.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 06aa4346..3b20dcca 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -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' @@ -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 } @@ -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' }) } From 4fce92fe32eba7b0164c9da14db4071e223cb01f Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Tue, 7 May 2024 17:17:43 +0530 Subject: [PATCH 3/5] chore: version bump to 3.14.0 --- .gitignore | 2 +- contentstack/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 66adfeb1..24d917a9 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ src/main/res/ contentstack/src/androidTest/java/com/contentstack/sdk/SyncTestCase.java # key file -key.keystore \ No newline at end of file +# key.keystore \ No newline at end of file diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 3b20dcca..c7540b6e 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -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" From b81588f5ff896607cd2a52a6b1e9a86a1d7ed523 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Tue, 7 May 2024 17:26:33 +0530 Subject: [PATCH 4/5] changeLog updated --- .gitignore | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 24d917a9..66adfeb1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ src/main/res/ contentstack/src/androidTest/java/com/contentstack/sdk/SyncTestCase.java # key file -# key.keystore \ No newline at end of file +key.keystore \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c0dd00a9..330d6032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 793a72dced4c7fb621c9637db3c34d2231191730 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Wed, 8 May 2024 11:58:54 +0530 Subject: [PATCH 5/5] specified host name in stack.java --- contentstack/src/main/java/com/contentstack/sdk/Stack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contentstack/src/main/java/com/contentstack/sdk/Stack.java b/contentstack/src/main/java/com/contentstack/sdk/Stack.java index d5bcb87b..a7f0c0c3 100755 --- a/contentstack/src/main/java/com/contentstack/sdk/Stack.java +++ b/contentstack/src/main/java/com/contentstack/sdk/Stack.java @@ -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; }