I googled a bit around for the answer, but found no satisfying answer. Perhaps I just missed something or made wrong searches...

I use simple Gradle scripts to compile and run simple Scala command line programs. So far, so good. But I use some command line parameters in the Scala code to change its behavior (like -t for trace, -v for verbose, etc.).

Currently, I use JavaExec to run the Scala classes:

testName = hasProperty('t') ? t : 'ABC'

task runt(type: JavaExec) {
  // gradle -Pt=Test runt
description = 'To run the test programs with trace on. Pass the name as -Pt=Test.'
  main = testName
  classpath = sourceSets.main.runtimeClasspath
  args '-t'
}

As you can see, I use the -P parameter to know which class to run.
I also have run, runt and runv tasks to run the class without parameters, or with the t or v parameters. It doesn't scale well...

Am I stuck to pass the parameters using -P too, or is there some smart way to specify them on the command line of Gradle?

(Using Windows for what it is worth, and still Gradle 0.9.2)

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to