I'm trying to port Codename One client builds which are very customized ant scripts to work with gradle. When you run a Codename One app on the simulator you aren't running the apps main class but rather something like:
java -classpath CodenameOneJarList com.codename1.impl.javase.Simulator nameOfTheMainClassForTheApp
To do this in gradle I edited the basic build script as such:
apply plugin: 'java'
apply plugin: 'application'
mainClassName = "com.codename1.impl.javase.Simulator"
// for netbeans
ext.mainClass = 'com.codename1.impl.javase.Simulator'
Then at the bottom I did this:
run {
args 'com.mycompany.myapp.Main'
}
This worked as expected and launched the simulator when pressing run in the IDE (NetBeans). I'm not sure if this is the "right thing" to do though and if it will work in other IDE's.
Then when I tried launching in the debugger the arguments weren't passed since I'm guessing the run
target wasn't invoked?
I tried doing this:
debug {
args 'com.mycompany.myapp.Main'
}
Which obviously failed. I'm not exactly sure where to pass arguments to the debugger?
Is this standardized by gradle?
Am I in the right direction regarding argument passing?
What does the "run" declarative syntax map to? How do I find the other potential declarative block types?
Unfortunately googling for basics like run/debug doesn't result in something useful.