Giter Site home page Giter Site logo

Comments (5)

shalugin avatar shalugin commented on September 2, 2024

Workaround is:

xsd2java{
    generatedXsdDir = file("generated-sources")
}

from wsdl2java.

nilsmagnus avatar nilsmagnus commented on September 2, 2024

Thanks for the. I am not sure how we can avoid this, as it is the "@OutputDirectory" annotation wich creates this in the first place. If I remove the annotation, the task will stop beeing incremental as I see it. Or do you have a solution for this @fowlie ?

Maybe the cleanest solution would be to extract the xsd-task into a separate plugin instead of mixing it into the wsdl2java plugin?

from wsdl2java.

fowlie avatar fowlie commented on September 2, 2024

You don't have to declare the output directory to get incremental build. But I think it's a good practise. Why? If someone is clever enough (new junior developer in the team) changes a generated java class, they might think it's all fine. Because their changes will stay there the whole time, until one day someone changes the input source files and the java classes are regenerated.

If you do a change in a generated file, then the change will be lost on the next build, and then you'd immediately realize that you've just changed a generated file.

To get the build incremental, it's enough with the input annotation. So that every time the source files gets updated, the java classes are regenerated. And when they don't change, Gradle will skip the task. That's the most important thing.

@shalugin any particular reason you don't want the directory to be created even if it's empty? In our team, we have everything generated inside the build directory. That way you can clean everything with the gradle clean command.

from wsdl2java.

fowlie avatar fowlie commented on September 2, 2024

Okey, now I understand your problem. 😄 You are not using xsd2java at all! So the problem is that the tasks have different output paths. One way to easily solve this could be to always put generated code in e.g. build/generated-sources. And then the generatedWsdlDir would be relative to that directory.

from wsdl2java.

shalugin avatar shalugin commented on September 2, 2024

One way to easily solve this could be to always put generated code in e.g. build/generated-sources.

I think, that is the best solution.
Another one is not to execute xsd2java or wsdl2java by default. And execute it only when it called explicitly.

For example:

compileJava.dependsOn xsd2java

from wsdl2java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.