Giter Club home page Giter Club logo

Comments (3)

rm3l avatar rm3l commented on July 18, 2024 1

Hi @thc202 ,

Thanks for your feedback.

The DataNucleusEnhancer and SchemaTool use System#exit in case of errors which ends up terminating the Gradle daemon, with JavaExec it is created a different process and the exit calls wouldn't affect the Gradle daemon.

Is there are specific reason why they are being called programmatically instead of as command line?

Happy to provide a pull request if this is acceptable.

No specific reason for this, except that I tried to use the methods already available in datanucleus-core.
I think only the schema tool tasks explicitly call the datanucleus-core SchemaTool main method, which indeed might end up calling System#exit:

On the other hand, I don't think the enhancer tasks have a similar issue. They instantiate a new DataNucleusEnhancer object, which contains methods to perform the operations needed, without calling the main method.

final DataNucleusEnhancer enhancer = new DataNucleusEnhancer(api.name(), null)
.setVerbose(verbose != null && verbose)
.setClassLoader(new URLClassLoader(classloaderUrls, Thread.currentThread().getContextClassLoader()))
.addPersistenceUnit(persistenceUnitName)
.setDetachListener(detachListener != null && detachListener)
.setGenerateConstructor(generateConstructor != null && generateConstructor)
.setGeneratePK(generatePK != null && generatePK)
.setSystemOut(quiet == null || !quiet);
if (targetDirectory != null) {
enhancer.setOutputDirectory(targetDirectory.getAbsolutePath());
}
final int result;
if (this.checkOnly) {
result = enhancer.validate();
getProject().getLogger().info("Enhancement validation succeeded for {} class(es)", result);
} else {
result = enhancer.enhance();
projectLogger.info("Enhanced {} class using DataNucleus Enhancer", result);
}

Anyways, thanks for pointing this out. This definitely makes sense. So if you get a chance to contribute a PR, that would be greatly appreciated.
Thanks.

from datanucleus-gradle-plugin.

rm3l avatar rm3l commented on July 18, 2024 1

While not directly related to this issue, have you considered using lazy configuration and also task configuration avoidance?

Not yet, but any contribution is more than welcome :-)
I've created #331 and #332 to help keep track of these.
Thanks.

from datanucleus-gradle-plugin.

thc202 avatar thc202 commented on July 18, 2024

While not directly related to this issue, have you considered using lazy configuration and also task configuration avoidance?

from datanucleus-gradle-plugin.

Related Issues (15)

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.