FrontendExtension

Interface of all frontend extensions.

Frontend extensions are independent pieces of functionality or information that can extend the functionality that a Frontend implementation offers. For such extension, a frontend is required to define a class that implements this interface.

The instances of the frontend specific extension classes can be added to a Frontend through the corresponding com.tomtom.ivi.platform.gradle.api.common.iviapplication.config.FrontendConfig instance of the frontend at build time. For example:

import com.tomtom.ivi.platform.gradle.api.common.iviapplication.config.IviInstanceIdentifier
import com.tomtom.ivi.platform.gradle.api.common.iviapplication.config.FrontendExtensionConfig
import com.tomtom.ivi.platform.gradle.api.defaults.config.debugFrontend
import com.tomtom.ivi.gradle.api.plugin.platform.ivi

plugins {
id("com.tomtom.ivi.product.defaults.core")
}

val accountDebugTabFrontendExtension = FrontendExtensionConfig(
frontendExtensionName = "accountDebugTabFrontendExtension",
...
)

ivi {
application {
enabled = true
iviInstances {
create(IviInstanceIdentifier.default) {
applyGroups {
includeDefaultPlatformGroups()
includeDefaultAppsuiteGroups()
}
frontends {
configureIfPresent(debugFrontend) {
addExtension(accountDebugTabFrontendExtension)
}
}
}
}
}
}
...

The above example build.gradle.kts file adds the accountDebugTabFrontendExtension to the debugFrontend.

At runtime, frontend-extension instances can be obtained by the FrontendBuilder implementations through FrontendBuilder.getFrontendExtensionsByType.