Project API
Official
Overview of Project API module
ProjectAPI The Project API defines abstract projects. These are groupings of files built and manipulated as units. It is used for Ant-based projects but could support other scenarios such as makefiles. Modules can plug in project types which can recognize certain folders as being projects, and define their behaviors. Besides the visible Javadoc, this module permits a project to add implementations oforg.netbeans.spi.queries.FileBuiltQueryImplementation
,
org.netbeans.spi.queries.SharabilityQueryImplementation
and
org.netbeans.spi.queries.FileEncodingQueryImplementation
into the project lookup (rather than global lookup).
The implementations will be consulted only in the case the relevant file
belongs to that project (according to org.netbeans.api.project.FileOwnerQuery
).
This helps avoid the need to consult irrelevant query implementations.
What is New (see all changes)?
-
Dec 2 '24 Added action for running tests in parallel
ActionProvider.COMMAND_TEST_PARALLEL
was introduced in order to allow running tests in parallel.ContainedProjectFilter
was added and it can be used to pass list of projects the project action should apply to.NestedClass
was added in order to support nested classes. -
Aug 10 '22 Added
ProjectActionContext
that can pass action-like environment to project queriesProjectActionContext
can be used to inform various project queries about the intended action or environment for which the value is requested. This contract is optional for query implementors. -
Aug 10 '22 Added
ProjectUtils.get/setActiveConfiguration
convenience methodsClients do not need to interact with Project's Lookup and ProjectConfigurationProvider directly, handling missing provider and mutex; they can use the convenience API method.
-
Mar 5 '21 Added
ActionProvider.COMMAND_PRIME
that initializes the project for IDE use.ActionProvider.COMMAND_PRIME
was introduced, so that projects can declare (and enable/disable as needed) an action that "primes" or initializes the project for the IDE. That often includes downloads, or partial build, which may produce messages, and could be automated by project-opening code. -
Jan 2 '21 Added
ParentProjectProvider
andRootProjectProvider
to improve project hierarchy discoveryParentProjectProvider
andRootProjectProvider
with correspondig utility methods inRootProjectProvider
to improve project hierarchy discovery.
Use Cases
The SPI should be used by modules defining particular project types, e.g. the J2SE project type. The API is to be used primarily by GUI infrastructure and some queries, though other module code may on occasion need to refer to the API.
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 Name | In/Out | Stability | Specified in What Document? |
---|---|---|---|
ProjectAPI | Exported | Official |
The Project API defines abstract projects. These are groupings of files built and
manipulated as units. It is used for Ant-based projects but could support
other scenarios such as makefiles. Modules can plug in project types which can
recognize certain folders as being projects, and define their behaviors.
Besides the visible Javadoc, this module permits a project to add implementations
of org.netbeans.spi.queries.FileBuiltQueryImplementation ,
org.netbeans.spi.queries.SharabilityQueryImplementation and
org.netbeans.spi.queries.FileEncodingQueryImplementation
into the project lookup (rather than global lookup).
The implementations will be consulted only in the case the relevant file
belongs to that project (according to org.netbeans.api.project.FileOwnerQuery ).
This helps avoid the need to consult irrelevant query implementations.
|
Group of systemproperty interfaces
Interface Name | In/Out | Stability | Specified in What Document? |
---|---|---|---|
project.limitScanRoot | Exported | Friend |
If defined, limits search for a parent project to a certain subtree. The property defines the absolute path of a folder where upwards search for a project in parent folders is terminated. Queries outside the root will not find any project. Multiple folders may be specified when delimited with OS-specific path separators (':' on *nix, ';' on Windows). Currently used for tests so the tested runtime does not escape the workdir. |
Implementation Details
What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?
Nothing.Read more about the implementation in the answers to architecture questions.