创建一个测试二进制文件 - Gradle [英] Creating a Jar of test binaries - Gradle

查看:146
本文介绍了创建一个测试二进制文件 - Gradle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新版本的Gradle(里程碑9),我试图弄清楚如何创建所有测试二进制文件的Jar。



从我在互联网上找到的内容可以看出:

  task packageTests(type:Jar){$ b $ from sourceSets.test.classes 
}

然而,我得到了 - $ /


无法获取源集$上的只写属性'classes'的值
测试。

什么是正在编码我想要达到的方法?



属性'classes'现在不太赞成吗?

解决方案

更改 sourceSets.test.classes sourceSets.test.output 解决了这个问题。


I'm using the latest version of Gradle (milestone 9), and I'm trying to figure out how to create a Jar of all test binaries.

From what I've found on the internet, the following should work:

task packageTests(type: Jar) {
  from sourceSets.test.classes
}

However I am getting a -

Cannot get the value of write-only property 'classes' on source set test.

What is the correct way of coding what I'm trying to achieve?

Is the property 'classes' somehow deprecated now ?

解决方案

Changing sourceSets.test.classes to sourceSets.test.output fixes the problem.

这篇关于创建一个测试二进制文件 - Gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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