i am creating my own plugin when i try to create a task type Exec. Its not running any command. i am getting command line error stating command is not correct. I have displayed the generated command in Exec command to command prompt and when i run it works. The code is not wroking inside gradle plugin scope.
task myrun (type: Exec) {
def cp = project.files(
project.sourceSets.main.output.classesDir,
project.sourceSets.main.resources,
project.configurations.runtime
).getAsPath()
String myCommand = "visage -cp ${cp} visage.javafx.scene.effect.EffectTest"
println "RUN COMMAND : ${myCommand}"
workingDir project.sourceSets.main.output.classesDir
// classpath project.files([project.sourceSets.main.output.classesDir,project.sourceSets.main.resources, project.configurations.runtime,])
commandLine = [myCommand]
}
Can anyone tell me is there any error in the code?
Here is the answer to the same post of yours in the Gradle forum:
commandLine is a list, and every argument becomes a separate element of that list:
commandLine "visage", "-cp", cp, "visage.javafx.scene.effect.EffectTest"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With