On Thu, 2023-12-28 at 11:48 +0100, Ulrich Mayring wrote:
> Does this select the correct class? The original command-line
> included 
> -PrunClassName=package.MyMainClass as a parameter.

You can also forward the Class to run as a parameter.

> 
> But anyway, I think with some tweaking and twiddling it will be
> possible 
> to write a task that replicates 99% of what the IDE does. But I'm not
> sure whether that is the assignment.

I agree because you are somewhere between a rock and a hard place right
now:

1) you work with Gradle, where the Gradle Build file defines the build
logic (and Netbeans has to follow it)

2) but (respectfully!) you still seem to look at it with "Ant" glasses,
when Netbeans built the logic and the script for you (because no sane
person could be bothered to built ant scripts from scratch)


> The point is to replicate exactly what the IDE does on the command-
> line, 
> so that I can debug it better using other command-line tools.

Then provide your own Gradle Build file (from scratch) and define the
task `singleRun` has entry hook for Netbeans.
You just need to change the direction: you define the build file and
lead the way, Netbeans will follow (instead the other way around).

> then IMHO it should not pretend so by outputting stuff
> that looks like a script.

In my understanding, this is pretty much a legacy from the ANT script
days, when Netbeans was in the lead to define the build logic.
With Gradle indeed this may do more harm than good now.

Good luck and cheers
Andreas



Reply via email to