apply plugin: 'com.android.library'
apply plugin: 'bintray-release'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 4
        targetSdkVersion 22

        versionName VERSION_NAME
        versionCode Integer.parseInt(VERSION_CODE)
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    signingConfigs {
        release {
            def Properties localProps = new Properties()
            localProps.load(new FileInputStream(file('../local.properties')))
            def Properties keyProps = new Properties()
            assert localProps['keystore.props.file'];
            keyProps.load(new FileInputStream(file(localProps['keystore.props.file'])))
            storeFile file(keyProps["store"])
            keyAlias keyProps["alias"]
            storePassword keyProps["storePass"]
            keyPassword keyProps["pass"]
        }
    }

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

        publicBeta.initWith(buildTypes.release)
        publicBeta {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-rules.txt')
            versionNameSuffix " " + VERSION_BETANUMBER
        }

        publicDebug.initWith(buildTypes.publicBeta)
        publicDebug {
            debuggable true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-rules.txt')
            versionNameSuffix " Debug " + VERSION_BETANUMBER
        }
    }
}

dependencies {
    compile 'com.nineoldandroids:library:2.4.0'
}

publish {
    userOrg = POM_DEVELOPER_ID
    groupId = GROUP_ID
    artifactId = ARTIFACT_ID
    publishVersion = VERSION_NAME
    uploadName = UPLOAD_NAME
    description = POM_DESCRIPTION
    website = POM_URL
}
