Skip to content

Commit 2ec87ff

Browse files
committed
release: SDK 3.0.0
1 parent 0663efe commit 2ec87ff

File tree

184 files changed

+22309
-4030
lines changed

Some content is hidden

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

184 files changed

+22309
-4030
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ aar:
99

1010
clean:
1111
rm -f public-sdk/Batch.aar
12-
cd Sources && ./gradlew clean
12+
cd Sources && ./gradlew clean
13+
14+
doc:
15+
cd Sources && ./gradlew :sdk:dokkaGeneratePublicationHtml

Sources/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
**/.idea/saveactions_settings.xml
2828
**/.idea/assetWizardSettings.xml
2929
**/.idea/jarRepositories.xml
30+
**/.idea/AndroidProjectSystem.xml
31+
**/.idea/RunConfigurations.xml
3032

3133
**/.idea/compiler.xml

Sources/build.gradle.kts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
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"
4+
alias(libs.plugins.android.application) apply false
5+
alias(libs.plugins.android.library) apply false
6+
alias(libs.plugins.kotlin.android) apply false
7+
alias(libs.plugins.kotlin.jvm) apply false
8+
alias(libs.plugins.gms.google.services) apply false
9+
alias(libs.plugins.testify) apply false
10+
alias(libs.plugins.nexus.staging)
11+
alias(libs.plugins.dokka)
12+
alias(libs.plugins.kfmt)
1013
}

Sources/buildSrc/build.gradle.kts

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

