public final class GradleExecConfiguration extends Object implements ProjectConfiguration
The configuration can be defined by the user using the UI. There are no API calls (yet) to create or manage Configurations.
One can request action invocation in a specific GradleExecConfiguration
. In that
case, ActionMapping
for the action specific for the selected configuration (if defined) will be used. Also, if the GradleExecConfiguration.getCommandLineArgs()
or GradleExecConfiguration.getProjectProperties()
are not empty, their values will be combined with the ActionMapping
settings.
To invoke a Project Action with a specific Configuration, place the Configuration instance in the Action's context Lookup:
GradleExecConfiguration
providedConf = configs.get(1);ActionProvider
ap = project.getLookup().lookup(ActionProvider
.class); ap.invokeAction(ActionProvider
.COMMAND_RUN_SINGLE,Lookups
.fixed(providedConf));
GradleExecConfigurations can be also declared by a Plugin that implements a
GradleActionsProvider
,
or which uses DefaultGradleActionsProvider.forProjectLayer(org.openide.filesystems.FileObject)
.
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE
Token that represents ID of the active configuration.
|
static String |
DEFAULT
Token that represents ID of the default configuration.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static GradleExecConfiguration |
findEffectiveConfiguration(Project prj,
Lookup context)
Attempts to find an effective configuration for the project.
|
String |
getCommandLineArgs() |
String |
getDisplayName() |
String |
getId()
Retursn ID of the configuration.
|
String |
getName() |
Map<String,String> |
getProjectProperties() |
int |
hashCode() |
boolean |
isDefault() |
String |
toString() |
public static final String DEFAULT
public static final String ACTIVE
@NonNull public String getId()
GradleExecConfiguration.getDisplayName()
. The default configuration
uses GradleExecConfiguration.DEFAULT
.public String getName()
public String getCommandLineArgs()
@NonNull public String getDisplayName()
getDisplayName
in interface ProjectConfiguration
public boolean isDefault()
@NonNull public static GradleExecConfiguration findEffectiveConfiguration(@NonNull Project prj, @NullAllowed Lookup context)
ProjectConfigurationProvider.getActiveConfiguration()
, unless it has been overriden by contents of
the `context` Lookup
, or by some caller. Can be used from implementations of AfterBuildActionHook
,
BeforeBuildActionHook
etc.prj
- projectcontext
- optional additional context, can be null
.