cesards
2/22/2015 - 11:44 AM

Signing Options

Signing Options

STORE_FILE=/path/to/your.keystore
STORE_PASSWORD=yourkeystorepass
KEY_ALIAS=projectkeyalias
KEY_PASSWORD=keyaliaspassword
android {

    signingConfigs {
        release
    }

    buildTypes {
            release {
                signingConfig signingConfigs.release
            }
    }
}

def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()){
    props.load(new FileInputStream(propFile))

    if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
            props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
        android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
        android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
        android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
        android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
    } else {
        println 'signing.properties found but some entries are missing'
        android.buildTypes.release.signingConfig = null
    }
}else {
    println 'signing.properties not found'
    android.buildTypes.release.signingConfig = null
}
// https://github.com/novoda/bintray-release
// https://github.com/chrisbanes/gradle-mvn-push
Properties properties = new Properties( )
properties.load(project.rootProject.file('local.properties').newDataInputStream( ))

publish {
  userOrg = 'cesards'
  repoName = 'maven'
  artifactId = 'CropImageView'
  groupId = 'com.cesards.android'
  publishVersion = '1.0.1'
  desc =
      'Widget allows you crop from whatever side in an ImageView. Currently Android only supports centerCrop type of cropping'
  licences = ["Apache-2.0"]
  website = 'https://github.com/cesards/CropImageView'
  bintrayUser = properties.getProperty("bintray.user")
  bintrayKey = properties.getProperty("bintray.apikey")
}