The IVCTool software is organized in a set of sub-projects, which are depending on each other. The dependencies of projects are defined with the gradle build scripts. Gradle is making a difference between consumers and producers. Some of the projects are libraries, which is considered as a producer projects, and others are consuming these libraries in order to creating applications. Two gradle plugin are used to support this concepts for Java code.
The Java Library Plugin is used for modules which are consumed by other. Examples are the IEEE1516e library interface, and the Command library used as wrapper for internal JMS communication.
plugins {
id 'java-library'
}
It is important to know, that all Java classes within a library module will be exposed to consumers. In many cases a library are also consumers of other modules. In these cases the dependencies must be declared carefully wether they are only used internally, or if they are also exposed because they are required inside the API definitions. An example is the Command module, which is using a JSON and Java-Logging-API library, which is also exposed to Command module consumers. These dependencies are declared as:
-
api: dependencies which are transitively exported to consumers, for compile time and runtime.
-
implementation: dependencies which are purely internal and not meant to be exposed to consumers (they are still exposed to consumers at runtime).
The Application Plugin is used for modules executable JMS applications, like the TC.exec, or the LogSink. Applications are only using the implementation dependency declarations.
plugins {
id 'application'
}
with the gradle .\gradlew projects task shows the current project structure:
Root project 'IVCT_Framework' +--- Project ':Command' +--- Project ':docs' +--- Project ':GUI' | +--- Project ':GUI:nato.ivct.gui.client' - IVCT Client | +--- Project ':GUI:nato.ivct.gui.server' - IVCT Server | +--- Project ':GUI:nato.ivct.gui.server.app.dev' - IVCT HTML UI WAR Development | +--- Project ':GUI:nato.ivct.gui.server.app.war' - IVCT Server WAR | +--- Project ':GUI:nato.ivct.gui.shared' - IVCT Shared | +--- Project ':GUI:nato.ivct.gui.ui.html' - IVCT HTML UI | +--- Project ':GUI:nato.ivct.gui.ui.html.app.dev' - IVCT HTML UI Server Development | \--- Project ':GUI:nato.ivct.gui.ui.html.app.war' - IVCT HTML UI WAR +--- Project ':IEEE1516e' +--- Project ':LogSink' +--- Project ':LogSink.webApp' +--- Project ':MessagingHelpers' +--- Project ':RuntimeConfig' +--- Project ':TC.exec' +--- Project ':TC.lib' +--- Project ':TC.webApp' \--- Project ':UI'
The main dependencies between these projects is a follows:
-
[(IEEE1516e → TC.lib), (MessagingHelpers → Command )] → TC.exec → TC.webApp
-
Command → LogSink → LogSink.webApp
-
Command → UI
-
Command → GUI:nato.ivct.gui.server → (GUI:nato.ivct.gui.server.app.dev, GUI:nato.ivct.gui.server.app.war)
-
GUI:nato.ivct.gui.shared → (GUI:nato.ivct.gui.server, GUI:nato.ivct.gui.client)
-
GUI:nato.ivct.gui.client → GUI:nato.ivct.gui.ui.html → (GUI:nato.ivct.gui.ui.html.app.dev, GUI:nato.ivct.gui.ui.html.app.wa)