How to pass --no-rebuild to task org.gradle.api.tasks.GradleBuild


(m m) #1

Hi, I am using task of type org.gradle.api.tasks.GradleBuild to initiate a gradle build.

task(name: "build$componentName", type: GradleBuild) {
  buildFile = componentName + "/build.gradle"
 startParameter.setExcludedTaskNames(['test'])
 tasks = ['clean','build','upload']
    }

while executing this task , I want to pass the “–no-rebuild” option as command line argument . I could not find a setter method in the org.gradle.StartParameter class. Can you let me know how can I pass this option?


(Peter Niederwieser) #2

It’s here.


(m m) #3

Thanks Peter .