Skip to content
Open
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
4 changes: 2 additions & 2 deletions android-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
exclude 'META-INF/LICENSE'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility JavaVersion.toVersion(JAVA_VERSION)
}

String url = '\"\"'
Expand Down
32 changes: 27 additions & 5 deletions android-core/proguard.pro
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,33 @@
public static final ** CREATOR;
}

-keepclassmembers class com.mparticle.Rokt {
<init>(...);
void *(...);
void *$default(...);
<fields>;
# Firebase and GMS CloudMessaging
-dontwarn com.google.android.gms.cloudmessaging.**
-dontwarn com.google.firebase.messaging.**
-keep class com.google.firebase.messaging.** { *; }

# Java 9+ StringConcatFactory
-dontwarn java.lang.invoke.StringConcatFactory
-keep class java.lang.invoke.StringConcatFactory { *; }

# Keep lambdas
-keepclassmembers class * {
private static synthetic *** lambda$*(...);
}
# Additional rules to prevent minification errors with Kotlin
-keepattributes *Annotation*, InnerClasses, Signature, EnclosingMethod
-keepclassmembers class kotlin.Metadata {
public <methods>;
}
-keepclassmembers class * {
@kotlin.Metadata <methods>;
}

-keep public class com.mparticle.Rokt {
public <init>(...);
public void *(...);
public void *$default(...);
public <fields>;
}

-keep interface com.mparticle.MpRoktEventCallback { *; }
Expand Down
6 changes: 3 additions & 3 deletions android-kit-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
testBuildType 'debug'

defaultConfig {
minSdkVersion 14
minSdk 14
targetSdk 33
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand All @@ -37,8 +37,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility JavaVersion.toVersion(JAVA_VERSION)
}
}

Expand Down
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '1.9.0'
ext.gradle_version = '7.3.1'
ext.gradle_version = '8.1.4'

