view app/build.gradle @ 442:ced663d2e957

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 12:29:29 -0800
parents 592f0ef08d94
children 2907c688955e
line wrap: on
line source

tasks.whenTaskAdded { task ->
    if (task.name.contains("lint")) {
        task.enabled = false
    }
}

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

model {
    def signConf

    android {
        compileSdkVersion = 16
        buildToolsVersion = "23.0.2"

        defaultConfig.with {
            applicationId = "com.five_ten_sg.connectbot"
            minSdkVersion.apiLevel = 8
            targetSdkVersion.apiLevel = 15
        }
    }

    compileOptions.with {
        sourceCompatibility = JavaVersion.VERSION_1_7
        targetCompatibility = JavaVersion.VERSION_1_7
    }

    android.ndk {
        moduleName = "com_google_ase_Exec"
        cppFlags.add("-Werror")
        ldLibs.add("log")
    }

    android.sources {
        main {
            jni {
                source {
                    srcDir "Exec"
                }
            }
        }
    }

    android.signingConfigs {
        create("signed") {
            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"
            signConf  = it
        }
    }

    android.buildTypes {
        release {
            minifyEnabled = false
            signingConfig = signConf
            //proguardFiles.add(file('proguard-rules.txt'))
        }
        debug {
            debuggable = true
        }
    }

    android.productFlavors {
        create("arm") {
            ndk.abiFilters.add("armeabi")
        }
        create("x86") {
            ndk.abiFilters.add("x86")
        }
    }

}