How To Define a Custom EULA
This page is intended for SDK vendors who ship their own tooling on top of MicroEJ SDK and want to replace the standard SDK EULA check with a custom End User License Agreement.
When the MicroEJ Gradle plugin detects a com.microej.gradle:custom-eula module in the repositories
configured by the user’s project, it automatically replaces the SDK EULA check with the custom EULA check
defined inside that module. If the module is not found in any configured repository, the standard SDK EULA
check applies as a fallback.
Follow these steps to publish this custom EULA module:
Create a Library project.
In the
build.gradle.ktsfile, keep only this content:plugins { id("com.microej.gradle.library") version "1.7.0" } group = "com.microej.gradle" // The group must be set to this value version = "1.0.0" // Set the version you want, it does not matter
Remove the
src/main/javaandsrc/testfolders.Create a
custom-eula.propertiesfile in thesrc/main/resourcesfolder, with the following content:custom-eula.system-property-name=<property-name> custom-eula.env-var-name=<ENV_VAR_NAME> custom-eula.message=<Error message displayed to the user when the EULA has not been accepted.>
custom-eula.system-property-name: the name of the Gradle system property that users must set toYESto accept the EULA.custom-eula.env-var-name: the name of the environment variable that users must set toYESto accept the EULA.custom-eula.message: the error message displayed to the user when the build fails because the EULA has not been accepted.
For example:
custom-eula.system-property-name=accept-mycompany-sdk-eula-v1 custom-eula.env-var-name=ACCEPT_MYCOMPANY_SDK_EULA_V1 custom-eula.message=The MyCompany SDK End-User License Agreement must be accepted.\nSet systemProp.accept-mycompany-sdk-eula-v1=YES in gradle.properties or the ACCEPT_MYCOMPANY_SDK_EULA_V1=YES environment variable.
Publish the module by executing the
publishtask.
When the SDK detects the com.microej.gradle:custom-eula module in any configured repository,
it performs the custom EULA check instead of the SDK EULA check.
