Writing Kernel APIs

This section lists different ways to help to write kernel.api files.

Default Kernel APIs Derivation

MicroEJ provides predefined kernel API files for the most common libraries provided by a Kernel. These files are packaged as MicroEJ modules under the com/microej/kernelapi organisation.

The packaged file kernel.api can be extracted from the JAR file and edited in order to keep only desired types, methods and fields.

Build a Kernel API Module

  • Generate the skeleton project: Select File > New > Other… > Easyant > Easyant Project, select and configure the com.is2t.easyant.skeletons#microej-kernelapi;+ skeleton, and press Finish button.
  • Create the kernel.api file into the src folder.
  • Right-click on the project and select Build Module.

Kernel API Generator

MicroEJ Kernel API Generator is a tool that help to generate a kernel.api file based on a Java classpath.

In MicroEJ SDK, create a new MicroEJ Tool launch, Run > Run Configurations > MicroEJ Tool, choose your Platform, select Kernel API Generator for the Settings options, and don’t forget to set the output folder.

../_images/kernelapi_launch.png

Define the classpath to use in the Configuration tab, and Press Run. A kernel.api file is generated in the output folder and it contains all classes, methods and fields found in the given classpath.

Category: Kernel API Generator

../_images/kernelAPIgenerator_img1.png

Group: Classpath

Option(list):

Option Name: kernel.api.generator.classpath

Default value: (empty)

Group: Types Filters

Option(text): Includes Patterns

Option Name: kernel.api.generator.includes.patterns

Default value: **/*.class

Description: Comma separated list of ANT Patterns for types to include.

Option(text): Excludes Patterns

Option Name: kernel.api.generator.excludes.patterns

Default value: (empty)

Description: Comma separated list of ANT Patterns for types to exclude.