nilsmagnus / wsdl2java

Gradle plugin for generating java source from wsdl files
MIT License
142 stars 77 forks source link

Make deleteOutputFolders call in wsdl2java task optional #72

Open dmitrysenkovich opened 6 years ago

dmitrysenkovich commented 6 years ago

wsdl2java task is now the bottleneck on my build. So I would like to parallelize it. I've tried the following code in my build.gradle:

(configurations.wsdlAndXsdSourcesCompile.files + configurations.wsdlAndXsdSources.files).eachWithIndex { artifact, i ->
    tasks.create(name: "wsdl2java$artifact", type: Wsdl2JavaTask) {
        wsdlDir = file("$buildDir/schema")
        wsdlsToGenerate = [wsdlsAndXjbs[i]]
    }

    tasks.create(name: "copyWsdlFromArtifacts$artifact", type: Copy) {
        from zipTree(artifact)
        into "$buildDir/schema/"
        include '**/*.xsd', '**/*.wsdl'
    }

    tasks.findByName("wsdl2java$artifact").dependsOn(tasks.findByName("copyWsdlFromArtifacts$artifact"))
    compileJava.dependsOn(tasks.findByName("wsdl2java$artifact"))
}

It fails because wsdl2java task attempts to delete output dir in this line.

Could you please make this call optional so that I could parallelize classes generation? Thank you very much!

dmitrysenkovich commented 6 years ago

Sorry, took a look the a wrong line

dmitrysenkovich commented 6 years ago

heh, seems like I was right) build fails as output dir is cleaned before every task