Well, it seems imported build tasks are handled a bit differently. or the jvi-cmd:run task is not a JavaExec task.
Then I'd just create a run (JavaExec) task in your build configured the same way (classpath, main class etc) as it is in jvi-cmd:run BTW go you have this stuff on GitHub or somewhere public, so I can have a glimpse? Might be able to file a PR for you. On Fri, Sep 23, 2022 at 9:31 AM Ernie Rael <err...@raelity.com> wrote: > On 9/22/22 10:07 PM, Laszlo Kishalmi wrote: > > Well, if I see well, you try to bring the jvi-cmd:run task down to the > > project level by defining a task that depends on that. > > > > The defined run task would be a DefaultTask, so it is not taking the > > --debug-jvm argument. > > > > Here instead of defining a new run task, I'd configure the ide's run > > and debug action to use :jvi-cmd:run or (jvi-cmd:run I'm not sure > > that the first : is needed) instead of run. > > Haven't been able to get debug action to work > > Doing > > ConfiguredAction: debug, Arguments: :jvi:jvi-cmd:run > > And clicking debug runs the command, but no debugger. Change it to > > Arguments: :jvi:jvi-cmd:run --debug-jvm > > But this hangs. With a different project, with unmodified actions, > clicking debug shows > > cd /src/jvi-dev/jvi/jvi-cmd; ../gradlew --configure-on-demand -x > check run --debug-jvm > > Tried > > Arguments: -x check :jvi:jvi-cmd:run --debug-jvm > > which fails with "Task 'check' not found in root project 'jvi-ide'.". > Tried a couple "Hail Mary"s with > > Arguments: -x :jvi:jvi-cmd:check :jvi:jvi-cmd:run --debug-jvm > Arguments: -x :jvi:check :jvi:jvi-cmd:run --debug-jvm > > The first doesn't get an error, but hangs just the same. The second > doesn't find check in jvi. > > I thought about running the debugger from the 'buildInclude' project > directly, but I suspect in a more general case the dependencies would be > wrong. > > -ernie > > > > > On 9/22/22 19:37, Ernie Rael wrote: > >> On 9/22/22 9:15 AM, László Kishalmi wrote: > >>> You may find reading this one useful: > >>> https://docs.gradle.org/current/userguide/composite_builds.html > >>> > >> Thanks, this looks promising. I started, only for one project, with > >> settings.gradle > >> > >> rootProject.name = 'jvi-ide' > >> > >> includeBuild '/src/jvi-dev/jvi' > >> > >> Mixed in some build.gradle > >> > >> def jvi_proj = [ ':jvi-core', ':jvi-swing', ':jvi-cmd' ] > >> > >> void deps(Task t, String proj, List subprojs, String subt) { > >> for(sp in subprojs) { > >> t.dependsOn gradle.includedBuild(proj).task(sp + subt) > >> } > >> } > >> > >> tasks.register('clean') { task -> > >> deps(task, 'jvi', jvi_proj, ':clean') > >> } > >> ... > >> tasks.register('run') { > >> dependsOn gradle.includedBuild('jvi').task(':jvi-cmd:run') > >> } > >> > >> I thought it was weird that I had to enumerate the sub-projects, but > >> some think I'm weird. > >> > >> Opening this project in ide I can build, clean, Use the GREEN button > >> to run the project, but the DEBUG button fails. Suggestions? IDE output: > >> > >> cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run > >> ... > >> > Configure project :jvi:jvi-swing > >> namedservicesMerge-1: project ':jvi:jvi-swing' > >> 'jVi/init/com.raelity.jvi.ViInitialization' > >> Configuration on demand is an incubating feature. > >> > >> > Task :jvi:jvi-core:compileJava UP-TO-DATE > >> ... > >> > >> > Task :jvi:jvi-cmd:run > >> > >> ====================================================================== > >> cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run --debug-jvm > >> ... > >> > Configure project :jvi:jvi-swing > >> namedservicesMerge-1: project ':jvi:jvi-swing' > >> 'jVi/init/com.raelity.jvi.ViInitialization' > >> Configuration on demand is an incubating feature. > >> > >> FAILURE: Build failed with an exception. > >> > >> * What went wrong: > >> Problem configuring task :run from command line. > >> > Unknown command-line option '--debug-jvm'. > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > > For additional commands, e-mail: dev-h...@netbeans.apache.org > > > > For further information about the NetBeans mailing lists, visit: > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > > > > > > >