Skip to content

Allow running an app with an agent attached through other tasks #261

@jvmusin

Description

@jvmusin

Is your feature request related to a problem? Please describe.
I'm building a plugin that allows to package applications in different formats, such as fatjar, docker, native etc.
In the previous version of the graalvm plugin (0.9.11) I could set agent.enabled.set(true) and then run nativeCompile to run an application and produce configuration files.

In the latest version of the plugin (0.9.12) the only way to attach an agent is to provide an agent property to Gradle. It can't be done programmatically in the configuration phase.

Describe the solution you'd like
Please, allow attaching the agent in the configuration phase so that it's possible for other plugins to use the GraalVM gradle plugin to build those configuration files.

I want to execute tasks in this order:

  1. configureGraalVM(custom task, attaches an agent in configuration phase)
  2. run(with an agent and produce configuration files)
  3. runWithAgent(custom task which is invoked by the end user, does nothing and only calls configureGraalVM and run).

Describe alternatives you've considered
I can try achieving this behavior by replacing run task with a custom invocation of ./gradlew -Pagent run on JavaExec object inside some task, but it'd be so ugly.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions