Skip navigation links
org.netbeans.modules.gradle/2 2.44.0 1

Gradle Projects
Under Development

GradleProjectAPI

See: Description

Gradle Projects 
Package Description
org.netbeans.modules.gradle.api
Domain and access classes for Gradle projects.
org.netbeans.modules.gradle.api.execute
API support for executing Gradle actions/commands in the IDE.
org.netbeans.modules.gradle.api.output  
org.netbeans.modules.gradle.spi  
org.netbeans.modules.gradle.spi.actions  
org.netbeans.modules.gradle.spi.customizer.support  
org.netbeans.modules.gradle.spi.execute
If a project needs direct access to Gradle, there is a ProjectConnection can be retrieved from the project's lookup.
org.netbeans.modules.gradle.spi.newproject  
org.netbeans.modules.gradle.spi.nodes  

What is New (see all changes)?

Use Cases

API/SPI to be used by modules wanting to enhance the Gradle project's integration in the IDE.

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
GradleProjectAPIExportedUnder Development

The Gradle Project API provides some miscellaneous friend APIs and SPIs relating to Gradle projects.

Group of layer interfaces
Interface NameIn/OutStabilitySpecified in What Document?
GradleProjectCustomizerExportedUnder Development

"Projects/org-netbeans-modules-gradle/Customizer" folder's content is used to construct the project's customizer. It's content is expected to be ProjectCustomizer.CompositeCategoryProvider instances. The lookup passed to the panels contains an instance of Project.

GradleLogicalViewProviderExportedUnder Development

"Projects/org-netbeans-modules-gradle/Nodes" folder's content is used to construct the project's child nodes. It's content is expected to be NodeFactory instances.

GradleLookupExportedUnder Development

"Projects/org-netbeans-modules-gradle/Lookup" folder's content is used to construct the project's additional lookup. It's content is expected to be LookupProvider instances. Gradle project provides LookupMergers for Sources, PrivilegedTemplates, RecommendedTemplates and other classes. Implementations added by 3rd parties will be merged into a single instance in the project's lookup.

"Projects/org-netbeans-modules-gradle/Plugins/<plugin-name>/Lookup" folder content is also used to contribute into the project lookup, based on the Gradle plugin ids, like "java-base".

GradleActionsExportedUnder Development

"Projects/org-netbeans-modules-gradle/Actions" folder'' content is used to add item's to the main project node popup. It's content is expected to be Action instances.

Group of branding interfaces
Interface NameIn/OutStabilitySpecified in What Document?
org.netbeans.modules.gradle.api.execute.NetworkProxySettings.allowOverrideExportedUnder Development

Brand the org.netbeans.modules.gradle.api.execute.NetworkProxySettings.allowOverride key in a org.netbeans.modules.gradle.api.execute.Bundle file with one of the values true or false to specify whether to offer override of proxies when running Gradle daemon. With false, the user is only given an option to upgrade gradle's configuration files. Since

org.netbeans.modules.gradle.spi.DEFAULT_REUSE_OUTPUTExportedUnder Development

Brand the DEFAULT_REUSE_OUTPUT key in a org.netbeans.modules.gradle.spi.Bundle file with one of the values true or false to specify the default behavior of reusing output by your application. Use never value, if the reuse shall never be done, regardless of the settings value.

org.netbeans.modules.gradle.api.execute.TrustProjectOptionExportedUnder Development

Brand the org.netbeans.modules.gradle.api.execute.TrustProjectOption.* keys in org.netbeans.modules.gradle.api.execution to enable/disable/reorder options in 'trust project' confirmation dialog. For more details, see RunUtils.isProjectTrusted.

Group of systemproperty interfaces
Interface NameIn/OutStabilitySpecified in What Document?
netbeans.debug.gradle.info.actionExportedUnder Development

Starting NetBeans with netbeans.debug.gradle.info.action=true would make the Gradle project information loading into a debugabble JVM where the debugging port is 5006. A new debugger session can be attached to that port, make the netbeans-gradle-tooling project debuggable in action.

Group of property interfaces
Interface NameIn/OutStabilitySpecified in What Document?
runJvmArgsExportedFriend

NetBeans Tooling plugin recognizes runJvmArgs project property, and injects specified JVM arguments into JavaExec executing the user code. Use -PrunJvmArgs=.... If passing more arguments, the whole -P must be properly quoted. Arguments that contain spaces must also use quoting or escapes.

runWorkingDirExportedFriend

NetBeans Tooling plugin recognizes runWorkingDir project property, and injects specified working directory into JavaExec executing the user code. Use -PrunWorkingDir=.... If the working directory contain spaces, it must also use quoting or escapes.

runEnvironmentExportedFriend

