Creating a Jar of test binaries - Gradle

Go To StackoverFlow.com

44

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 ?

2012-04-05 18:38
by vicsz


71

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

2012-04-05 22:08
by vicsz
This is due to a change in the behaviour of Gradle between version - TheKaptain 2012-12-01 07:09
Thank you for answering your own questions for others to find - Patrick Auld 2012-12-13 20:15
What version of Gradle had the change in behavior - Snekse 2014-12-23 17:22
Ads