Skip to content

Commit a8742ab

Browse files
Android SDK v3.12.4 | Issue in dependencies download from Maven
1 parent 38cbcf7 commit a8742ab

File tree

9 files changed

+101
-68
lines changed

9 files changed

+101
-68
lines changed

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ buildscript {
44
agp_version = '8.2.1'
55
}
66
repositories {
7+
google()
78
maven {
89
url "https://plugins.gradle.org/m2/"
910
}
10-
google()
1111
mavenCentral()
1212
}
1313

1414
dependencies {
15-
classpath "com.android.tools.build:gradle:8.2.1" //8.2.1
15+
//classpath "com.android.tools.build:gradle:8.2.1" //8.2.1
16+
classpath 'com.android.tools.build:gradle:7.4.2'
1617
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0-rc-1'
1718
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
1819
}

contentstack/build.gradle

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ plugins {
44
}
55

66
import com.vanniktech.maven.publish.SonatypeHost
7+
78
android.buildFeatures.buildConfig true
89

910
mavenPublishing {
1011
publishToMavenCentral(SonatypeHost.DEFAULT)
1112
signAllPublications()
12-
coordinates("com.contentstack.sdk", "android", "3.12.4-rc2-SNAPSHOT")
13+
coordinates("com.contentstack.sdk", "android", "3.12.5")
1314

1415
pom {
1516
name = "contentstack-android"
1617
description = "The Content Delivery SDK facilitates the retrieval of content from your Contentstack account, enabling seamless delivery to your web or mobile properties.."
1718
inceptionYear = "2018"
19+
packaging 'aar'
1820
url = "https://github.com/contentstack/contentstack-android"
1921
licenses {
2022
license {
@@ -32,7 +34,7 @@ mavenPublishing {
3234
}
3335
scm {
3436
url = "scm:git@github.com:contentstack/contentstack-android"
35-
connection = "scm:git:git://github.com/username/mylibrary.git"
37+
connection = "scm:git:git://github.com/contentstack/contentstack-android.git"
3638
developerConnection = "scm:git@github.com:contentstack/contentstack-android.git"
3739
}
3840
}
@@ -52,17 +54,18 @@ tasks.register('jacocoTestReport', JacocoReport) {
5254
}))
5355
}
5456
}
57+
5558
android {
56-
namespace "com.contentstack.sdk"
59+
//namespace "com.contentstack.sdk"
5760
packagingOptions {
58-
exclude 'META-INF/DEPENDENCIES'
59-
exclude 'META-INF/LICENSE.md'
60-
exclude 'META-INF/LICENSE-notice.md'
61-
exclude 'META-INF/license.txt'
62-
exclude 'META-INF/NOTICE'
63-
exclude 'META-INF/NOTICE.txt'
64-
exclude 'META-INF/notice.txt'
65-
exclude 'META-INF/ASL2.0'
61+
exclude("META-INF/DEPENDENCIES")
62+
exclude("META-INF/LICENSE")
63+
exclude("META-INF/LICENSE.txt")
64+
exclude("META-INF/license.txt")
65+
exclude("META-INF/NOTICE")
66+
exclude("META-INF/NOTICE.txt")
67+
exclude("META-INF/notice.txt")
68+
exclude("META-INF/ASL2.0")
6669
exclude("META-INF/*.kotlin_module")
6770
}
6871

@@ -75,22 +78,23 @@ android {
7578
}
7679
signingConfigs {
7780
debug {
78-
storeFile file("/Users/shaileshmishra/keystore/release.keystore")
81+
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
7982
storePassword 'android'
80-
keyAlias 'androiddebugkey'
83+
keyAlias 'key0'
8184
keyPassword 'android'
8285
}
8386
release {
84-
storeFile file("/Users/shaileshmishra/keystore/release.keystore")
87+
storeFile file("/Users/shaileshmishra/keystore/key.keystore")
8588
storePassword 'android'
86-
keyAlias 'androiddebugkey'
89+
keyAlias 'key0'
8790
keyPassword 'android'
8891
}
8992
}
90-
compileSdk 26
93+
compileSdk 30
9194
defaultConfig {
95+
// Required when setting minSdkVersion to 20 or lower
9296
multiDexEnabled true
93-
minSdkVersion 19
97+
minSdkVersion 23
9498
versionCode 1
9599
versionName "1.0"
96100
useLibrary 'org.apache.http.legacy'
@@ -105,6 +109,8 @@ android {
105109
debug {
106110
debuggable true
107111
testCoverageEnabled true
112+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
113+
108114
buildConfigField "String", "host", localProperties['host']
109115
buildConfigField "String", "APIKey", localProperties['APIKey']
110116
buildConfigField "String", "deliveryToken", localProperties['deliveryToken']
@@ -118,26 +124,32 @@ android {
118124
}
119125
}
120126
//flavorDimensions "default"
121-
lintOptions { abortOnError false }
127+
//lintOptions { abortOnError false }
122128
compileOptions {
123-
//coreLibraryDesugaringEnabled true
129+
// Flag to enable support for the new language APIs
130+
coreLibraryDesugaringEnabled true
131+
// Sets Java compatibility to Java 8
124132
sourceCompatibility JavaVersion.VERSION_1_8
125133
targetCompatibility JavaVersion.VERSION_1_8
126134
}
127135
}
128136
configurations { archives }
129137
dependencies {
130-
def multidex_version = "2.0.1"
138+
def multidex = "2.0.1"
139+
//def sdk_utils = "1.2.6"
140+
def volley = "1.2.1"
141+
def junit = "4.13.2"
131142
configurations.configureEach { resolutionStrategy.force 'com.android.support:support-annotations:23.1.0' }
132143
implementation fileTree(include: ['*.jar'], dir: 'libs')
133-
implementation 'com.contentstack.sdk:utils:1.2.6'
134-
implementation 'com.android.volley:volley:1.2.1'
135-
implementation 'junit:junit:4.13.2'
144+
//implementation "com.contentstack.sdk:utils:$sdk_utils"
145+
implementation "com.android.volley:volley:$volley"
146+
implementation "junit:junit:$junit"
147+
// For AGP 7.4+
136148
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
137-
implementation "androidx.multidex:multidex:$multidex_version"
138-
149+
//implementation "androidx.multidex:multidex:$multidex"
139150
testImplementation 'junit:junit:4.13.2'
140151
androidTestImplementation 'androidx.test:core:1.5.0'
152+
//testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
141153
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
142154
exclude group: 'com.android.support', module: 'support-annotations'
143155
})

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.contentstack.sdk;
2+
23
import android.content.Context;
3-
import android.support.test.InstrumentationRegistry;
44
import android.util.Log;
55

66
import org.junit.BeforeClass;
@@ -13,6 +13,7 @@
1313
import static junit.framework.Assert.assertTrue;
1414
import static junit.framework.TestCase.assertEquals;
1515

16+
import androidx.test.InstrumentationRegistry;
1617
import androidx.test.core.app.ApplicationProvider;
1718

1819
@FixMethodOrder(MethodSorters.NAME_ASCENDING)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import static org.junit.Assert.assertNotNull;
55

66
import android.content.Context;
7-
import android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
87
import android.util.Log;
98

109
import androidx.test.core.app.ApplicationProvider;
10+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
1111

1212
import org.junit.Test;
1313
import org.junit.runner.RunWith;

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import android.text.TextUtils;
44

5+
import java.util.Objects;
56

6-
import javax.validation.constraints.NotNull;
77

88
/**
99
* Set Configuration for stack instance creation.
@@ -47,13 +47,13 @@ public void setBranch(String branch) {
4747
*
4848
* <br><br><b>Example For Different Regions:</b><br>
4949
* <pre>
50-
* {@code
51-
* config.setRegion(ContentstackRegion.US);
52-
* config.setRegion(ContentstackRegion.EU);
53-
* config.setRegion(ContentstackRegion.AZURE_EU);
54-
* config.setRegion(ContentstackRegion.AZURE_NA);
55-
* }
56-
* </pre>
50+
* {@code
51+
* config.setRegion(ContentstackRegion.US);
52+
* config.setRegion(ContentstackRegion.EU);
53+
* config.setRegion(ContentstackRegion.AZURE_EU);
54+
* config.setRegion(ContentstackRegion.AZURE_NA);
55+
* }
56+
* </pre>
5757
*/
5858
public ContentstackRegion setRegion(ContentstackRegion region) {
5959
this.region = region;
@@ -69,7 +69,10 @@ public String[] getEarlyAccess() {
6969
return this.earlyAccess;
7070
}
7171

72-
public Config earlyAccess(@NotNull String[] earlyAccess) {
72+
public Config earlyAccess(String[] earlyAccess) {
73+
if (earlyAccess == null) {
74+
Objects.requireNonNull("Null early access");
75+
}
7376
this.earlyAccess = earlyAccess;
7477
return this;
7578
}

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
import com.android.volley.RequestQueue;
88
import com.android.volley.toolbox.Volley;
99

10-
1110
import java.io.File;
12-
13-
import javax.validation.constraints.NotNull;
11+
import java.util.Objects;
1412

1513
/**
1614
* Contains all Contentstack SDK Classes And Methods.
@@ -45,7 +43,9 @@ private Contentstack(Context context) {
4543
* @return {@link Stack} instance. <br><br><b>Example :</b><br> <pre class="prettyprint"> Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", "stag"); </pre>
4644
* @throws Exception the exception
4745
*/
48-
public static Stack stack(@NotNull Context context, @NotNull String apiKey, @NotNull String deliveryToken, @NotNull String environment) throws Exception {
46+
public static Stack stack(Context context, String apiKey, String deliveryToken, String environment) throws Exception {
47+
checkIfNull(context, apiKey, deliveryToken, environment);
48+
4949
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
5050
Config config = new Config();
5151
config.setEnvironment(environment);
@@ -56,6 +56,13 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
5656
}
5757
}
5858

59+
private static void checkIfNull(Context context, String apiKey, String deliveryToken, String environment) {
60+
Objects.requireNonNull(context, "can not be null");
61+
Objects.requireNonNull(apiKey, "can not be null");
62+
Objects.requireNonNull(deliveryToken, "can not be null");
63+
Objects.requireNonNull(environment, "can not be null");
64+
}
65+
5966
/**
6067
* Authenticates the stack api key of your stack.
6168
* This must be called before your stack uses Contentstack sdk.
@@ -70,7 +77,9 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
7077
* @return {@link Stack} instance. <br><br><b>Example :</b><br> <pre class="prettyprint"> Config config = new Config(); config.setEnvironment("stag"); Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", config);
7178
* @throws Exception the exception
7279
*/
73-
public static Stack stack(@NotNull Context context, @NotNull String apiKey, @NotNull String deliveryToken, @NotNull String environment, @NotNull Config config) throws Exception {
80+
public static Stack stack(Context context, String apiKey, String deliveryToken, String environment, Config config) throws Exception {
81+
checkIfNull(context, apiKey, deliveryToken, environment);
82+
Objects.requireNonNull(config, "Config can not be null");
7483
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
7584
config.setEnvironment(environment);
7685
ctx = context;

0 commit comments

Comments
 (0)