VEE transitivity
Starting from SDK 6 1.4.0
, it is possible to enable the transitive resolution of a VEE Port or
a Kernel. This allows to use the transitive dependencies of the provided VEE to compile and build the project.
VEE Port transitivity
When a VEE Port is resolved transitively, its transitive dependencies are added to the compile classpath and runtime classpath of the project depending on
the configuration used to define the Libraries in the VEE Port (microejPack
, api
, implementation
):
The Libraries defined with
microejPack
andapi
and their transitive dependencies are added to the compile classpath and runtime classpath of the project.The Libraries defined with
implementation
and their transitive dependencies are added to the runtime classpath of the project.
For example, if your VEE Port provides the following Libraries:
dependencies {
implementation("org.example:lib1:1.0.0")
microejPack("org.example:lib2:1.0.0")
api("org.example:lib3:1.0.0")
}
the lib1
library will be added to the runtime classpath of your project, and the lib2
and lib3
libraries will be added to both the compile classpath and the runtime classpath.
Note
In a VEE Port project, the microejPack
configuration can be used to define an SDK 5 Pack or an SDK 6 Library.
The api
and implementation
configurations are used to define SDK 6 Libraries only.
If the provided VEE Port is used only for testsuites, the Libraries provided by the VEE Port are used to build the runtime classpath of the testsuites, not to compile the project.
Warning
It is important to note that a VEE Port built with SDK 6 1.3.0
minimum is required to use transitivity, the following VEE Ports are not supported:
VEE Ports built with SDK 6
1.2.0
or olderVEE Ports built with SDK 5
It is highly recommended to update your VEE Port to SDK 6 1.3.0
minimum if needed, as the feature will be enabled by default in the next SDK 6 major version.
This limitation does not concern VEE Ports available locally in a directory or
as an archive.
Kernel transitivity
When a Kernel is resolved transitively, its Jar file and its transitive dependencies are added to the compile classpath and runtime classpath of the project depending on the configuration used to define the Libraries in the Kernel:
The Libraries defined with
api
and their transitive dependencies are added to the compile classpath and runtime classpath of the project.The Libraries defined with
implementation
and their transitive dependencies are added to the runtime classpath of the project.
For example, if your project depends on a Kernel which defined the following dependencies:
dependencies {
implementation("org.example:lib1:1.0.0")
api("org.example:lib2:1.0.0")
}
the lib1
library will be added to the runtime classpath of your project, and the lib2
library will be added to both the compile classpath and the runtime classpath.
This behavior is consistent with that of the Gradle Java Library plugin.
However, it is important to note that the APIs of a Library defined with api
in your Kernel will be exposed to Applications.
To ensure that a dependency defined in a Kernel is not exposed to Applications by mistake, it is highly recommended to use implementation
instead of api
(or compileOnly
instead of compileOnlyApi
) when declaring dependencies in your Kernel project.
If the provided Kernel is used only for testsuites, the Libraries provided by the Kernel are used to build the runtime classpath of the testsuites, but they are not used to compile the project.
Warning
It is important to note that a Kernel built with SDK 6 1.3.0
minimum is required to use transitivity, the following Kernels are not supported:
Kernels built with SDK 6
1.2.0
or olderKernels built with SDK 5
It is highly recommended to update your Kernel to SDK 6 1.3.0
minimum if needed, as the feature will be enabled by default in the next SDK 6 major version.
This limitation does not concern Kernels available locally.