[英]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.