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 support implementation #51

Merged
merged 9 commits into from
May 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
4 changes: 3 additions & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Publish - Snapshot

on:
push:
branches:
- master

jobs:
publish:
Expand Down Expand Up @@ -41,4 +43,4 @@ jobs:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down
38 changes: 29 additions & 9 deletions contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
}

import com.vanniktech.maven.publish.SonatypeHost

android.buildFeatures.buildConfig true

mavenPublishing {
Expand Down Expand Up @@ -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")
Expand All @@ -52,37 +69,36 @@ android {
exclude("META-INF/*.kotlin_module")
}


testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
excludes = ['jdk.internal.*']
}
// 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'
}
}
compileSdk 30
defaultConfig {
// Required when setting minSdkVersion to 20 or lower
multiDexEnabled true
minSdkVersion 23
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 All @@ -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']
Expand All @@ -115,16 +132,18 @@ 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'
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 All @@ -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)
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}
harshithad0703 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Config constructor
Expand Down
Loading
Loading