diff --git a/README.md b/README.md index ee3aeb5..2a9b8a2 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,13 @@ For running tests on a project with no variants, you can simply run following co gradle clean uploadDebugToBrowserstackAppLive ``` +For uploading apps to AppLive / AppAutomate, you can pass customId through command line args as well + +``` +gradle clean uploadDebugToBrowserstackAppLive --customId='your-custom-id' + +``` + And for projects with productFlavors, replace ${buildVariantName} with your build variant name, for example if your productFlavor name is "phone" and you want to upload debug build type of this variant then command will be gradle clean uploadPhoneDebugToBrowserstackAppLive. ##### Supported browserStackConfig parameters diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3a01b17..bf3de21 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/browserstack/gradle/BrowserStackTask.java b/src/main/java/com/browserstack/gradle/BrowserStackTask.java index 1f99d96..8f285c0 100644 --- a/src/main/java/com/browserstack/gradle/BrowserStackTask.java +++ b/src/main/java/com/browserstack/gradle/BrowserStackTask.java @@ -17,6 +17,7 @@ import org.gradle.api.DefaultTask; import org.gradle.api.tasks.Input; import org.jetbrains.annotations.NotNull; +import org.gradle.api.tasks.options.Option; public class BrowserStackTask extends DefaultTask { @@ -58,6 +59,11 @@ public void setCustomId(String customId) { this.customId = customId; } + @Option(option = "customId", description = "CustomId passed through command line.") + public void overrideCustomId(String customId) { + this.customId = customId; + } + public void setDebug(boolean debug) { isDebug = debug; } diff --git a/test.rb b/test.rb index 1c013e8..075f7de 100644 --- a/test.rb +++ b/test.rb @@ -55,6 +55,12 @@ def run_tests print_separator end +def run_tests_with_command_line_params + puts "\nRunning new tests using ./gradlew with command line arg" + run_app_live_test("./gradlew clean uploadDebugToBrowserstackAppLive --customId='abc123'") + print_separator +end + def run_tests_with_flavors puts "Running tests with flavors using ./gradlew" run_basic_espresso_test("./gradlew clean executePhoneDebugTestsOnBrowserstack") @@ -92,6 +98,7 @@ def test build_plugin setup_repo run_tests + run_tests_with_command_line_params setup_repo_with_app_variants run_tests_with_flavors remove_repo