Dependencies Configurations
This chapter describes all the dependency configurations added to your project by the MicroEJ Gradle plugins.
Note
The MicroEJ Gradle plugins extend the Gradle Java and Java Library plugins. For more information about the configurations inherited from those plugins, refer to the official documentation :
The following graph describes the dependency configurations. Use this legend to interpret the colors:
Green background : Dependencies can be declared against this configuration
Gray background : This configuration is for consumption by tasks only
Blue background : A task
![digraph mygraph {
rankdir="BT";
bgcolor="transparent"
fontname="Helvetica,Arial,sans-serif"
node [
shape = box
width = 1.5
color = "#7dc5dc"
style = filled
fontname="Helvetica,Arial,sans-serif"
]
edge [fontname="Helvetica,Arial,sans-serif"]
"microejVee" [fillcolor = "#41f753"]
"microejApplication" [fillcolor = "#41f753"]
"microejTool" [fillcolor = "#41f753"]
"microejRuntimeEnvironment" [fillcolor = "#41f753"]
"microejApplicationClasspath" [fillcolor = "#b0d6d3"]
"microejVeeClasspath" [fillcolor = "#b0d6d3"]
"microejKernelExecutableClasspath" [fillcolor = "#b0d6d3"]
"virtualDeviceToolClasspath" [fillcolor = "#b0d6d3"]
"microejRuntimeEnvironmentCompileClasspath" [fillcolor = "#b0d6d3"]
"microejRuntimeEnvironmentRuntimeClasspath" [fillcolor = "#b0d6d3"]
"loadVee" -> "microejVeeClasspath" [ label="uses" ]
"microejVeeClasspath" -> "microejVee"
"loadKernelExecutable" -> "microejKernelExecutableClasspath" [ label="uses" ]
"microejKernelExecutableClasspath" -> "microejVee"
"buildVirtualDevice" -> "microejApplicationClasspath" [ label="uses" ]
"buildVirtualDevice" -> "virtualDeviceToolClasspath" [ label="uses" ]
"microejApplicationClasspath" -> "microejApplication"
"virtualDeviceToolClasspath" -> "microejTool"
"microejRuntimeEnvironmentCompileClasspath" -> "microejRuntimeEnvironment"
"microejRuntimeEnvironmentRuntimeClasspath" -> "microejRuntimeEnvironment"
"compileJava" -> "microejRuntimeEnvironmentCompileClasspath" [ label="uses" ]
"compileTestJava" -> "microejRuntimeEnvironmentCompileClasspath" [ label="uses" ]
"javadoc" -> "microejRuntimeEnvironmentCompileClasspath" [ label="uses" ]
"buildVirtualDevice" -> "microejRuntimeEnvironmentRuntimeClasspath" [ label="uses" ]
"buildApplicationObjectFile" -> "microejRuntimeEnvironmentRuntimeClasspath" [ label="uses" ]
"buildExecutable" -> "microejRuntimeEnvironmentRuntimeClasspath" [ label="uses" ]
}](../../_images/graphviz-1bdf175fc7c49e136a059947dc8be1ddbef2c810.png)
The MicroEJ Gradle plugins also define dependency configurations for internal use:
antScriptLauncherClasspath
, used by the buildVirtualDevice task
addonProcessorClasspath
, used by the adp task
jdtCompilerClasspath
, used by the Add-On Library and Application plugins
wrapperClasspath
, used by thecompileJava
task
microejRuntimeEnvironmentFullRuntimeClasspath
, used by the buildVirtualDevice, buildApplicationObjectFile and buildExecutable tasks
microejVeeFullClasspath
, used by the loadVee task
Publication Variants
The Application plugin defines a list of variants that are used during the publication of an Application.
microejWPK
This variant is used to publish the WPK of an Application,
that can be fetched by declaring a dependency with the microejApplication
configuration.
The LibraryElement
attribute of the variant is set to microej-wpk
.
microejExecutable
This variant is used to publish the Executable of an Application,
that can be fetched by declaring a dependency with the microejVee
configuration.
The LibraryElement
attribute of the variant is set to microej-executable
.
microejExecutableBuildFiles
This variant is used to publish the files generated when building the Executable of an Application.
The LibraryElement
attribute of the variant is set to microej-build-files
.
microejVirtualDevice
This variant is used to publish the Virtual Device of an Application,
that can be fetched by declaring a dependency with the microejVee
configuration.
The LibraryElement
attribute of the variant is set to microej-vee-port
.
microejMockRip
This variant is used when publishing a Mock to allow the fetch of its RIP by declaring a dependency with the microejMock
configuration.
The variant is configured with the custom attribute com.microej.veeport.artifact.usage
attribute set to default
.
runtimeEnvironment
This variant is used to publish a Runtime Environment,
that can be fetched by declaring a dependency with the microejRuntimeEnvironment
configuration.
The LibraryElement
attribute of the variant is set to microej-runtime-environment
.
runtimeAndMockElements
This variant is used when publishing a Library to allow the fetch of the Library and its dependencies from a VEE Port project.
The library can be fetched by declaring a dependency with the implementation
or api
configuration.
The variant is configured with the custom com.microej.veeport.artifact.usage
attribute set to default
.
Attributes of a Variant
An attribute allows Gradle to select the right variant depending on the consumer’s requirements. They are two types of attributes: standard attributes and custom attributes.
Standard Attributes
The standard attributes are defined by Gradle. Such an attribute is mandatory so the resolution of a dependency will fail if
the producer did not define a variant with the attribute set to the same value.
For example, if a VEE Port is defined using the implementation
configuration, the build fails because the consumer wants a Jar but
the VEE Port defines the LibraryElement
attribute to microej-vee-port
:
> Could not resolve all files for configuration ':runtimeClasspath'.
> Could not resolve com.mycompany:myVeePort:1.0.0.
Required by:
root project :
> No matching variant of com.mycompany:myVeePort:1.0.0 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'microejVeePort' declares a library for use during runtime, compatible with Java 7, and its dependencies bundled (fat jar):
- Incompatible because this component declares a component, with the library elements 'microej-vee-port' and the consumer needed a component, packaged as a jar
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
If no variant matches the consumer’s requirements, Gradle can select a compatible variant. To make a variant compatible, the consumer must define a compatibility rule.
For example, this is the case for the Mocks built with SDK 6 1.1.0
or below that are published with the LibraryElement
attribute set to microej-rip
.
To build a VEE Port from an Application, a compatibility rule is required to ensure that the fetch of the VEE Port and its dependencies other than Mocks does not fail.
Custom Attributes
The custom attributes are defined by the user. These attributes are optional, so when resolving a dependency Gradle selects the default variant of the dependency if there is no matching variant.
For example, this is the case for the Mocks built with SDK 6 1.2.0
or higher that are published with the custom com.microej.veeport.artifact.usage
attribute. This attribute is optional,
so when building a VEE Port from an Application, the VEE Port and all its dependencies other than Mocks are correctly fetched without having to define a compatiblity rule.
Warning
A compatiblity rule is still defined to ensure that Mocks built with SDK 6 1.1.0
and below can be fetched by projects built with SDK 6 1.2.0
or higher,
but it will removed in the next major version, so it is highly recommended to update your Mock to use latest SDK 6 plugins.
For more information about variants and attributes, refer to the official documentation.
Dependencies Configurations in a VEE Port Project
This section describes all the dependency configurations added to your VEE Port project by the MicroEJ Gradle plugins.
The following graph describes the dependency configurations. Use this legend to interpret the colors:
Green background : Dependencies can be declared against this configuration
Gray background : This configuration is for consumption by tasks only
Blue background : A task
![digraph mygraph {
rankdir="BT";
bgcolor="transparent"
fontname="Helvetica,Arial,sans-serif"
node [
shape = box
width = 1.5
color = "#7dc5dc"
style = filled
fontname="Helvetica,Arial,sans-serif"
]
edge [fontname="Helvetica,Arial,sans-serif"]
"microejArchitecture" [fillcolor = "#41f753"]
"microejPack" [fillcolor = "#41f753"]
"microejMock" [fillcolor = "#41f753"]
"microejFrontPanel" [fillcolor = "#41f753"]
"microejTool" [fillcolor = "#41f753"]
"microejArchitectureClasspath" [fillcolor = "#b0d6d3"]
"microejPackClasspath" [fillcolor = "#b0d6d3"]
"microejMockClasspath" [fillcolor = "#b0d6d3"]
"microejFrontPanelClasspath" [fillcolor = "#b0d6d3"]
"microejToolClasspath" [fillcolor = "#b0d6d3"]
"microejArchitectureClasspath" -> "microejArchitecture"
"microejPackClasspath" -> "microejPack"
"microejMockClasspath" -> "microejMock"
"microejFrontPanelClasspath" -> "microejFrontPanel"
"microejToolClasspath" -> "microejTool"
"buildVeePort" -> "microejArchitectureClasspath" [ label="uses" ]
"buildVeePort" -> "microejPackClasspath" [ label="uses" ]
"buildVeePort" -> "microejMockClasspath" [ label="uses" ]
"buildVeePort" -> "microejFrontPanelClasspath" [ label="uses" ]
"buildVeePort" -> "microejToolClasspath" [ label="uses" ]
"buildVeePortConfiguration" -> "microejArchitectureClasspath" [ label="uses" ]
"buildVeePortConfiguration" -> "microejPackClasspath" [ label="uses" ]
"buildVeePortConfiguration" -> "microejMockClasspath" [ label="uses" ]
"buildVeePortConfiguration" -> "microejFrontPanelClasspath" [ label="uses" ]
"buildVeePortConfiguration" -> "microejToolClasspath" [ label="uses" ]
}](../../_images/graphviz-376e2aa7c56eab01410f927c0ad3948375d01a15.png)
The VEE Port plugin also defines the variant microejVeePort
that is used to publish the VEE Port configuration.