repositories {
mavenCentral()
Expand All @@ -14,7 +14,7 @@ buildscript {

plugins {
id "org.sonarqube" version "3.5.0.2730"
id "org.jlleitschuh.gradle.ktlint" version "11.2.0"
id "org.jlleitschuh.gradle.ktlint" version "13.0.0"
}

sonarqube {
Expand All @@ -26,6 +26,15 @@ sonarqube {
}

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
apply plugin: 'org.sonarqube'
sonarqube {
androidVariant "release"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
android.useAndroidX=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2560m
#-XX:ThreadStackSize=4096 -XX:CompilerThreadStackSize=4096
#-XX:ThreadStackSize=4096 -XX:CompilerThreadStackSize=4096
android.defaults.buildfeatures.buildconfig=true
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
JAVA_VERSION=17
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 04 12:58:48 PDT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions kit-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ apply from: '../scripts/maven.gradle'
dependencies {
implementation gradleApi()
implementation localGroovy()
compileOnly "com.android.tools.build:gradle:7.3.1"
testImplementation "com.android.tools.build:gradle:4.1.3"
compileOnly "com.android.tools.build:gradle:$gradle_version"
testImplementation "com.android.tools.build:gradle:$gradle_version"
}

compileGroovy {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility = JavaVersion.toVersion(JAVA_VERSION)
}

dependencies {
Expand Down
18 changes: 7 additions & 11 deletions kit-plugin/src/main/groovy/com/mparticle/kits/KitPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,13 @@ class KitPlugin implements Plugin<Project> {
url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
}

def signingKey = System.getenv("mavenSigningKeyId")
def signingPassword = System.getenv("mavenSigningKeyPassword")

if (signingKey != null) {
target.extensions.add('signing.keyId', signingKey)
target.extensions.add('signing.password', signingPassword)

SigningExtension signing = new SigningExtension(target)
signing.required = { target.gradle.taskGraph.hasTask("publishReleasePublicationToMavenRepository") }
signing.useInMemoryPgpKeys(signingKey, signingPassword)
signing.sign publishing.publications.findByName("release")
target.extensions.configure(SigningExtension) { signing ->
signing.required = { target.gradle.taskGraph.hasTask('publishReleasePublicationToMavenRepository') }
def signingKey = target.findProperty('signingKey') ?: System.getenv('mavenSigningKeyId')
def signingPassword = target.findProperty('signingPassword') ?: System.getenv('mavenSigningKeyPassword')
if (signingKey && signingPassword) {
signing.useInMemoryPgpKeys(target.property('signingKey'), target.property('signingPassword'))
}
}
}

Expand Down
15 changes: 12 additions & 3 deletions scripts/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ allprojects {
ext."signing.secretKeyRingFile" = System.getenv("mavenSigningKeyRingFile")
ext."signing.password" = System.getenv("mavenSigningKeyPassword")
}

// For AGP 8.x compatibility, configure Android library projects
if (project.plugins.findPlugin("com.android.library")) {
android {
publishing {
// Configure publishing for both variants
singleVariant("release")
singleVariant("debug")
}
}
}
afterEvaluate {
publishing {
publications {
Expand Down Expand Up @@ -115,5 +124,5 @@ afterEvaluate {
}

//Publishing task aliases for simpler local development
task publishLocal { dependsOn "publishDebugPublicationToMavenLocal" }
task publishReleaseLocal { dependsOn "publishReleasePublicationToMavenLocal" }
task publishLocal { dependsOn "publishDebugPublicationToMavenLocal"}
task publishReleaseLocal { dependsOn "publishReleasePublicationToMavenLocal"}
7 changes: 7 additions & 0 deletions testutils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ android {
namespace 'com.mparticle.testutils'
testNamespace 'com.mparticle.legacyTest'
compileSdk 33
compileOptions {
sourceCompatibility = JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility = JavaVersion.toVersion(JAVA_VERSION)
}

kotlinOptions {
jvmTarget = JAVA_VERSION
}
defaultConfig {
//This is set to 21 to avoid slow multidex.
minSdk 21
Expand Down
6 changes: 3 additions & 3 deletions tooling/android-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'groovy'
apply plugin: 'kotlin'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility = JavaVersion.toVersion(JAVA_VERSION)


ext {
Expand All @@ -26,7 +26,7 @@ configurations {

dependencies {
fatJar project(':tooling:common')
compileOnly configurations.fatJar
compileOnly files(configurations.fatJar)
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation files('libs/java-json.jar')
Expand Down
8 changes: 6 additions & 2 deletions tooling/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility = JavaVersion.toVersion(JAVA_VERSION)
}

kotlin {
jvmToolchain(Integer.parseInt(JAVA_VERSION))
}
15 changes: 7 additions & 8 deletions tooling/custom-lint-rules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'com.android.lint'

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17

buildscript {
ext {
Expand Down Expand Up @@ -39,7 +39,7 @@ dependencies {
lintBuild files(jar)
lintJar files('libs/mparticle-min.jar')
lintJar project(':tooling:common')
implementation configurations.lintJar
implementation files(configurations.lintJar)
compileOnly "com.android.tools.lint:lint-api:$lintVersion"
compileOnly "com.android.tools.lint:lint-checks:$lintVersion"
compileOnly 'org.codehaus.groovy:groovy-all:3.0.13'
Expand All @@ -51,7 +51,7 @@ dependencies {

jar {
dependsOn(":tooling:common:jar")
archiveName 'lint.jar'
archiveFileName = 'lint.jar'
manifest {
attributes 'Manifest-Version': 1.0
attributes 'Lint-Registry-v2': 'com.mparticle.lints.MParticleIssueRegistry'
Expand All @@ -74,10 +74,9 @@ rootProject.project('android-core').android.buildTypes.all {

task zipSources(type: Jar) {
def fileName = "$project.rootDir/android-core/build/intermediates/javac/${targetBuildType}/classes"
from(fileTree(dir: fileName)) {
destinationDir new File("$project.projectDir/libs")
archiveName "mparticle.jar"
}
from(fileTree(dir: fileName))
destinationDirectory.set(new File("$project.projectDir/libs"))
archiveFileName.set("mparticle.jar")
outputs.upToDateWhen { false }
}

Expand Down
Loading