https://github.com/felHR85/UsbSerial
Raw File
Tip revision: 1e6b5d3938b71f74e2968e20793f5c90e30fbad3 authored by Felipe Herranz on 23 February 2019, 18:14:53 UTC
release 6.0.3
Tip revision: 1e6b5d3
build.gradle
apply plugin: 'com.android.library'

def artifact = "usbserial.jar"

android {

    group = 'com.felhr.usbserial'
    version = project.VERSION_NAME

    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)

    compileOptions {
        encoding "UTF-8"
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
        archivesBaseName = "${project.name}-${project.VERSION_NAME}"
    }

    //noinspection GroovyAssignabilityCheck
    task deleteJar(type: Delete) {
        delete "eclipse_lib/${artifact}"
    }

    //noinspection GroovyAssignabilityCheck
    task createJar(type: org.gradle.api.tasks.Copy) {
        from('build/intermediates/bundles/release/')
        into('eclipse_lib/')
        include('classes.jar')
        rename('classes.jar', artifact)
    }

    dependencies {
        implementation 'com.annimon:stream:1.2.1'
        implementation 'com.squareup.okio:okio:2.1.0'

        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        androidTestImplementation 'junit:junit:4.12'

        testImplementation 'junit:junit:4.12'

    }

    createJar.dependsOn(deleteJar, build)
}
back to top