buildSrc/src/main/kotlin/android-avdl.gradle.kts
changeset 1 831cffa9c991
child 10 9aad34f43f71
equal deleted inserted replaced
0:fef46dce2812 1:831cffa9c991
       
     1 /*
       
     2  * Geekttrss is a RSS feed reader application on the Android Platform.
       
     3  *
       
     4  * Copyright (C) 2017-2020 by Frederic-Charles Barthelery.
       
     5  *
       
     6  * This file is part of Geekttrss.
       
     7  *
       
     8  * Geekttrss is free software: you can redistribute it and/or modify
       
     9  * it under the terms of the GNU General Public License as published by
       
    10  * the Free Software Foundation, either version 3 of the License, or
       
    11  * (at your option) any later version.
       
    12  *
       
    13  * Geekttrss is distributed in the hope that it will be useful,
       
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    16  * GNU General Public License for more details.
       
    17  *
       
    18  * You should have received a copy of the GNU General Public License
       
    19  * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
       
    20  */
       
    21 package com.geekorum.build
       
    22 
       
    23 /**
       
    24  * This defines the configuration to run tests with gradle-avdl.
       
    25  * The CI will run the test on on the following devices.
       
    26  * To run this your project must have declared the following gradle properties
       
    27  * via command line or your gradle.properties
       
    28  * RUN_TESTS_ON_AVDL=true
       
    29  */
       
    30 
       
    31 private val runTestOnAvdl = findProperty("RUN_TESTS_ON_AVDL") as String?
       
    32 val runTests =  runTestOnAvdl?.toBoolean() ?: false
       
    33 
       
    34 if (runTests) {
       
    35     val flydroidUrl = checkNotNull(findProperty("FLYDROID_URL") as String?) { "FLYDROID_URL property not specified" }
       
    36     val flydroidKey = checkNotNull(findProperty("FLYDROID_KEY") as String?) { "FLYDROID_KEY property not specified" }
       
    37 
       
    38     configureAvdlDevices(flydroidUrl, flydroidKey)
       
    39 }