Build a Feature file

To build the Feature file (.fo) of an Application, the SDK provides the Gradle buildFeature task. The prerequisites to use this task are:

  • The Application EntryPoint must be configured, as described in Configure a Project.

  • A Multi-Sandbox Kernel must be defined. Refer to the Select a Kernel page to learn how to provide a Kernel for a module project.

Once these prerequisites are fulfilled, the Feature file can be built:

By double-clicking on the buildFeature task in the Gradle tasks view:

../_images/intellij-buildFeature-gradle-project.png

Warning

Android Studio does not allow to run multiple Gradle tasks in parallel. If you still want to execute several Gradle tasks simultaneously, you can launch them from a terminal with the Gradle Command Line Interface (CLI).

The Feature file is generated in the build/application/feature folder of the project.

Trigger Feature Build by Default

The Feature of an Application is not built and published by default (when launching a ./gradlew build or a ./gradlew publish for example). This default behavior can be changed by adding the produceFeatureDuringBuild() method in the microej configuration block of the Gradle build file of the project:

microej {
  produceFeatureDuringBuild()
}

Build a Feature file from a WPK

The SDK provides the Gradle buildFeatureFromWPK task which allows to build a Feature file from the WPK of an Application. The prerequisites to use this task are:

  • The WPK must be defined:

    • When the WPK is published in an artifact repository, you can use it by declaring a Module dependency:

      dependencies {
         microejApplication("com.mycompany:myapp:1.0.0")
      }
      
    • When the WPK is built by a subproject of a multi-project, you can use it by declaring a Project dependency in the build.gradle.kts file, with the microejApplication configuration:

      dependencies {
         microejApplication(project(":myApplication"))
      }
      
    • When the WPK is available locally, you can use it by declaring a File dependency in the build.gradle.kts file, with the microejApplication configuration:

      dependencies {
         microejApplication(files("C:\\path\\to\\my\\application.wpk"))
      }
      
  • A Multi-Sandbox Kernel must be defined. Refer to the Select a Kernel page to learn how to provide a Kernel for a module project.

Once these prerequisites are fulfilled, the Feature file can be built:

By double-clicking on the buildFeatureFromWPK task in the Gradle tasks view:

../_images/intellij-buildFeatureFromWPK-gradle-project.png

Warning

Android Studio does not allow to run multiple Gradle tasks in parallel. If you still want to execute several Gradle tasks simultaneously, you can launch them from a terminal with the Gradle Command Line Interface (CLI).

The Feature file is generated in the build/application/wpkFeature folder of the project.