public interface GradleActionsProvider
GradleExecConfiguration
s that
will appear in project's UI and can alter action command line. Individual actions can be also customized for
the provided Configurations. See GradleActionsProvider.getSupportedActions()
for details.
Actions (and configurations) are collected in Lookup order. In the case an action is defined by multiple Providers,
the action that takes precedence will be determined by priority
attribute and number of matching Plugins.
From version 2.13 Project Lookup read and
processed before Lookup.getDefault(). You may register the providers using ProjectServiceProvider
for
either base Gradle project's Lookup (for project type org-netbeans-modules-gradle
, or for a specific Plugin
that must be present in the project in order for the GradleActionsProvider
to activate. In that case, use
ProjectServiceProvider.projectType()
= "org-netbeans-modules-gradle/Plugins/<plugin-id>"
.
From version 2.14 the InputStream
returned by GradleActionsProvider.defaultActionMapConfig()
can disable an action.
Overridance rules (priority, strength, ...) apply as usual.
debug.single
action in a specific configuration the user may activate:
<actions> <profiles> <profile id="provided-config" displayName="Example Provided Config"> <actions> <action name="debug.single"> <!-- Note the missing (empty) arg line for the gradle --> <reload rule="NEVER"/> </action> </actions> </profile> </profiles>
Modifier and Type | Method and Description |
---|---|
InputStream |
defaultActionMapConfig()
Provides a declarative action description.
|
Set<String> |
getSupportedActions()
Returns the set of supported actions.
|
boolean |
isActionEnabled(String action,
Project project,
Lookup context)
Determines if an action should be enabled.
|
boolean isActionEnabled(String action, Project project, Lookup context)
true
for actions it does not support.action
- action nameproject
- the target projectcontext
- context that would be used for action invocation.Set<String> getSupportedActions()
GradleExecConfiguration
only,
it should still report them here.InputStream defaultActionMapConfig()
InputStream
must contain XML content conforming to
action-mapping.dtd
.
<!DOCTYPE actions SYSTEM "action-mapping.dtd"> <actions> <action name="clean"> <args>clean</args> </action> <action name="build"> <args>build</args> </action> <action name="rebuild"> <args>clean build</args> </action> <action name="test"> <args>--rerun-tasks test</args> </action> </actions>
Starting from version 2.13 the InputStream can contain entries for GradleExecConfiguration
s.
<actions> <profiles> <profile id="provided-config" displayName="Example Provided Config"> <property name="propA">value1</property> <args>--info</args> <actions> <apply-for plugins="java"> <action name="run.single"> <args>-PrunClassName=${selectedClass} runSingle --continuous ${javaExec.jvmArgs} ${javaExec.args} </args> </action> </apply-for> <apply-for plugins="application"> <action name="run"> <args>run --continuous ${javaExec.jvmArgs} ${javaExec.args} </args> </action> </apply-for> <action name="debug.single"> <reload rule="NEVER"/> </action> </actions> </profile> </profiles>