简体   繁体   English

通过测试后,android gradle运行汇编

[英]android gradle run assemble after tests pass

I'm trying to fire off various android based gradle tasks eg assemble, after 'gradle clean test' is run. 我正在尝试在运行“ gradle clean test”后触发各种基于android的gradle任务,例如汇编。

Some background... 一些背景...

My company has jenkins and it is managed by a separate team so I don't have access to configure it myself. 我的公司有jenkins,由一个独立的团队管理,因此我无权自己配置。 On any changes to the remote repo (git) a jenkins job will fire, running gradle clean test and using a build.gradle file that we have inside our repo. 在对远程仓库(git)进行任何更改时,都会执行jenkins作业,运行gradle clean测试并使用仓库中包含的build.gradle文件。

I'm told that this is the only command that the build team will provide and if I want any further actions running, I'll have to configure them inside the build.gradle script. 有人告诉我这是构建团队将提供的唯一命令,如果我想运行任何其他操作,则必须在build.gradle脚本中进行配置。

I am imagining that I can possibly do something like afterTest(:assemble) or maybe addTestListener() but I can't seem to find any examples on google. 我在想我可以做类似afterTest(:assemble)或addTestListener()的事情,但是我似乎在Google上找不到任何示例。

Can anyone here help me? 这里有人可以帮助我吗? Is this even possible or should I ask my build team to allow me to run a diff gradle task depending on what I want? 甚至有可能吗?还是我应该让我的构建团队根据我的需要允许我执行diff gradle任务?

Configuring CI jobs uniformly is a good idea. 统一配置CI作业是一个好主意。 However, there is no good way to have additional independent tasks executed when gradle clean test is run. 但是,没有最佳方法在运行gradle clean test时执行其他独立任务。 They'd have to at least run gradle clean build so that you can add tasks with build.dependsOn(myTask) . 他们至少必须运行gradle clean build以便您可以使用build.dependsOn(myTask)添加任务。 (However, keep in mind that build already depends on assemble .) Or they run a custom task such as gradle (clean) ciBuild which by default only depends on test , and to which further task dependencies can be added as necessary. (但是,请记住, build已经依赖于assemble 。)或者它们运行自定义任务,例如gradle (clean) ciBuild ,默认情况下仅依赖test ,并且可以根据需要向其添加更多任务依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 升级到3.0.1 android gradle插件后,Android Espresso测试将无法运行 - Android Espresso tests won't run after upgrading to 3.0.1 android gradle plugin 在Gradle for Android应用程序中运行JUnit测试 - Run JUnit tests in Gradle for Android app 更新到android gradle插件2.3后,多模块MultiDex项目不会运行测试 - Multi-module MultiDex project won't run tests after update to android gradle plugin 2.3 在 Jenkins (Gradle) 上运行 android 单元测试和仪器测试 - Run android unit tests & instrumentation tests on Jenkins (Gradle) Android项目和Gradle:组装单个模块 - Android project and Gradle: assemble a single module 神器组装后如何运行shell脚本? - How to run shell script after artifact assemble? 如何使用Gradle运行一组特定的Android检测测试? - How can I run a specific set of Android instrumentation tests with Gradle? 有没有办法只在 Android Gradle 项目中运行一组特定的仪器测试? - Is there a way to only run a specific set of instrumentation tests in an Android Gradle project? 无法使用Gradle和Android Studio运行Robolectric测试-找不到StyleData - Cannot run Robolectric tests with Gradle and Android Studio - StyleData not found 如何使用IDEA + Gradle + Android运行单元测试 - How to run unit tests with IDEA+Gradle+Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM