build.gradle 4.33 KB
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

android.buildFeatures.buildConfig = true

ext {
    PUBLISH_GROUP_ID = 'ly.warp'
    PUBLISH_VERSION = '4.5.5.4deh3'
    PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
    compileSdkVersion 35
    buildToolsVersion "35.0.0"

    useLibrary 'org.apache.http.legacy'
    
    publishing {
        // Configure all components to be published
        singleVariant('release') {
            // Publish the release variant with sources
            withSourcesJar()
        }
    }

    defaultConfig {
        minSdkVersion 31
        targetSdkVersion 35
        consumerProguardFiles 'proguard-rules.pro'
        vectorDrawables.useSupportLibrary = true
    }
    splits {
        abi {
            reset()
            enable false
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    lintOptions {
        abortOnError false
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    namespace "ly.warp.sdk"
}

dependencies {
    //------------------------------ Support -----------------------------//
    implementation 'androidx.appcompat:appcompat:1.7.1'
    implementation "androidx.security:security-crypto:1.1.0"
    // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
    implementation 'org.altbeacon:android-beacon-library:2.19.3'
    implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    implementation 'io.reactivex.rxjava3:rxjava:3.1.8'
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'org.greenrobot:eventbus:3.3.1'
    implementation 'com.google.guava:guava:33.0.0-android'

    //------------------------------ Firebase -----------------------------//
    implementation platform('com.google.firebase:firebase-bom:34.2.0')
    implementation('com.google.firebase:firebase-messaging') {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }

    //------------------------------ GMS -----------------------------//
    implementation 'com.google.android.gms:play-services-base:18.7.2'
    implementation 'com.google.android.gms:play-services-location:21.3.0'

    //------------------------------ Work Manager -----------------------------//
    implementation 'androidx.work:work-runtime:2.10.3'

    //------------------------------ Glide -----------------------------//
    implementation 'com.github.bumptech.glide:glide:4.16.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'

    //------------------------------ Huawei -----------------------------//
    implementation 'com.huawei.agconnect:agconnect-core:1.9.3.301'
    implementation 'com.huawei.hms:base:6.13.0.303'
    implementation 'com.huawei.hms:push:6.10.0.300'
    implementation 'com.huawei.hms:ads-identifier:3.4.62.300'

    //------------------------------ SQLite (Standard Android) -----------------------------//
    implementation 'androidx.sqlite:sqlite:2.5.2'

    //------------------------------ Retrofit -----------------------------//
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

    //------------------------------ Lifecycle -----------------------------//
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"

    //------------------------------ Retrofit Logs -----------------------------//
//    implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
}

// In every export please update the version number
tasks.register('deleteJarLibrary', Delete) {
    delete 'jar/warply_android_sdk_v4.5.0.jar'
}

tasks.register('createJarLibrary', Jar) {
    dependsOn('assembleRelease')
    from(fileTree('build/intermediates/aar/release/'))
    destinationDirectory = file('jar')
    archiveFileName = "warply_android_sdk_v${PUBLISH_VERSION}.jar"
}

tasks.named('createJarLibrary') {
    dependsOn('deleteJarLibrary', 'build')
}