Sources/buildSrc/src/main/java/Consts.kt

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
id("org.jetbrains.kotlin.jvm")
3+
}
4+
5+
dependencies {
6+
compileOnly(libs.dokka.core)
7+
implementation(libs.dokka.base)
8+
testImplementation(libs.kotlin.test)
9+
testImplementation(libs.dokka.base.test.utils)
10+
testImplementation(libs.dokka.test.api)
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.batch.dokka.plugin
2+
3+
import org.jetbrains.dokka.base.DokkaBase
4+
import org.jetbrains.dokka.plugability.DokkaPlugin
5+
import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
6+
import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement
7+
8+
class FilterPublicSDKClassesPlugin : DokkaPlugin() {
9+
10+
val filterExtension by extending {
11+
plugin<DokkaBase>().preMergeDocumentableTransformer providing ::FilterPublicSDKClassesTransformer
12+
}
13+
14+
@OptIn(DokkaPluginApiPreview::class)
15+
override fun pluginApiPreviewAcknowledgement() = PluginApiPreviewAcknowledgement
16+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.batch.dokka.plugin
2+
3+
import org.jetbrains.dokka.base.transformers.documentables.SuppressedByConditionDocumentableFilterTransformer
4+
import org.jetbrains.dokka.model.Annotations
5+
import org.jetbrains.dokka.model.DClasslike
6+
import org.jetbrains.dokka.model.Documentable
7+
import org.jetbrains.dokka.model.properties.WithExtraProperties
8+
import org.jetbrains.dokka.plugability.DokkaContext
9+
10+
class FilterPublicSDKClassesTransformer(
11+
context: DokkaContext,
12+
) : SuppressedByConditionDocumentableFilterTransformer(context) {
13+
14+
override fun shouldBeSuppressed(d: Documentable): Boolean {
15+
16+
// Non class types are public, as otherwise dokka will skip complete packages
17+
// Enums, fields, etc are also public as all that matters is the Class' PublicSDK
18+
// annotation.
19+
val isPublic = when (d) {
20+
is DClasslike -> d.isBatchPublicSDK()
21+
else -> true
22+
}
23+
24+
if (!isPublic) {
25+
context.logger.warn("Suppressing non-PublicSDK documentable '${d.name}'")
26+
}
27+
28+
return !isPublic
29+
}
30+
}
31+
32+
fun DClasslike.isBatchPublicSDK(): Boolean {
33+
val annotations: List<Annotations.Annotation> =
34+
(this as? WithExtraProperties<*>)
35+
?.extra
36+
?.allOfType<Annotations>()
37+
?.flatMap { a -> a.directAnnotations.flatMap { it.value } }
38+
?: emptyList()
39+
40+
return annotations.any { it.isBatchPublicSDK() }
41+
}
42+
43+
fun Annotations.Annotation.isBatchPublicSDK(): Boolean =
44+
dri.packageName == "com.batch.android.annotation" && dri.classNames == "PublicSDK"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.batch.dokka.plugin.FilterPublicSDKClassesPlugin

Sources/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ android.useAndroidX=true
2020
android.enableJetifier=false
2121
gnsp.disableApplyOnlyOnRootProjectEnforcement=true
2222
kotlin.stdlib.default.dependency=false
23+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
24+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
25+
ksp.incremental=false

Sources/gradle/libs.versions.toml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
[versions]
2+
agp = "8.9.2"
3+
android = "4.1.1.4"
4+
androidCompileSdk = "36"
5+
androidMinSdk = "21"
6+
androidLint = "30.1.2"
7+
androidxJunit = "1.2.1"
8+
androidXCoreKtx = "1.16.0"
9+
androidXLibraryVersion = "1.0.0"
10+
androidXTestCoreKtx = "1.6.1"
11+
androidXTestRunner = "1.6.2"
12+
androidXTestTruth = "1.6.0"
13+
assertjCore = "3.24.2"
14+
batchSdk = "3.0.0"
15+
batchApiLevel = "300"
16+
batchMessagingApiLevel = "30"
17+
batchResourcePrefix = "com_batchsdk_"
18+
batchNamespace = "com.batch.android"
19+
batchTestNamespace = "com.batch.android.test"
20+
batchMavenGroupId = "com.batch.android"
21+
batchMavenArtifact = "batch-sdk"
22+
dokka = "2.0.0"
23+
espressoIntents = "3.6.1"
24+
firebaseCore = "17.4.3"
25+
firebaseMessaging = "22.0.0"
26+
gms = "4.3.14"
27+
googlePlayReview = "2.0.1"
28+
junit = "4.13.2"
29+
kfmt = "0.22.0"
30+
kotlinCompileTestingKsp = "1.6.0"
31+
kotlinpoet = "2.0.0"
32+
ksp = "1.9.0-1.0.13"
33+
kotlin = "1.9.0"
34+
kotlinxCoroutinesAndroid = "1.7.1"
35+
metalava = "1.0.0-alpha04"
36+
mockitoCore = "5.12.0"
37+
nexusStaging = "0.30.0"
38+
powermockClassloadingXstream = "2.0.9"
39+
robolectric = "4.9.2"
40+
testify = "3.2.2"
41+
42+
[libraries]
43+
android = { module = "com.google.android:android", version.ref = "android" }
44+
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidXLibraryVersion" }
45+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidXLibraryVersion" }
46+
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidXCoreKtx" }
47+
androidx-dynamicanimation = { module = "androidx.dynamicanimation:dynamicanimation", version.ref = "androidXLibraryVersion" }
48+
androidx-test-core = { module = "androidx.test:core", version.ref = "androidXTestCoreKtx" }
49+
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoIntents" }
50+
androidx-test-espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espressoIntents" }
51+
androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidxJunit" }
52+
androidx-test-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxJunit" }
53+
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidXTestCoreKtx" }
54+
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidXTestRunner" }
55+
androidx-test-truth = { module = "androidx.test.ext:truth", version.ref = "androidXTestTruth" }
56+
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertjCore" }
57+
core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidXTestCoreKtx" }
58+
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }
59+
dokka-base-test-utils = { module = "org.jetbrains.dokka:dokka-base-test-utils", version.ref = "dokka" }
60+
dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka" }
61+
dokka-test-api = { module = "org.jetbrains.dokka:dokka-test-api", version.ref = "dokka" }
62+
firebase-core = { module = "com.google.firebase:firebase-core", version.ref = "firebaseCore" }
63+
firebase-messaging = { module = "com.google.firebase:firebase-messaging", version.ref = "firebaseMessaging" }
64+
junit = { module = "junit:junit", version.ref = "junit" }
65+
kotlin-compile-testing-ksp = { module = "com.github.tschuchortdev:kotlin-compile-testing-ksp", version.ref = "kotlinCompileTestingKsp" }
66+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
67+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
68+
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
69+
kotlinpoet-ksp = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlinpoet" }
70+
ksp-symbol-processing-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
71+
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesAndroid" }
72+
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesAndroid" }
73+
lint = { module = "com.android.tools.lint:lint", version.ref = "androidLint" }
74+
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "androidLint" }
75+
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "androidLint" }
76+
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "androidLint" }
77+
material = { module = "com.google.android.material:material", version.ref = "androidXLibraryVersion" }
78+
metalava = { module = "com.android.tools.metalava:metalava", version.ref = "metalava" }
79+
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
80+
powermock-api-mockito2 = { module = "org.powermock:powermock-api-mockito2", version.ref = "powermockClassloadingXstream" }
81+
powermock-classloading-xstream = { module = "org.powermock:powermock-classloading-xstream", version.ref = "powermockClassloadingXstream" }
82+
powermock-module-junit4 = { module = "org.powermock:powermock-module-junit4", version.ref = "powermockClassloadingXstream" }
83+
powermock-module-junit4-rule = { module = "org.powermock:powermock-module-junit4-rule", version.ref = "powermockClassloadingXstream" }
84+
google-play-review = { module = "com.google.android.play:review", version.ref = "googlePlayReview" }
85+
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
86+
testutils = { module = "com.android.tools:testutils", version.ref = "androidLint" }
87+
88+
[plugins]
89+
android-application = { id = "com.android.application", version.ref = "agp" }
90+
android-library = { id = "com.android.library", version.ref = "agp" }
91+
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
92+
gms-google-services = { id = "com.google.gms.google-services", version.ref = "gms" }
93+
kfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "kfmt" }
94+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
95+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
96+
nexus-staging = { id = "io.codearte.nexus-staging", version.ref = "nexusStaging" }
97+
testify = { id = "dev.testify", version.ref = "testify" }
98+
99+
100+
101+
102+
103+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Oct 07 16:54:16 CEST 2024
1+
#Mon May 05 15:25:03 CEST 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

