Skip to content

Commit 3f74ba9

Browse files
committed
release: SDK 1.20.0
1 parent ba16441 commit 3f74ba9

File tree

75 files changed

+21417
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+21417
-619
lines changed

Sources/.idea/.name

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/build.gradle

Lines changed: 0 additions & 26 deletions
This file was deleted.

Sources/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
plugins {
4+
id("com.android.application") version ProjectConsts.ANDROID_GRADLE_PLUGIN_VERSION apply false
5+
id("com.android.library") version ProjectConsts.ANDROID_GRADLE_PLUGIN_VERSION apply false
6+
id("org.jetbrains.kotlin.android") version ProjectConsts.KOTLIN_VERSION apply false
7+
id("com.google.gms.google-services") version ProjectConsts.GMS_GRADLE_PLUGIN_VERSION apply false
8+
id("io.codearte.nexus-staging") version "0.30.0"
9+
id("org.sonarqube") version "4.2.1.3168"
10+
}

Sources/buildSrc/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
object ProjectConsts {
2+
const val COMPILE_SDK = 34
3+
4+
const val KOTLIN_VERSION = "1.7.21"
5+
const val KOTLIN_COROUTINES_VERSION = "1.6.4"
6+
7+
const val ANDROID_LINT_VERSION = "30.1.2"
8+
9+
const val ANDROID_GRADLE_PLUGIN_VERSION = "8.0.2"
10+
const val GMS_GRADLE_PLUGIN_VERSION = "4.3.14"
11+
}
12+
13+
object SDKConsts {
14+
const val VERSION = "1.20.0"
15+
const val API_LEVEL = 61
16+
const val MESSAGING_API_LEVEL = 12
17+
18+
const val MIN_SDK = 15
19+
const val TARGET_SDK = 34
20+
const val R_PREFIX = "com_batchsdk_"
21+
const val NAMESPACE = "com.batch.android"
22+
const val TEST_NAMESPACE = "com.batch.android.test"
23+
const val MAVEN_GROUP_ID = "com.batch.android"
24+
const val MAVEN_ARTIFACT = "batch-sdk"
25+
const val MAVEN_ARTIFACT_VERSION = VERSION
26+
27+
// SDK and Sample don't share the same deps as the SDK
28+
// usually wants lower versions for compatibility.
29+
object DependenciesVersions {
30+
const val ANDROIDX = "1.0.0"
31+
const val PLAY_SERVICES = "11.8.0"
32+
}
33+
}
34+
35+
object SampleConsts {
36+
object DependenciesVersions {
37+
const val ANDROIDX = "1.1.0"
38+
const val PLAY_SERVICES = "16.0.0"
39+
}
40+
}
41+
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed Jul 12 10:10:59 CEST 2023
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

Sources/sdk-lint/build.gradle

Lines changed: 0 additions & 27 deletions
This file was deleted.

Sources/sdk-lint/build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
id("java-library")
3+
}
4+
5+
dependencies {
6+
val lintVersion = ProjectConsts.ANDROID_LINT_VERSION
7+
8+
compileOnly("com.android.tools.lint:lint-api:$lintVersion")
9+
compileOnly("com.android.tools.lint:lint-checks:$lintVersion")
10+
11+
testImplementation("junit:junit:4.12")
12+
testImplementation("com.android.tools.lint:lint:$lintVersion")
13+
testImplementation("com.android.tools.lint:lint-tests:$lintVersion")
14+
testImplementation("com.android.tools:testutils:$lintVersion")
15+
}
16+
17+
18+
tasks.withType<Jar> {
19+
manifest {
20+
attributes["Lint-Registry-v2"] = "com.batch.android.lint.BatchIssueRegistry"
21+
}
22+
}
23+
24+
java {
25+
sourceCompatibility = JavaVersion.VERSION_1_8
26+
targetCompatibility = JavaVersion.VERSION_1_8
27+
}

Sources/sdk-processor/build.gradle

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
id("java-library")
3+
}
4+
5+
dependencies {
6+
implementation("com.squareup:javapoet:1.12.1")
7+
implementation("androidx.annotation:annotation:1.5.0")
8+
testImplementation("com.google.guava:guava:29.0-android")
9+
testImplementation("com.google.truth:truth:1.0.1")
10+
//testImplementation("com.google.truth:truth-java8-extension:1.0.1")
11+
testImplementation("com.google.testing.compile:compile-testing:0.18")
12+
testImplementation("com.google.android:android:4.1.1.4")
13+
}
14+
15+
java {
16+
sourceCompatibility = JavaVersion.VERSION_1_8
17+
targetCompatibility = JavaVersion.VERSION_1_8
18+
}

Sources/sdk-processor/src/main/java/com/batch/android/processor/DIProcessor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ private MethodSpec createGetMethodForProvide(ExecutableElement element,
233233
parameters.add(ParameterSpec.get(param));
234234
provideParams.add(CodeBlock.of(ParameterSpec.get(param).name));
235235
}
236-
237236
CodeBlock joinedParams = CodeBlock.join(provideParams, ", ");
238237
TypeName returnTypeName = TypeName.get(returnType);
239238
return MethodSpec.methodBuilder("get")
@@ -316,6 +315,10 @@ private MethodSpec createSingletonGetMethodForProvide(ExecutableElement element,
316315
parameters.add(ParameterSpec.get(param));
317316
provideParams.add(CodeBlock.of(ParameterSpec.get(param).name));
318317
}
318+
List<TypeName> exceptions = new ArrayList<>();
319+
for(TypeMirror exception : element.getThrownTypes()) {
320+
exceptions.add(TypeName.get(exception));
321+
}
319322
CodeBlock varName = CodeBlock.of("instance");
320323

321324
CodeBlock joinedParams = CodeBlock.join(provideParams, ", ");
@@ -324,6 +327,7 @@ private MethodSpec createSingletonGetMethodForProvide(ExecutableElement element,
324327
.addModifiers(Modifier.PUBLIC, Modifier.FINAL, Modifier.STATIC)
325328
.returns(returnTypeName)
326329
.addParameters(parameters)
330+
.addExceptions(exceptions)
327331
.addAnnotation(NonNull.class)
328332
.addStatement("$T $L = $T.getInstance().getSingletonInstance($T.class)",
329333
// We return a new instance every time
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.batch.android.processor.DIProcessor, isolating

Sources/sdk-stubs/build.gradle

Lines changed: 0 additions & 23 deletions
This file was deleted.

Sources/sdk-stubs/build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
id("com.android.library")
3+
}
4+
5+
android {
6+
namespace = "sun.misc"
7+
8+
compileSdk = ProjectConsts.COMPILE_SDK
9+
10+
defaultConfig {
11+
minSdk = SDKConsts.MIN_SDK
12+
targetSdk = SDKConsts.TARGET_SDK
13+
}
14+
15+
buildTypes {
16+
release {
17+
isMinifyEnabled = false
18+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
19+
}
20+
}
21+
}
22+
23+
dependencies {
24+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<manifest package="sun.misc" />
1+
<manifest />

0 commit comments

Comments
 (0)