Skip to content

Commit ba31381

Browse files
Merge pull request #52 from contentstack/feat/DX-67
gcp na support implementation
2 parents 61ada60 + 793a72d commit ba31381

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ lib/
4545
src/androidTest/java/com/builtio/contentstack/ApplicationTest.java
4646
src/main/res/
4747
contentstack/src/androidTest/java/com/contentstack/sdk/SyncTestCase.java
48+
49+
# key file
50+
key.keystore

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# CHANGELOG
22

3+
## Version 3.14.0
4+
5+
### Date: 13-May-2024
6+
7+
- GCP support implementation
8+
9+
---
10+
11+
## Version 3.13.0
12+
13+
### Date: 02-Feb-2024
14+
15+
- Fixed dependency installing issue
16+
- Fixed Download Issue
17+
- Error Status Code added
18+
- Support of early access headers
19+
20+
---
321

422
## Version 3.12.4
523

contentstack/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
1010
mavenPublishing {
1111
publishToMavenCentral(SonatypeHost.DEFAULT)
1212
signAllPublications()
13-
coordinates("com.contentstack.sdk", "android", "3.13.0")
13+
coordinates("com.contentstack.sdk", "android", "3.14.0")
1414

1515
pom {
1616
name = "contentstack-android"
@@ -71,20 +71,20 @@ android {
7171

7272
testOptions {
7373
unitTests.all {
74-
jacoco {
75-
includeNoLocationClasses = true
76-
}
74+
// jacoco {
75+
// includeNoLocationClasses = true
76+
// }
7777
}
7878
}
7979
signingConfigs {
8080
debug {
81-
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
81+
storeFile file("../key.keystore")
8282
storePassword 'android'
8383
keyAlias 'key0'
8484
keyPassword 'android'
8585
}
8686
release {
87-
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
87+
storeFile file("../key.keystore")
8888
storePassword 'android'
8989
keyAlias 'key0'
9090
keyPassword 'android'
@@ -98,7 +98,7 @@ android {
9898
versionCode 1
9999
versionName "1.0"
100100
useLibrary 'org.apache.http.legacy'
101-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
101+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
102102
signingConfig signingConfigs.release
103103
}
104104

@@ -143,7 +143,7 @@ dependencies {
143143
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
144144
testImplementation 'junit:junit:4.13.2'
145145
androidTestImplementation 'androidx.test:core:1.5.0'
146-
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
146+
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
147147
exclude group: 'com.android.support', module: 'support-annotations'
148148
})
149149
}

contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,17 @@ public void test_AZURE_NA() throws Exception {
178178
stack = Contentstack.stack(appContext, DEFAULT_API_KEY, DEFAULT_DELIVERY_TOKEN, DEFAULT_ENV, config);
179179
}
180180

181+
@Test
182+
public void test_GCP_NA() throws Exception {
183+
Config config = new Config();
184+
String DEFAULT_API_KEY = BuildConfig.APIKey;
185+
String DEFAULT_DELIVERY_TOKEN = BuildConfig.deliveryToken;
186+
String DEFAULT_ENV = BuildConfig.environment;
187+
String DEFAULT_HOST = BuildConfig.host;
188+
config.setHost(DEFAULT_HOST);
189+
config.setRegion(Config.ContentstackRegion.GCP_NA);
190+
Context appContext = InstrumentationRegistry.getTargetContext();
191+
stack = Contentstack.stack(appContext, DEFAULT_API_KEY, DEFAULT_DELIVERY_TOKEN, DEFAULT_ENV, config);
192+
}
193+
181194
}

contentstack/src/main/java/com/contentstack/sdk/Config.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void setBranch(String branch) {
5252
* config.setRegion(ContentstackRegion.EU);
5353
* config.setRegion(ContentstackRegion.AZURE_EU);
5454
* config.setRegion(ContentstackRegion.AZURE_NA);
55+
* config.setRegion(ContentstackRegion.GCP_NA);
5556
* }
5657
* </pre>
5758
*/
@@ -77,7 +78,7 @@ public Config earlyAccess(String[] earlyAccess) {
7778
return this;
7879
}
7980

80-
public enum ContentstackRegion {US, EU, AZURE_NA, AZURE_EU}
81+
public enum ContentstackRegion {US, EU, AZURE_NA, AZURE_EU, GCP_NA}
8182

8283
/**
8384
* Config constructor

contentstack/src/main/java/com/contentstack/sdk/Stack.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ protected void setConfig(Config config) {
8080
URL = "azure-na-cdn.contentstack.com";
8181
} else if (region.equalsIgnoreCase("azure_eu")) {
8282
URL = "azure-eu-cdn.contentstack.com";
83+
} else if (region.equalsIgnoreCase("gcp_na")) {
84+
URL = "gcp-na-cdn.contentstack.com";
8385
} else {
8486
URL = region + "-" + URL;
8587
}

0 commit comments

Comments
 (0)