From 3b8d4d860c14f728c43099cfb8fa691989a88889 Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Wed, 3 Apr 2024 21:26:49 +0100 Subject: [PATCH 1/7] fix: added publish workflow --- .github/workflows/codeql-analysis.yml | 11 +++++++ .github/workflows/publish-release.yml | 37 ++++++++++++++++++++++ .github/workflows/publish-snapshot.yml | 44 ++++++++++++++++++++++++++ .github/workflows/sca-scan.yml | 11 +++++++ 4 files changed, 103 insertions(+) create mode 100644 .github/workflows/publish-release.yml create mode 100644 .github/workflows/publish-snapshot.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9d241b91..8278860f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,6 +35,17 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Setup local.properties + run: | + cat << EOF >> local.properties + sdk.dir=$ANDROID_HOME + host="${{ secrets.HOST }}" + APIKey="${{ secrets.API_KEY }}" + deliveryToken="${{ secrets.DELIVERY_TOKEN }}" + environment="${{ secrets.ENVIRONMENT }}" + contentType="${{ secrets.CONTENT_TYPE }}" + assetUid="${{ secrets.ASSET_UID }}" + EOF # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 00000000..8f281843 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,37 @@ +name: Publish - Release + +on: + release: + types: [released] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Setup local.properties + run: | + cat << EOF >> local.properties + sdk.dir=$ANDROID_HOME + host="${{ secrets.HOST }}" + APIKey="${{ secrets.API_KEY }}" + deliveryToken="${{ secrets.DELIVERY_TOKEN }}" + environment="${{ secrets.ENVIRONMENT }}" + contentType="${{ secrets.CONTENT_TYPE }}" + assetUid="${{ secrets.ASSET_UID }}" + EOF + - name: Gradle build and clean + run: | + ./gradlew clean build + - name: Publish the SDK + run: | + ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }} \ No newline at end of file diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 00000000..a2f7d496 --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,44 @@ +name: Publish - Snapshot + +on: + push: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Check whether the version is a snapshot + run: | + if grep -q "\-SNAPSHOT" ./contentstack/build.gradle + then + : + else + exit 1 + fi + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Setup local.properties + run: | + cat << EOF >> local.properties + sdk.dir=$ANDROID_HOME + host="${{ secrets.HOST }}" + APIKey="${{ secrets.API_KEY }}" + deliveryToken="${{ secrets.DELIVERY_TOKEN }}" + environment="${{ secrets.ENVIRONMENT }}" + contentType="${{ secrets.CONTENT_TYPE }}" + assetUid="${{ secrets.ASSET_UID }}" + EOF + - name: Build the SDK - Snapshot + run: | + ./gradlew clean build + - name: Publish the SDK - Snapshot + run: | + ./gradlew publishAllPublicationsToMavenCentralRepository + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }} \ No newline at end of file diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml index 7fa03ee3..482bc0f7 100644 --- a/.github/workflows/sca-scan.yml +++ b/.github/workflows/sca-scan.yml @@ -7,6 +7,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - name: Setup local.properties + run: | + cat << EOF >> local.properties + sdk.dir=$ANDROID_HOME + host="${{ secrets.HOST }}" + APIKey="${{ secrets.API_KEY }}" + deliveryToken="${{ secrets.DELIVERY_TOKEN }}" + environment="${{ secrets.ENVIRONMENT }}" + contentType="${{ secrets.CONTENT_TYPE }}" + assetUid="${{ secrets.ASSET_UID }}" + EOF - uses: snyk/actions/setup@master - run: snyk test env: From 8a62788cedf02cec7de66fa42ffd1d57403b69da Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Sun, 28 Apr 2024 15:31:53 +0100 Subject: [PATCH 2/7] fix: fixed on push statement --- .github/workflows/publish-snapshot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index a2f7d496..b43da5ae 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -2,6 +2,8 @@ name: Publish - Snapshot on: push: + branches: + - master jobs: publish: From daaf8a189922eb4c555cde4a7f9d67e11d5a144f Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 6 May 2024 16:20:56 +0530 Subject: [PATCH 3/7] feat: gcp support implementation --- .gitignore | 3 + contentstack/build.gradle | 26 +++- .../com/contentstack/sdk/AssetTestCase.java | 13 ++ .../java/com/contentstack/sdk/Config.java | 3 +- .../main/java/com/contentstack/sdk/Stack.java | 111 ++++-------------- 5 files changed, 66 insertions(+), 90 deletions(-) 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/build.gradle b/contentstack/build.gradle index 396cbf68..06aa4346 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -4,12 +4,13 @@ plugins { } import com.vanniktech.maven.publish.SonatypeHost + android.buildFeatures.buildConfig true mavenPublishing { publishToMavenCentral(SonatypeHost.DEFAULT) signAllPublications() - coordinates("com.contentstack.sdk", "android", "3.14.0") + coordinates("com.contentstack.sdk", "android", "3.13.0") pom { name = "contentstack-android" @@ -39,7 +40,23 @@ mavenPublishing { } } + +tasks.register('jacocoTestReport', JacocoReport) { + dependsOn['testDebugUnitTest', 'createDebugCoverageReport'] + reports { + html.enabled = true + } + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, exclude: '**com/contentstack/okhttp**') + fileTree(dir: it, exclude: '**com/contentstack/okio**') + fileTree(dir: it, exclude: '**com/contentstack/txtmark**') + })) + } +} + android { + //namespace "com.contentstack.sdk" packagingOptions { exclude("META-INF/DEPENDENCIES") exclude("META-INF/LICENSE") @@ -52,12 +69,10 @@ android { exclude("META-INF/*.kotlin_module") } - testOptions { unitTests.all { jacoco { includeNoLocationClasses = true - excludes = ['jdk.internal.*'] } } } @@ -77,6 +92,7 @@ android { } compileSdk 30 defaultConfig { + // Required when setting minSdkVersion to 20 or lower multiDexEnabled true minSdkVersion 23 versionCode 1 @@ -94,6 +110,7 @@ android { debuggable true testCoverageEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + buildConfigField "String", "host", localProperties['host'] buildConfigField "String", "APIKey", localProperties['APIKey'] buildConfigField "String", "deliveryToken", localProperties['deliveryToken'] @@ -115,12 +132,14 @@ android { } configurations { archives } dependencies { + def multidex = "2.0.1" def volley = "1.2.1" def junit = "4.13.2" configurations.configureEach { resolutionStrategy.force 'com.android.support:support-annotations:23.1.0' } implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "com.android.volley:volley:$volley" implementation "junit:junit:$junit" + // For AGP 7.4+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:core:1.5.0' @@ -139,5 +158,6 @@ tasks.register('createJar', Jar) { archivesBaseName = "contentstack.jar" from('build/contentstack-jar/') include 'com/contentstack/' + //include 'META-INF/' } createJar.dependsOn(clearJar, unzip, build) 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 diff --git a/contentstack/src/main/java/com/contentstack/sdk/Stack.java b/contentstack/src/main/java/com/contentstack/sdk/Stack.java index 06e3e1a0..d5bcb87b 100755 --- a/contentstack/src/main/java/com/contentstack/sdk/Stack.java +++ b/contentstack/src/main/java/com/contentstack/sdk/Stack.java @@ -25,7 +25,7 @@ /** * To fetch stack level information of your application from Contentstack server. *

