IviApplicationConfigurator

Interface to configure the build time configuration of the IVI application.

The default values do not have any side effects as long as enabled is not set to true. Once enabled for a Project, the project will be configured as an IVI application. When enabled, the remaining default values configure a default IVI application. The default values can be extended, modified or overwritten to customize the build time configuration.

enabled should only be set to true in one Gradle project within all projects used by an Android application project. This can be the Android application project itself or an Android library module used by the Android application project. The build will fail if enabled is set to true for multiple projects within all projects used by an Android application project.

Based on the configuration, when enabled is true, per build variant:

  • An IviBuildConfig instance is generated. It contains the configured IVI instances and runtime deployments. The IviBuildConfig instance is used by the TomTom Digital Cockpit platform to register the frontends and services at startup.

  • The Android services classes are generated based on the services configuration and the runtime configuration.

  • An AndroidManifest.xml file is generated to register the above generated Android services.

  • The Gradle dependencies required to build the above are added to the project.

See Configure build variants for more information about configuring build variants.

Example

A <project>/build.gradle.kts file to configure a Gradle project as an IVI application for all build variants:

ivi {
application {
enabled = true
iviInstances {
create(...) {
...
}
}
services {
addHost(...)
}
runtime {
...
}
}
}

It is also possible to combine the above example with a configuration that is selectively applied to one or more build variants:

androidComponents {
onVariants(selector().withBuildType("debug")) { variant ->
variant.ivi {
application {
services {
removeHost(...)
}
}
}
}
}

Properties

Link copied to clipboard
abstract var enabled: Boolean

If true, the IVI application is configured. If false, the IVI application is not configured and all other properties in this class are ignored.

Functions

Link copied to clipboard
abstract fun iviInstances(action: Action<IviInstanceContainer>)

Allows the configuration of IVI instance through the given action as a lambda.

Link copied to clipboard
abstract fun runtime(action: Action<RuntimeConfigurator>)

Allows the runtime to be configured through a lambda.

Link copied to clipboard
abstract fun services(action: Action<IviServiceCollectionConfigurator>)

Allows services to be configured through a lambda.