Giter Site home page Giter Site logo

gradle-testflight-plugin's Introduction

gradle-testflight-plugin

This plugin is designed to run when you invoke the task:

$ gradle testFlightUploadTask

Visit http://testflightapp.com to set up your TestFlight account.

The below configuration is based on publishing an Android app's .apk file.


    buildscript {
        repositories {
            mavenCentral()

            // If you are using a specific repository that you or someone else hosts and requires
            // authentication, add these properties: repoUsername, repoPassword, and releaseRepoUrl
            // to your gradle.properties file, or pass them using the -P arguments on the command line.
            maven {
                credentials {
                    username repoUsername
                    password repoPassword
                }
                url releaseRepoUrl
            }
        }
        dependencies {
            classpath 'com.willowtreeapps.gradle.plugins:gradle-testflight-plugin:1.0'
        }
    }

    apply plugin: 'testFlight'

    // This is an optional helper method to get the file path of an Android .apk file.  Note that
    // the file name is based on a convention we like, and you should put in the file name according
    // to your build.  The verify step is for assurance that the .apk has actually been created
    // before you try to post it to TestFlight.
    final getApkPath(boolean verify) {
        def fileName = "${buildDir}/apk/${archivesBaseName}-${version}-signed-aligned.apk"
        File f = file(fileName)
        if (verify) {
            assert f.exists()
        }
        return fileName
    }

    // testFlightConfig corresponds to the plugin's extension that exposes the configuration to your
    // build.gradle file.

    testFlightConfig {

        // currentTarget is a required configuration and should be set with your default target.
        // Note its name is compared to the named targets below, but is a case insensitive comparison.

        currentTarget = 'Internal'

        // Add -PtestFlightTarget= some target such as 'internal' or 'external' to specify which specific
        // test flight account you want to upload to.

        // -PtestFlightTarget=external

        if (project.hasProperty('testFlightTarget')) {
            currentTarget = testFlightTarget
        }

        // The date and notes params are just here to illustrate an example of creating notes you may
        // want to pass with your upload.
        String date = new Date(System.currentTimeMillis()).format("hh:mm aa")
        String notes = "APK pushed from the gradle-testflight-plugin to the [${currentTarget}] target at ${date}."

        // The plugin allows you to configure any number of TestFlight targets to which you may want
        // to post your mobile app.  The property values to right assume you have either configured
        // them into your gradle.properties file or are passing them in on the command line.

        // This is an example of two targets arbitrarily named internal and external that have been configured
        // where the internal target is for my testers, and the external target is for my clients.

        targets {
            internal {
                testFlightApiToken = internalApiToken
                testFlightTeamToken = internalTeamToken
                testFlightDistroList = 'Internal'
                testFlightNotifyDistroList = false
                testFlightBuildNotes = notes
                testFlightReplace = true // defaults to true
                filePath = getApkPath(true)
            }

            external {
                testFlightApiToken = externalApiToken
                testFlightTeamToken = externalTeamToken
                testFlightDistroList = externalDistroList
                testFlightNotifyDistroList = true
                testFlightBuildNotes = 'Release notes you want to share with your client.'
                testFlightReplace = true // defaults to true
                filePath = getApkPath(true)
            }
        }
    }

gradle-testflight-plugin's People

Contributors

andrewshannon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.