view app/build.gradle @ 450:50d5ed32327d

fix lint error
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Mar 2016 15:42:41 -0700
parents 2907c688955e
children 7492d2cb7b75
line wrap: on
line source

task copyDebugLibTask(type: Copy) {
    from 'build/intermediates/binaries/debug/arm/lib/armeabi'
    into 'src/main/jniLibs/armeabi'
}
task copyReleaseLibTask(type: Copy) {
    from 'build/intermediates/binaries/release/arm/lib/armeabi'
    into 'src/main/jniLibs/armeabi'
}

tasks.whenTaskAdded { task ->
    if (task.name.contains("merge") && task.name.contains("JniLibFolders")) {
        if (task.name.contains("ArmDebug")) {
            task.dependsOn copyDebugLibTask
        }
        if (task.name.contains("ArmRelease")) {
            task.dependsOn copyReleaseLibTask
        }
    }
}


apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 16
        buildToolsVersion = "23.0.2"
        buildTypes {
            release {
                minifyEnabled = false
                signingConfig = $("android.signingConfigs.release")
            }
            debug {
                debuggable = true
                ndk {
                    debuggable = true
                }
            }
        }
        productFlavors {
            create("arm") {
                ndk.abiFilters.add("armeabi")
            }
            create("x86") {
                ndk.abiFilters.add("x86")
            }
        }
        ndk {
            moduleName = "com_google_ase_Exec"
            cppFlags.add("-Werror")
            ldLibs.add("log")
        }
        sources {
            main {
                jni {
                    source {
                        srcDir "Exec"
                    }
                }
            }
        }
        defaultConfig.with {
            applicationId = "com.five_ten_sg.connectbot"
            minSdkVersion.apiLevel = 8
            targetSdkVersion.apiLevel = 15
        }
    }

    android.signingConfigs {
        create("release") {
            def console = System.console()
            if (console) {
                storePassword = new String(console.readPassword("\nkey store password: "))
                keyPassword   = new String(console.readPassword("\nkey alias password: "))
            }
            else {
                def read = System.in.newReader().&readLine
                print "\nkey store password"
                storePassword = read()
                print "\nkey alias password"
                keyPassword   = read()
            }
            storeFile = file("../510Connectbot.keystore")
            storeType = "jks"
            keyAlias  = "510Connectbot"
        }
    }
}