diff --git a/build.gradle b/build.gradle index 79adf58..c806e79 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" - classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0' + classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0' classpath "org.junit.platform:junit-platform-gradle-plugin:$versions.junitPlatform" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' } diff --git a/ci/build.sh b/ci/build.sh index e19b061..110ad70 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -36,9 +36,10 @@ docker run \ --env BINTRAY_USER="$BINTRAY_USER" \ --env BINTRAY_API_KEY="$BINTRAY_API_KEY" \ --env BINTRAY_GPG_PASSPHRASE="$BINTRAY_GPG_PASSPHRASE" \ +--env ANDROID_HOME="" \ --volume `"pwd"`:/opt/project \ --rm \ -openjdk:8u121-jdk \ +openjdk:8u171-jdk \ bash -c "$BUILD_COMMAND" popd diff --git a/dependencies.gradle b/dependencies.gradle index e78bfd2..5b768c5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,15 +1,15 @@ ext.versions = [ - kotlin : '1.1.1', + kotlin : '1.2.41', - rxJava : '1.2.9', + rxJava : '1.3.8', jCommander : '1.71', - commander : '0.1.2', + commander : '0.1.7', junit : '4.12', - junitPlatform: '1.0.0-M4', - spek : '1.1.2', - assertJ : '3.5.2', - mockito : '2.8.9', + junitPlatform: '1.0.1', + spek : '1.1.5', + assertJ : '3.9.1', + mockito : '2.8.1', mockitoKotlin: '1.5.0', ] @@ -25,7 +25,6 @@ ext.libraries = [ junit : "junit:junit:$versions.junit", spek : "org.jetbrains.spek:spek-api:$versions.spek", - spekSubjectExtension : "org.jetbrains.spek:spek-subject-extension:$versions.spek", spekJunitPlatformEngine: "org.jetbrains.spek:spek-junit-platform-engine:$versions.spek", assertJ : "org.assertj:assertj-core:$versions.assertJ", mockito : "org.mockito:mockito-core:$versions.mockito", diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59105ec..7f318f4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/swarmer/build.gradle b/swarmer/build.gradle index e65e6c0..a20f835 100644 --- a/swarmer/build.gradle +++ b/swarmer/build.gradle @@ -17,7 +17,6 @@ dependencies { dependencies { testCompile libraries.spek - testCompile libraries.spekSubjectExtension testRuntime libraries.spekJunitPlatformEngine testCompile libraries.assertJ testCompile libraries.mockito diff --git a/swarmer/src/main/kotlin/com/gojuno/swarmer/Args.kt b/swarmer/src/main/kotlin/com/gojuno/swarmer/Args.kt index 3c26a14..9267ee3 100644 --- a/swarmer/src/main/kotlin/com/gojuno/swarmer/Args.kt +++ b/swarmer/src/main/kotlin/com/gojuno/swarmer/Args.kt @@ -25,17 +25,17 @@ sealed class Commands { @Parameters( commandDescription = "Print help and exit.", - commandNames = arrayOf("--help", "-help", "help", "-h") + commandNames = ["--help", "-help", "help", "-h"] ) object Help : Commands() @Parameters( commandDescription = "Start emulators listed", - commandNames = arrayOf("start") + commandNames = ["start"] ) data class Start( @Parameter( - names = arrayOf(PARAMETER_EMULATOR_NAME), + names = [PARAMETER_EMULATOR_NAME], required = true, description = "Name for the emulator, i.e. `test_emulator_1` to pass to `avdmanager create avd --name`.", order = 1 @@ -43,7 +43,7 @@ sealed class Commands { var emulatorName: String = "", @Parameter( - names = arrayOf("--package"), + names = ["--package"], required = true, description = "Package of the system image for this AVD (e.g.'system-images;android-25;google_apis;x86') to pass to `avdmanager create avd --package`.", order = 2 @@ -51,7 +51,7 @@ sealed class Commands { var pakage: String = "", @Parameter( - names = arrayOf("--android-abi"), + names = ["--android-abi"], required = true, description = "Android system image abi, i.e. `google_apis/x86_64` to pass to `avdmanager create avd --abi`.", order = 3 @@ -59,7 +59,7 @@ sealed class Commands { var androidAbi: String = "", @Parameter( - names = arrayOf("--path-to-config-ini"), + names = ["--path-to-config-ini"], required = true, description = "Path either relative or absolute to the file that will be used as `config.ini` for created emulator.", order = 4 @@ -67,7 +67,7 @@ sealed class Commands { var pathToConfigIni: String = "", @Parameter( - names = arrayOf("--emulator-start-options"), + names = ["--emulator-start-options"], required = false, variableArity = true, description = "Options to pass to `emulator -avd \$emulatorName` command, i.e. `--no-window -prop persist.sys.language=en -prop persist.sys.country=US`.", @@ -76,7 +76,7 @@ sealed class Commands { var emulatorStartOptions: List = emptyList(), @Parameter( - names = arrayOf("--emulator-start-timeout-seconds"), + names = ["--emulator-start-timeout-seconds"], required = false, description = "Timeout to wait for emulator to finish boot. Default value is 180 seconds.", order = 6 @@ -84,7 +84,7 @@ sealed class Commands { var emulatorStartTimeoutSeconds: Long = 180, @Parameter( - names = arrayOf("--redirect-logcat-to"), + names = ["--redirect-logcat-to"], required = false, description = "Path either relative or absolute to the file that will be used to redirect logcat of started emulator to. No redirection will happen if parameter is not presented.", order = 7 @@ -92,7 +92,7 @@ sealed class Commands { var redirectLogcatTo: String? = null, @Parameter( - names = arrayOf("--redirect-output-to"), + names = ["--redirect-output-to"], required = false, description = "Path either relative or absolute to the directory that will be used to redirect emulator command output. No redirection will happen if parameter is not presented.", order = 8 @@ -100,7 +100,7 @@ sealed class Commands { var redirectOutputTo: String? = null, @Parameter( - names = arrayOf("--verbose-emulator"), + names = ["--verbose-emulator"], required = false, description = "Print verbose emulator initialization messages.", order = 9 @@ -108,7 +108,7 @@ sealed class Commands { var verbose: Boolean = false, @Parameter( - names = arrayOf("--keep-output-on-exit"), + names = ["--keep-output-on-exit"], required = false, description = "Keep output of emulator command on exit. False by default.", order = 10 @@ -116,7 +116,7 @@ sealed class Commands { var keepOutputOnExit: Boolean = false, @Parameter( - names = arrayOf("--use-compat-emulator"), + names = ["--use-compat-emulator"], required = false, description = "Use old compat emulator tool. Look https://issuetracker.google.com/issues/66886035 for details. False by default.", order = 10 @@ -127,11 +127,11 @@ sealed class Commands { @Parameters( commandDescription = "Stop all emulators", - commandNames = arrayOf("stop") + commandNames = ["stop"] ) data class Stop( @Parameter( - names = arrayOf("--timeout"), + names = ["--timeout"], required = false, description = "Timeout for emulators to stop in seconds, default is 15 seconds.", order = 1 diff --git a/swarmer/src/test/kotlin/com/gojuno/swarmer/EmulatorsSpec.kt b/swarmer/src/test/kotlin/com/gojuno/swarmer/EmulatorsSpec.kt index 4f42a96..e863a08 100644 --- a/swarmer/src/test/kotlin/com/gojuno/swarmer/EmulatorsSpec.kt +++ b/swarmer/src/test/kotlin/com/gojuno/swarmer/EmulatorsSpec.kt @@ -3,7 +3,11 @@ package com.gojuno.swarmer import com.gojuno.commander.android.AdbDevice import com.gojuno.commander.android.adb import com.gojuno.commander.os.Notification -import com.nhaarman.mockito_kotlin.* +import com.nhaarman.mockito_kotlin.any +import com.nhaarman.mockito_kotlin.argumentCaptor +import com.nhaarman.mockito_kotlin.mock +import com.nhaarman.mockito_kotlin.verify +import com.nhaarman.mockito_kotlin.whenever import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.it @@ -16,9 +20,9 @@ import java.util.concurrent.TimeUnit class EmulatorsSpec : Spek({ val ADB_DEVICES = setOf( - AdbDevice("id1", true), - AdbDevice("id2", true), - AdbDevice("id3", true) + AdbDevice("id1", online = true), + AdbDevice("id2", online = true), + AdbDevice("id3", online = true) ) arrayOf(