Best way to sign Jenkins Android apps with Gradle

I am setting up Jenkins CI for our Android applications. I am completely new to Gradle and try to integrate it with Jenkins. I installed the Gradle plugin that runs assembleReleasein my applications.

Every possible application built with this CI must use the same keystore that will be signed.

What I've done:

  • Create a Gradle script to store the alias / password and key store location:

    android {
        signingConfigs {
            release {
                storeFile file('/absolute/path/to/keystore')
                storePassword 'XXX'
                keyAlias 'XXX'
                keyPassword 'XXX'
            }
        }
    
        buildTypes {
            release {
                signingConfig signingConfigs.release
            }
        }
    }
    
  • Then, in every project that is, the build.gradle file contains:

    if (new File('/path/to/the/build/file/above').exists()) {
        apply from : '/path/to/the/build/file/above'
    }
    
    buildTypes {
        release {
            **Project-specific config**
        }
    }
    

, , Jenkins , . , "" "" build.gradle, .

?

+4

Source: https://habr.com/ru/post/1568752/


All Articles