build.gradle 3.49 KB
apply plugin: 'com.android.library'

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

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

android {

    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 31
        consumerProguardFiles 'proguard-rules.pro'
    }
    lintOptions {
        abortOnError false
    }

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

    useLibrary 'org.apache.http.legacy'
}

dependencies {
    //------------------------------ Support -----------------------------//
    api 'androidx.appcompat:appcompat:1.4.1'
    api 'androidx.recyclerview:recyclerview:1.2.1'
    api 'androidx.cardview:cardview:1.0.0'
    api "androidx.security:security-crypto:1.1.0-alpha03" // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
    api 'org.altbeacon:android-beacon-library:2.19.3'
    api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    api "commons-logging:commons-logging:1.2"

    //------------------------------ Firebase -----------------------------//
    api platform('com.google.firebase:firebase-bom:29.0.3')
    api 'com.google.firebase:firebase-messaging'

    //------------------------------ GMS -----------------------------//
    api 'com.google.android.gms:play-services-base:18.0.1'
    api 'com.google.android.gms:play-services-location:19.0.1'

    //------------------------------ Work Manager -----------------------------//
    api 'androidx.work:work-runtime:2.7.1'

    //------------------------------ Glide -----------------------------//
    api 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

    //------------------------------ Huawei -----------------------------//
    api 'com.huawei.agconnect:agconnect-core:1.6.2.300'
    api 'com.huawei.hms:base:6.2.0.300'
    api 'com.huawei.hms:push:6.1.0.300'
    api 'com.huawei.hms:ads-identifier:3.4.39.302'

    //------------------------------ SQLCipher -----------------------------//
    api "net.zetetic:android-database-sqlcipher:4.5.0"
    api "androidx.sqlite:sqlite:2.2.0"
}

// In every export please update the version number
task deleteJarLibrary(type: Delete) {
    delete 'jar/warply_android_sdk_v4.5.0.jar'
}

//from('build/intermediates/compile_library_classes/release/')

//Old version
// Gradle Tasks -> warply_android_sdk -> Tasks -> other -> createJarLibrary
//task createJarLibrary(type: Copy) {
//    from fileTree('build/intermediates/bundles/release/')
//    into('jar/')
//    include('classes.jar')
//    rename('classes.jar', 'warply_android_sdk_v4.4.2.jar')
//}

// New version
// Gradle -> warplyDemo -> libraries -> warply_android_sdk -> Run Configurations -> assembleRelease
// When finished it copies the .jar into
// warply_android_sdk -> build -> intermediates -> full_jar -> release/debug -> full.jar

// 24 - Jan - 2022
// Gradle -> warplyDemo -> libraries -> warply_android_sdk -> Tasks -> build -> build
// When finished it copies the .aar into
// warply_android_sdk -> build -> outputs -> aar -> warply_android_sdk-release.aar

task createJarLibrary(type: Jar, dependsOn: 'assembleRelease') {
    from fileTree('build/intermediates/bundles/release/')
}

createJarLibrary.dependsOn(deleteJarLibrary, build)