It is hard to define what I want. By adding new sourceSet user wouldn`t
always want new tests. There may be anything else. So that means customly
created tasks shouldn`t be somehow automatically reconfigured. I`m happy I
got it how to create my own targets in plugins and let`s leave it as is for
now.


Adam Murdoch-2 wrote:
> 
> 
> 
> Narco wrote:
>> Found the correct solution:
>> project.sourceSets {
>>             'test-unit' {
>>                 compileClasspath = project.sourceSets.main.classes +
>> project.configurations.compile +
>>                         project.configurations.testCompile
>>                 runtimeClasspath = project.sourceSets.'test-unit'.classes
>> +
>> project.sourceSets.main.classes +
>>                         project.configurations.compile +
>> project.configurations.testRuntime
>>             }
>>         }
>>         
>>         project.getTasks().add('testUnitJar', Jar.class)
>>         project.testUnitJar.from(project.sourceSets.'test-unit'.classes)
>>         project.testUnitJar.fileSet(dir:
>> project.sourceSets.'test-unit'.classesDir)
>>         project.testUnitJar.appendix = 'test-unit'
>>
>>         project.getTasks().add('testUnitTest', Test.class)
>>         project.testUnitTest.testClassesDir =
>> project.sourceSets.'test-unit'.classesDir
>>         project.testUnitTest.classpath =
>> project.sourceSets.'test-unit'.runtimeClasspath
>>
>> Works nice, but I need to define almost every task attribute by hands. I
>> was
>> expecting that 'test-unit' folder will be mapped everywhere by default.
>>
>>   
> 
> That would be good. Could you add a JIRA issue for this?
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Assembling-a-JAR-for-a-custom-source-set-tp26130892p26195893.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to