I am trying to create Codename One client builds that have very custom ant scripts for working with gradle. When you run the Codename One application on a simulator, you are not using the main application class, but something like:
java -classpath CodenameOneJarList com.codename1.impl.javase.Simulator nameOfTheMainClassForTheApp
To do this, in gradle, I edited the base build of the 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 below I did the following:
run { args 'com.mycompany.myapp.Main' }
This worked as expected and ran the simulator when you clicked the run in the IDE (NetBeans). I am not sure if this is correct, and if it will work in other IDEs.
Then, when I tried to run in the debugger, no arguments were passed, since I assume that the run target was not called?
I tried to do this:
debug { args 'com.mycompany.myapp.Main' }
Which is clearly failed. I'm not quite sure where to pass arguments to the debugger?
Is this a standardized gradle?
Am I in the right direction regarding passing an argument?
What is a declarative syntax map "run"? How to find other potential types of declarative blocks?
Unfortunately, searching for keywords such as run / debug does not lead to anything useful.