- * Created by ishaileshmishra. + * Created by Shailesh Mishra. * Contentstack pvt Ltd */ public class Stack implements INotifyClass { @@ -51,7 +51,7 @@ protected Stack() { } protected Stack(String apiKey) { - if (apiKey == null) { + if (apiKey==null){ Objects.requireNonNull("Please provide a valid ApiKey"); } this.stackApiKey = apiKey; @@ -291,17 +291,17 @@ private String getImageUrl() { * This call returns comprehensive information of all the content types available in a particular stack in your account. *

Example :
*

-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 JSONObject params = new JSONObject();
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 params.put("include_snippet_schema", true);
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 params.put("limit", 3);
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 stack.getContentTypes(params, new ContentTypesCallback() {
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 @Override  public void onCompletion(ContentTypesModel contentTypesModel, Error error) {
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 if (error == null){
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // do your stuff.
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 }
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 }
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 });
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+ * JSONObject params = new JSONObject(); + * params.put("include_snippet_schema", true); + * params.put("limit", 3); + * stack.getContentTypes(params, new ContentTypesCallback() { + * @Override public void onCompletion(ContentTypesModel contentTypesModel, Error error) { + * if (error == null){ + * // do your stuff. + * } + * } + * }); + * */ public void getContentTypes(JSONObject params, final ContentTypesCallback callback) { try { @@ -348,14 +348,15 @@ private void fetchContentTypes(String urlString, JSONObject urlQueries, ArrayMap * It returns all the published entries and assets of the specified stack in response. * The response also contains a sync token, which you need to store, * since this token is used to get subsequent delta updates later. + * + *

Example :
*
-     *                                                                                 

Example :
- * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); - *
- * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. + * + * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); + * stack.syncPaginationToken(pagination_token, new SyncResultCallBack()) {} + * */ - @Deprecated public void sync(SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); @@ -383,9 +384,7 @@ public void sync(SyncResultCallBack syncCallBack) { * stack.syncPaginationToken(pagination_token, new SyncResultCallBack()) {} * * - * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ - @Deprecated public void syncPaginationToken(String paginationToken, SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); @@ -405,9 +404,8 @@ public void syncPaginationToken(String paginationToken, SyncResultCallBack syncC * and the details of the content that was deleted or updated. *

Example :
*
-     *                                                                                                                         @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)}  instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+ * */ - @Deprecated public void syncToken(String syncToken, SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); @@ -418,42 +416,6 @@ public void syncToken(String syncToken, SyncResultCallBack syncCallBack) { this.requestSync(syncCallBack); } - - /** - * The initSeqSync is used to make initial call to receive data in sequential pattern, based on sequence id - * - * @param syncCallBack the callback that contains response or error - */ - public void initSeqSync(SyncResultCallBack syncCallBack) { - try { - this.syncParams = new JSONObject(); - this.syncParams.put("init", true); - this.syncParams.put("seq_id", true); - } catch (JSONException e) { - Log.e(TAG, Objects.requireNonNull(e.getLocalizedMessage())); - } - this.requestSync(syncCallBack); - } - - - /** - * Use the sequential token to receive data in sequential manner, based on sequence id - * - * @param seqId the sequence id - * @param syncCallBack the callback that contains response or error - */ - public void seqSync(String seqId, SyncResultCallBack syncCallBack) { - Objects.requireNonNull(seqId, "SequenceId should not be null"); - try { - this.syncParams = new JSONObject(); - this.syncParams.put("seq_id", seqId); - } catch (JSONException e) { - Log.e(TAG, Objects.requireNonNull(e.getLocalizedMessage())); - } - this.requestSync(syncCallBack); - } - - /** * @param fromDate Enter the start date for initial sync. * @param syncCallBack Returns callback for sync result. @@ -463,10 +425,9 @@ public void seqSync(String seqId, SyncResultCallBack syncCallBack) { * *

Example :
*
-     *                                                              stack.syncFromDate(start_date, new SyncResultCallBack()) { }
-     *                                          @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)}  instead.
+     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            stack.syncFromDate(start_date, new SyncResultCallBack()) { }
+     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
*/ - @Deprecated public void syncFromDate(Date fromDate, SyncResultCallBack syncCallBack) { String startFromDate = convertUTCToISO(fromDate); try { @@ -487,9 +448,7 @@ public void syncFromDate(Date fromDate, SyncResultCallBack syncCallBack) { * To do this, use syncContentType and specify the content type uid as its value. * However, if you do this, the subsequent syncs will only include the entries of the specified content_type. *

- * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ - @Deprecated public void syncContentType(String contentType, SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); @@ -516,9 +475,7 @@ private String convertUTCToISO(Date date) { * To do this, use syncLocale and specify the locale code as its value. * However, if you do this, the subsequent syncs will only include the entries of the specified locales. * - * @deprecated This method is deprecated. Use {@link #syncLocale(String, SyncResultCallBack)} ()} instead. */ - @Deprecated() public void syncLocale(Language language, SyncResultCallBack syncCallBack) { String localeCode = getLanguageCode(language); try { @@ -538,12 +495,10 @@ public void syncLocale(Language language, SyncResultCallBack syncCallBack) { * To do this, use syncLocale and specify the locale code as its value. * However, if you do this, the subsequent syncs will only include the entries of the specified locales. * - * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ - @Deprecated public void syncLocale(String localeCode, SyncResultCallBack syncCallBack) { - if (localeCode == null) { - Objects.requireNonNull("Locale code can not be null"); + if (localeCode==null){ + Objects.requireNonNull("localeCode can not be null"); } try { this.syncParams = new JSONObject(); @@ -568,11 +523,10 @@ public void syncLocale(String localeCode, SyncResultCallBack syncCallBack) { * * stackInstance.syncPublishType(Stack.PublishType.ENTRY_PUBLISHED, new SyncResultCallBack()) { } * + * * - * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ - @Deprecated public void syncPublishType(PublishType type, SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); @@ -609,21 +563,11 @@ private String getLanguageCode(Language language) { * */ - @Deprecated public void sync(String contentType, Date fromDate, Language language, PublishType type, SyncResultCallBack syncCallBack) { String locale = getLanguageCode(language); sync(contentType, fromDate, locale, type, syncCallBack); } - /** - * @param contentType the contentType of which you want to get content - * @param fromDate the date - * @param locale the locale - * @param type PublishType of the content like, entry_published, asset_published - * @param syncCallBack the sync Callback - * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. - */ - @Deprecated public void sync(String contentType, Date fromDate, String locale, PublishType type, SyncResultCallBack syncCallBack) { String startFromDate = convertUTCToISO(fromDate); try { @@ -669,14 +613,9 @@ private void requestSync(final SyncResultCallBack callback) { public void onCompletion(SyncStack syncStack, Error error) { if (error == null) { String paginationToken = syncStack.getPaginationToken(); - String seqToken = syncStack.getSequentialToken(); - if (paginationToken != null) { syncPaginationToken(paginationToken, callback); } - if (seqToken != null && syncStack.getCount() > 0) { - seqSync(seqToken, callback); - } } callback.onCompletion(syncStack, error); } From df0f6f29f67900db2f544bc4ef7f015252e329e3 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 6 May 2024 16:39:13 +0530 Subject: [PATCH 4/7] 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 f1dab8f2a85a0a7d0b2be72da7b73c67cbc0b89a Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Tue, 7 May 2024 17:17:43 +0530 Subject: [PATCH 5/7] 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 0158902f4f4acab2e6498eb3bfc0e57e5ffe67ab Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Tue, 7 May 2024 17:26:33 +0530 Subject: [PATCH 6/7] changeLog updated --- .gitignore | 2 +- CHANGELOG.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 bf7bb4a7..09870501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,12 @@ ## Version 3.14.0 -### Date: 10-Feb-2024 +### Date: 13-May-2024 - support of new sync api - initSeqSync in stack class - seqSync in stack class +- GCP support implementation --- From 8f9b157466ad9d486980bce7b37727671af6ffd9 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Tue, 7 May 2024 18:39:11 +0530 Subject: [PATCH 7/7] feat: 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..4c78cdd4 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; }