Issue #8 new

jvmOptions are not cummulative (1.5.4-SNAPSHOT)

Howard Lewis Ship
created an issue

If I have a parent build that sets jvmOptions for its subprojects, and then a child build does the same, only the child build's options are applied.

This is because (I believe) jvmOptions is a single Closure, and the child build's jvmOptions replaces the parent build's defaults.

I believe jvmOptions should be a method that accepts as Closure and all supplied Closures are applied.

Comments (1)

  1. Meikel Brandmeyer

    I'm not sure about the logic implications. How do you handle conflicts? Is the parent the master, or the child? Or the order of the added closures? What if you want to depart from this default strategy? How do you override a parent setting when you really want to do so?

    You can fix your problem now by building the chain of closures explicitly.

    subprojects {
        someExecTask {
            jvmOptions = {
                setting = "parent"
            }
        }
    }
    
    project(':foobar') {
        def parentOptions = someExecTask.jvmOptions
        someExecTask {
            jvmOptions = {
                project.configure delegate, parentOptions
                setting = "child"
            }
        }
    }
    

    I have to think more about this proposal.

  2. Log in to comment