Hi there

I have a project that I want to package as a large number of jars (~30).
I've seen a solution on the mailing list that looks like this:

jar {
    include 'com/mycompany/package1/**'
}

task otherJar(type: Jar) {
    from sourceSets.main.classes
    include 'com/mycompany/package2/**'
    // you will need something to distinguish this jar from the other,
one of:
    // baseName = 'myotherjar'
    // classifier = 'someclassifier'
    // customName = 'myotherjar.jar'
}

I accept that this would work for me however I was hoping to do something
like this to reduce the amount jar-type tasks:

def components = [
    [name: 'validate-metadata', title: 'Validate Metadata Component',
pattern: 'com/mycompany/package1/**']
    [name: 'generate-pdf', title: 'Generate PDF Component', pattern:
'com/mycompany/package2/**']
    [name: 'approve-package', title: 'Approve Package Component', pattern:
'com/mycompany/package3/**']
    etc..
]

task createComponents {
    components.each { c ->
        // call some jar-type task..
    }
}

Is this possible? Would I have to use AntBuilder to do this?

Cheers

Mark

Reply via email to