NetBeans Tooling plugin recognizes runEnvironment project property, and injects specified environmental variables into JavaExec executing the user code. Use -PrunEnvironment=.... The value consists of expressions of VAR_NAME=VAR_VALUE, or !VAR_NAME. The VAR_NAME=VAR_VALUE sets environment variable VAR_NAME to value VAR_VALUE and !VAR_NAME removes variable VAR_NAME from the set of environment variables. If passing more arguments, the whole -P must be properly quoted. Variables whose values contain spaces must also use quoting or escapes.

Group of java.io.File interfaces
Interface NameIn/OutStabilitySpecified in What Document?
nb-actions.xmlExportedUnder Development

NetBeans Gradle support recognizes special file(s) that can be placed next to a build.gradle. These files contain description of bindings between NetBeans UI actions (compile, run, debug, etc.) and the actual Gradle goals to execute.

<!DOCTYPE actions SYSTEM "action-mapping.dtd">
<actions>
    <action name="clean">
        <args>clean</args>
    </action>

    <action name="download.javadoc">
        <!--
            We do not really execute any tasks here, rather just reload the project
            allowing it to go online and fetch some dependencies. So in this case
            the action is forcing a project reload with some argiments.
        -->
        <reload rule="ALWAYS_ONLINE">
            <args>-PdownloadJavadoc=${requestedComponent}</args>
        </reload>
    </action>

    <action name="download.sources">
        <reload rule="ALWAYS_ONLINE">
            <args>-PdownloadSources=${requestedComponent}</args>
        </reload>
    </action>

    <action name="download.sourcesanddoc">
        <reload rule="ALWAYS_ONLINE">
            <args>-PdownloadSources=${requestedComponent} -PdownloadJavadoc=${requestedComponent}</args>
        </reload>
    </action>

    <!--
        The following section is used and preferred when the 'virtual plugin' named
        'root' is present in the project plugin list marking that project is a root
        project.
    -->
    <apply-for plugins="root">
        <action name="clean">
            <args>clean</args>
        </action>

        <action name="build">
            <args>assemble</args>
        </action>

        <action name="rebuild">
            <args>clean assemble</args>
        </action>
    </apply-for>

    <!--
        The following section is used and preferred when the plugin named
        'java' is present in the project plugin list.
    -->
    <apply-for plugins="java">
        <action name="test.single">
            <args>--rerun-tasks test --tests ${selectedMethod}</args>
        </action>
        <action name="run.single.method">
            <args>--rerun-tasks test --tests ${selectedMethod}</args>
        </action>
        <action name="debug.single.method">
            <args>--rerun-tasks test --debug-jvm --tests ${selectedMethod}</args>
        </action>
        <action name="debug.test.single">
            <args>--rerun-tasks test --debug-jvm --tests ${selectedMethod}</args>
        </action>

        <action name="javadoc">
            <args>javadoc</args>
        </action>

        <!--
            The debug.fix action is not repeatable. So it cannot be repeated
            in the Output Tab UI.
        -->
        <action name="debug.fix" repeatable="false">
            <args>--offline --no-rebuild ${affectedBuildTasks}</args>
            <reload rule="NEVER"/>
        </action>
    </apply-for>

    <!--
        Custom actions are present under the "Run Gradle' popup on the project
        node. They shall be named with a prefix 'custom-' and an project unique
        number. They can have a displayName which is used to present the action
        in the UI.
    -->
    <action name="custom-1" displayName="Publish Plugin">
        <!-- Using 'input:' token provider will request user input
             when invoking the action. I this case it request a value displayed
             as 'Version', and fills up the default as '0.4.x'. The default
             value part is optional.
        -->
        <args>-Pversion=${input:Version,0.4.x}
clean
publishPlugins</args>


</actions>
             

nb-actions-config.xmlExportedUnder Development

An extension of nb-actions.config is a per-Configuration action mapping. It can be placed in nb-actions-configurationID.xml with the same format and will apply only if that specific Project Configuration is in effect.

Group of lookup interfaces
Interface NameIn/OutStabilitySpecified in What Document?
waitFinishedExportedPrivate

When calling ActionProvider.invokeAction(name, lookup) an instance of AfterBuildActionHook can be placed into lookup. It is then notified when the execution of the action is finished. Useful when writing tests.

project-actionsExportedPrivate

The GradleActionProviders can be also activated for individual Plugins; register them for project type org-netbeans-modules-gradle/Plugins/<plugin-id>.

Implementation Details

Where are the sources for the module?

The sources for the module are in the Apache Git repositories or in the GitHub repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

XXX no answer for deploy-dependencies

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.netbeans.modules.gradle/2 2.44.0 1