Skip to content

Instantly share code, notes, and snippets.

@Quadriphobs1
Forked from gabrielemariotti/build.gradle
Created January 15, 2019 10:03
Show Gist options
  • Select an option

  • Save Quadriphobs1/6e08e43b1db2da59bce89299ee3e5b23 to your computer and use it in GitHub Desktop.

Select an option

Save Quadriphobs1/6e08e43b1db2da59bce89299ee3e5b23 to your computer and use it in GitHub Desktop.

Revisions

  1. @gabrielemariotti gabrielemariotti revised this gist Nov 24, 2013. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions build.gradle
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,16 @@
    android {

    signingConfigs {
    release
    }

    buildTypes {
    release {
    signingConfig signingConfigs.release
    }
    }
    }

    def Properties props = new Properties()
    def propFile = new File('signing.properties')
    if (propFile.canRead()){
  2. @gabrielemariotti gabrielemariotti revised this gist Oct 7, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions build.gradle
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,10 @@ if (propFile.canRead()){
    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
    }
  3. @gabrielemariotti gabrielemariotti revised this gist Oct 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build.gradle
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    def Properties props = new Properties()
    def propFile = new File('signing.properties')
    if (propFile.canRead()){
    props.load(new FileInputStream(proFile))
    props.load(new FileInputStream(propFile))

    if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
    props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
  4. @gabrielemariotti gabrielemariotti revised this gist Oct 6, 2013. 1 changed file with 13 additions and 8 deletions.
    21 changes: 13 additions & 8 deletions build.gradle
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,17 @@
    def Properties props = new Properties()
    props.load(new FileInputStream(file('signing.properties')))
    def propFile = new File('signing.properties')
    if (propFile.canRead()){
    props.load(new FileInputStream(proFile))

    if (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 {
    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 {
    android.buildTypes.release.signingConfig = null
    }
    }else {
    android.buildTypes.release.signingConfig = null
    }
  5. @gabrielemariotti gabrielemariotti created this gist Oct 6, 2013.
    12 changes: 12 additions & 0 deletions build.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    def Properties props = new Properties()
    props.load(new FileInputStream(file('signing.properties')))

    if (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 {
    android.buildTypes.release.signingConfig = null
    }
    4 changes: 4 additions & 0 deletions signing.properties
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    STORE_FILE=/path/to/your.keystore
    STORE_PASSWORD=yourkeystorepass
    KEY_ALIAS=projectkeyalias
    KEY_PASSWORD=keyaliaspassword