task testng(type: Test) { description "TestNG test in com/irise/testng" useTestNG(){ reports.html.destination = file("$buildDir/reports/testng") } }
用gradle testng运行,报错:
* What went wrong: Could not determine the dependencies of task ':app:testng'. > A base directory must be specified in the task or via a method argument!
test { include '**/*Test.class' exclude '**/*IntegrationTest.class' }
谁告诉你是内置了?你敢不敢好好看文档。自己运行gradletasks--all看看 app:prepareReleaseDependencies
app:processReleaseManifest
app:processReleaseResources
<spanstyle="color:#E53333;">app:test-Rununittestsforallvariants.[app:testDebugUnitTest,app:testReleaseUnitTest]
app:testDebugUnitTest-Rununittestsforthedebugbuild.[app:compileDebugUnitTestSources,app:mockableAndroidJar]
app:assembleDebugUnitTest
app:testReleaseUnitTest-Rununittestsforthereleasebuild.[app:compileReleaseUnitTestSources,app:mockableAndroidJar]
app:assembleReleaseUnitTest
运行gradletasks--all有test,难道我理解错了?
嗯,谢谢!test这个task不是内置在gradle,而是由java这个plugin提供。去掉applyplugin'java'再看就没了。报错说你的参数不对,自行看文档解决。gradle基于groovy语言编写,最好有一些groovy的开发经验版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。