Sources/sdk-lint/build.gradle.kts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ plugins {
33
}
44

55
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")
6+
compileOnly(libs.lint.api)
7+
compileOnly(libs.lint.checks)
8+
testImplementation(libs.junit)
9+
testImplementation(libs.lint)
10+
testImplementation(libs.lint.tests)
11+
testImplementation(libs.testutils)
1512
}
1613

17-
1814
tasks.withType<Jar> {
1915
manifest {
2016
attributes["Lint-Registry-v2"] = "com.batch.android.lint.BatchIssueRegistry"
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
plugins {
22
id("java-library")
3+
kotlin("jvm")
34
}
45

56
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")
7+
implementation(kotlin("stdlib-jdk8"))
8+
implementation(libs.kotlinpoet)
9+
implementation(libs.kotlinpoet.ksp)
10+
implementation(libs.ksp.symbol.processing.api)
11+
implementation(libs.androidx.annotation)
12+
13+
testImplementation (libs.assertj.core)
14+
testImplementation(libs.kotlin.compile.testing.ksp)
15+
testImplementation(libs.android)
16+
testImplementation(kotlin("test"))
1317
}
1418

19+
kotlin {
20+
jvmToolchain(8)
21+
}
1522
java {
1623
sourceCompatibility = JavaVersion.VERSION_1_8
1724
targetCompatibility = JavaVersion.VERSION_1_8
18-
}
25+
}

0 commit comments

Comments
 (0)