Skip to content

Commit

Permalink
release: SDK 1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-roland committed Jul 27, 2023
1 parent ba16441 commit 3f74ba9
Show file tree
Hide file tree
Showing 75 changed files with 21,417 additions and 619 deletions.
2 changes: 1 addition & 1 deletion Sources/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions Sources/build.gradle

This file was deleted.

10 changes: 10 additions & 0 deletions Sources/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id("com.android.application") version ProjectConsts.ANDROID_GRADLE_PLUGIN_VERSION apply false
id("com.android.library") version ProjectConsts.ANDROID_GRADLE_PLUGIN_VERSION apply false
id("org.jetbrains.kotlin.android") version ProjectConsts.KOTLIN_VERSION apply false
id("com.google.gms.google-services") version ProjectConsts.GMS_GRADLE_PLUGIN_VERSION apply false
id("io.codearte.nexus-staging") version "0.30.0"
id("org.sonarqube") version "4.2.1.3168"
}
7 changes: 7 additions & 0 deletions Sources/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}
41 changes: 41 additions & 0 deletions Sources/buildSrc/src/main/java/Consts.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
object ProjectConsts {
const val COMPILE_SDK = 34

const val KOTLIN_VERSION = "1.7.21"
const val KOTLIN_COROUTINES_VERSION = "1.6.4"

const val ANDROID_LINT_VERSION = "30.1.2"

const val ANDROID_GRADLE_PLUGIN_VERSION = "8.0.2"
const val GMS_GRADLE_PLUGIN_VERSION = "4.3.14"
}

object SDKConsts {
const val VERSION = "1.20.0"
const val API_LEVEL = 61
const val MESSAGING_API_LEVEL = 12

const val MIN_SDK = 15
const val TARGET_SDK = 34
const val R_PREFIX = "com_batchsdk_"
const val NAMESPACE = "com.batch.android"
const val TEST_NAMESPACE = "com.batch.android.test"
const val MAVEN_GROUP_ID = "com.batch.android"
const val MAVEN_ARTIFACT = "batch-sdk"
const val MAVEN_ARTIFACT_VERSION = VERSION

// SDK and Sample don't share the same deps as the SDK
// usually wants lower versions for compatibility.
object DependenciesVersions {
const val ANDROIDX = "1.0.0"
const val PLAY_SERVICES = "11.8.0"
}
}

object SampleConsts {
object DependenciesVersions {
const val ANDROIDX = "1.1.0"
const val PLAY_SERVICES = "16.0.0"
}
}

3 changes: 2 additions & 1 deletion Sources/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Jul 12 10:10:59 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 0 additions & 27 deletions Sources/sdk-lint/build.gradle

This file was deleted.

27 changes: 27 additions & 0 deletions Sources/sdk-lint/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
id("java-library")
}

dependencies {
val lintVersion = ProjectConsts.ANDROID_LINT_VERSION

compileOnly("com.android.tools.lint:lint-api:$lintVersion")
compileOnly("com.android.tools.lint:lint-checks:$lintVersion")

testImplementation("junit:junit:4.12")
testImplementation("com.android.tools.lint:lint:$lintVersion")
testImplementation("com.android.tools.lint:lint-tests:$lintVersion")
testImplementation("com.android.tools:testutils:$lintVersion")
}


tasks.withType<Jar> {
manifest {
attributes["Lint-Registry-v2"] = "com.batch.android.lint.BatchIssueRegistry"
}
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
18 changes: 0 additions & 18 deletions Sources/sdk-processor/build.gradle

This file was deleted.

18 changes: 18 additions & 0 deletions Sources/sdk-processor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id("java-library")
}

dependencies {
implementation("com.squareup:javapoet:1.12.1")
implementation("androidx.annotation:annotation:1.5.0")
testImplementation("com.google.guava:guava:29.0-android")
testImplementation("com.google.truth:truth:1.0.1")
//testImplementation("com.google.truth:truth-java8-extension:1.0.1")
testImplementation("com.google.testing.compile:compile-testing:0.18")
testImplementation("com.google.android:android:4.1.1.4")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ private MethodSpec createGetMethodForProvide(ExecutableElement element,
parameters.add(ParameterSpec.get(param));
provideParams.add(CodeBlock.of(ParameterSpec.get(param).name));
}

CodeBlock joinedParams = CodeBlock.join(provideParams, ", ");
TypeName returnTypeName = TypeName.get(returnType);
return MethodSpec.methodBuilder("get")
Expand Down Expand Up @@ -316,6 +315,10 @@ private MethodSpec createSingletonGetMethodForProvide(ExecutableElement element,
parameters.add(ParameterSpec.get(param));
provideParams.add(CodeBlock.of(ParameterSpec.get(param).name));
}
List<TypeName> exceptions = new ArrayList<>();
for(TypeMirror exception : element.getThrownTypes()) {
exceptions.add(TypeName.get(exception));
}
CodeBlock varName = CodeBlock.of("instance");

CodeBlock joinedParams = CodeBlock.join(provideParams, ", ");
Expand All @@ -324,6 +327,7 @@ private MethodSpec createSingletonGetMethodForProvide(ExecutableElement element,
.addModifiers(Modifier.PUBLIC, Modifier.FINAL, Modifier.STATIC)
.returns(returnTypeName)
.addParameters(parameters)
.addExceptions(exceptions)
.addAnnotation(NonNull.class)
.addStatement("$T $L = $T.getInstance().getSingletonInstance($T.class)",
// We return a new instance every time
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.batch.android.processor.DIProcessor, isolating
23 changes: 0 additions & 23 deletions Sources/sdk-stubs/build.gradle

This file was deleted.

24 changes: 24 additions & 0 deletions Sources/sdk-stubs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id("com.android.library")
}

android {
namespace = "sun.misc"

compileSdk = ProjectConsts.COMPILE_SDK

defaultConfig {
minSdk = SDKConsts.MIN_SDK
targetSdk = SDKConsts.TARGET_SDK
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
}

dependencies {
}
2 changes: 1 addition & 1 deletion Sources/sdk-stubs/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="sun.misc" />
<manifest />
Loading

0 comments on commit 3f74ba9

Please sign in to comment.