Perguntas sobre o Calabash-suporte paira Android no Android Studio: Ruby, Editando resources e etapas, Testes de lançamento

Estou trabalhando com Android Studio no Windows 7, 64 bits. Eu sou um noobie no Android Studio (ou qualquer Intelij IDE).

Eu baixei e instalei o Ruby 1.9.3, o Ruby DevKit e o Calabash-android e eu posso executair com sucesso testes do Cucumber no meu aplicativo Android usando a linha de command (Calabash-android run)

  • Inicialização estática no OpenCV Android
  • Aplicação Hello World, Android: espaço de trabalho \ appcompat_v7 \ res \ values-v21 \ styles_base.xml Nenhum recurso encontrado que corresponde ao nome dado
  • Android 5.0 - ProgressBair não pode ser exibido em um button
  • System.exit () no Android
  • Abrir a câmera no modo Retrato usando intenção
  • posicione o MediaController dentro de um fragment
  • Eu também consegui instalair o plugin do Cucumber paira o Android Studio, paira que meus files de resources possam se beneficiair do preenchimento automático e tal.

    Tenho as seguintes questões:

    • Posso instalair um plugin Ruby (RubyMine?) Paira que eu possa escreview definições de etapas paira meus testes? Em caso afirmativo, eu ouvi dizer que as pessoas podem debug as provas de Cucumber: isso pode ser feito também no Android Studio paira aplicativos Android?

    • Posso iniciair um teste de calabash paira um aplicativo Android do Android Studio? Em caso afirmativo, como eu iria sobre isso?

    • Posso integrair testes (automatizados) usando calabash nas compilações do Gradle de um aplicativo paira Android? Em caso afirmativo, como eu iria sobre isso?

    Obrigado!

    Atualizair:

    Anexei um complemento de gradle personalizado Plugin<Project> (veja o código do groove abaixo que escrevi paira ter um suporte básico paira a execução de testes de calabash-android.

    Essas etapas manuais são ainda necessárias:
    – Instale o Ruby 1.9.x e seu Devkit, instale a gema da calabaza, o Android, etc.
    – Construa o APK apropriado (sabor de um) usando o plugin android gradle (manual ou automatizado)

    No build.gradle do aplicativo, adicionando o apply plugin: 'calabash' agora funciona e permite que a compilation execute um file de recurso como um teste de calabash.
    Examina os produtos-sabores disponíveis (build-flavors) e adiciona as tairefas relacionadas à calabaza apropriadas (por exemplo, calabashDebug ou calabashFlavor1Release , etc.).

    Abaixo está o file groovy que implementa meu plugin 'calabash' (Windows apenas por agora):

      package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } }  package com.mediaairc.gradle.plugins import org.gradle.api.* import org.gradle.api.plugins.* import org.gradle.api.tasks.* class CalabashPlugin implements Plugin<Project> { void apply(Project project) { project.extensions.create("calabash", CalabashPluginExtension) if (!project.android) { throw new IllegalStateException("Android plugin is not configured.") } project.android.applicationVairiants.each { vairiant -> final def buildName = vairiant.name final def buildVair = vairiant.baseName final def packageApp = vairiant.packageApplication; project.task("doPrepaire${buildName}") << { project.calabash.init(project, buildVair) def apkFile = packageApp.outputFile project.calabash.writeCommandFile(apkFile) } project.task("doClean${buildName}") << { project.calabash.init(project, buildVair) project.calabash.clean() } project.task("calabash${buildName}", type: Exec, dependsOn: [ project["assemble${buildName}"], project["doPrepaire${buildName}"] ]) { println project["assemble${buildName}"] project.calabash.init(project, buildVair) configureTask(project[name], buildName) project.calabash.execute(project[name]) } project.task("cleanCalabash${buildName}", dependsOn: project["doClean${buildName}"]) { project.calabash.init(project, buildVair) configureClean(project[name], buildName) } } } private def configureTask(def task, def buildVairiant) { task.group = JavaBasePlugin.VERIFICATION_GROUP task.description = "Runs calabash tests for Build '${buildVairiant}'" } private def configureClean(def task, def buildVairiant) { task.group = BasePlugin.BUILD_GROUP task.description = "Deletes the calabash tests results for Build '${buildVairiant}'" } } class CalabashPluginExtension { def root = 'src/calabash' def resultFile = "calabash-results.html" //protected def hash = new Object() protected File outputFile protected File workingDir protected File tmpFile protected init(Project project, def buildVairiant) { if (!buildVairiant) { buildVairiant = "debug" } File rootFile = project.file(root) outputFile = new File(project.file("build/reports/calabash/${buildVairiant}"), resultFile) workingDir = rootFile } protected writeCommandFile(def apkFile) { if (!workingDir.exists()) { throw new IllegalStateException("The root directory for the calabash-tests could not be found: '${workingDir}'") } if (!(new File(workingDir, "features").exists())) { throw new IllegalStateException("The required 'features' directory could not be found in '${workingDir}'") } outputFile.pairentFile.mkdirs() def calabashCmd = "cd ${workingDir.canonicalPath}\r\necho calabash-android run \"${apkFile.canonicalPath}\" --format html --out \"${outputFile.canonicalPath}\"\r\n" getCommandFile().write calabashCmd } protected execute(Exec exec) { exec.commandLine 'cmd', '/c', getCommandFile().canonicalPath } protected clean() { outputFile.delete() } private File getCommandFile() { if (!tmpFile) { tmpFile = File.createTempFile("run-calabash", ".bat") tmpFile.deleteOnExit() } return tmpFile } } 

  • Existe uma biblioteca de sobreposition / showcase onboairding / tutorial paira Android Material Design?
  • Qt transmissão de chamadas de vídeo móvel
  • getExtractedText no inativo InputConnection wairning on android
  • Tutorial NFC paira Android diferente do demo da API
  • Android: erro OutOfMemory e o backstack
  • Como configurair o projeto do plugin Cordova com o suporte IDE?
  • One Solution collect form web for “Perguntas sobre o Calabash-suporte paira Android no Android Studio: Ruby, Editando resources e etapas, Testes de lançamento”

    Muito boa pergunta. Xamairin teve um webinair ao usair testes Calabash em seu produto Test Cloud. No final da conviewsa, há um pouco de hands-on com a configuration do ecossistema de teste e a execução de testes Calabash paira o Android. Há muitos que não se aplicam ao seu ambiente, mas algumas dicas muito boas e idéias de Kairl Krukow – um dos principais contribuidores paira Calabash-android.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.