$30 off During Our Annual Pro Sale. View Details »

Gradle, and the beauty of the command line

Gradle, and the beauty of the command line

David González

November 26, 2013
Tweet

More Decks by David González

Other Decks in Programming

Transcript

  1. @dggonzalez
    +David González

    View Slide

  2. Process!

    View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. project structure

    View Slide

  9. testing
    unit tests

    instrumentation tests

    robolectric

    monkey

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. flavours

    View Slide

  19. !
    !
    debug
    betaRelease
    release
    amazon

    View Slide

  20. buildTypes {
    debug {
    packageNameSuffix ".debug"
    versionNameSuffix "-debug"
    }
    !
    betaRelease {
    debuggable false
    jniDebugBuild false
    signingConfig signingConfigs.arteBetaRelease
    }
    !
    release {
    debuggable false
    jniDebugBuild false
    signingConfig signingConfigs.arteRelease
    }
    }

    View Slide

  21. custom config
    !
    String tag = createBuildConstant("TAG",
    "ARTE_DEBUG")
    !
    buildConfig syncFrequency, providerAuthority,
    suggestionsAuthority, pushVersion, tag,
    xitiDomain, xitiSiteId, gcmServer
    !
    Log.d(BuildConfig.TAG, ”stupid log”)

    View Slide

  22. signing

    View Slide

  23. !
    arteBetaRelease
    arteGooglePlay
    arteAmazon

    View Slide

  24. publishing

    View Slide

  25. !
    apply plugin: ‘deploygate'
    !
    Properties props = new Properties()
    props.load(new FileInputStream(file(project.property("DEPLOY.properties"))))
    !
    arteRelease {
    storeFile file("../team-props/arte-android-keystore")
    storePassword props['signing.release.storePassword']
    keyAlias props['signing.release.keyAlias']
    keyPassword props['signing.release.keyPassword']
    }
    arteBetaRelease {
    storeFile file("../team-props/arte.keystore")
    storePassword "THEPASSWORD"
    keyAlias "THEALIAS"
    keyPassword "THEALIASPASSWORD"
    }
    }

    View Slide

  26. issues

    View Slide

  27. !
    testing is slow
    no google play console
    almost weekly updates
    backwards compatibility

    View Slide

  28. advantages
    !
    right direction
    Google support
    almost weekly updates
    flavours
    customisable

    View Slide

  29. contribute
    !
    https://github.com/novoda/
    AndroidBuildTools/issues
    !
    https://github.com/novoda/gradle-android-
    test-plugin
    !
    https://github.com/novoda/gradle-android-
    command-plugin

    View Slide

  30. View Slide

  31. @dggonzalez

    www.novoda.com/blog
    [email protected]
    +David González
    ???

    View Slide