如何从命令行将test.testLogging.showStandardStreams设置为true? [英] How do I set test.testLogging.showStandardStreams to true from the command line?

查看:403
本文介绍了如何从命令行将test.testLogging.showStandardStreams设置为true?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我可以添加<$ c $时,通过检查stdout上的日志记录来编写单元测试时,调试一些外部库甚至内部代码是很方便的。 c> test.testLogging.showStandardStreams = true 到build.graddle文件,我宁愿做一些不太长久的事情,比如从命令行执行gradle设置这个标志。



我尝试了几种方法,但都没有效果:

  gradle test -Dtest .testLogging.showStandardStreams = true 
gradle test -Ptest.testLogging.showStandardStreams = true

这些选项的其他变体通过更改属性字符串。没有什么似乎可以做到的。



如何从命令行设置 test.testLogging.showStandardStreams = true

解决方案

没有内置的方法来从命令行设置构建模型属性。您必须让构建脚本查询通过 -D -P ,分别。

It is convenient to debug some of external libraries and even internal code while writing unit tests by reviewing the logging on stdout.

While I can add test.testLogging.showStandardStreams = true to the build.graddle file, I'd rather do something less permanent, such as setting this flag from the command line execution of gradle.

I've tried several approaches, none seem to work:

gradle test -Dtest.testLogging.showStandardStreams=true
gradle test -Ptest.testLogging.showStandardStreams=true

And other variations of those options by changing the property string. Nothing seems to do the trick.

How do I set test.testLogging.showStandardStreams=true from the command line?

解决方案

There is no built-in way to set build model properties from the command line. You'll have to make the build script query a system or project property that gets passed in via -D or -P, respectively.

这篇关于如何从命令行将test.testLogging.showStandardStreams设置为true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