Class EnvVariablesLoader
java.lang.Object
com.mohamnag.jstatic.plugins.env_var_loader.EnvVariablesLoader
- All Implemented Interfaces:
BuildTask
Loads data from environment variables into
.
DataTree
's root
invalid reference
DataNode#getData()
"JSTATIC_DATA_ROOT__"{field name} will be added to root node's data. To use multi-word field names, separate words with a "_".
For field names only following chars are allowed: A-Z and 0-9
Following values are handled specially (case sensitive):
- "true" into boolean true
- "false" into boolean false
Example of conversion between environment variables and roo node fields:
-
"JSTATIC_DATA_ROOT__"ENV=development
will be set as data with keyenv
and valuedevelopment
oninvalid reference
DataTree#getRootNode()
invalid reference
DataNode#getData()
-
"JSTATIC_DATA_ROOT__"SOME_FIELD="the value"
will be set as data with keysomeField
and valuethe value
oninvalid reference
DataTree#getRootNode()
invalid reference
DataNode#getData()
This plugin does not support hot reloading in watch mode and in mostly meant to override specific variables in CI and similar environments.
The functionality of this plugin is intentionally kept simple and limited to data injection into root node.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(BuildContext buildContext) If a plugin depends on config files in addition to the general config file of the application, like functionality extensions stored in files, it shall return these paths here.If a plugin depends on file input, it shall return list of its input paths to be watched for changes.
-
Constructor Details
-
EnvVariablesLoader
public EnvVariablesLoader()
-
-
Method Details
-
run
-
underWatchInputPaths
Description copied from interface:BuildTask
If a plugin depends on file input, it shall return list of its input paths to be watched for changes. Paths can be either files or directories. In case of directories, only root path are necessary to be listed and if input path has subdirectories, they will be automatically watched.- Specified by:
underWatchInputPaths
in interfaceBuildTask
-
underWatchConfigPaths
Description copied from interface:BuildTask
If a plugin depends on config files in addition to the general config file of the application, like functionality extensions stored in files, it shall return these paths here. A change detected in these paths will result in recreation of the plugin.- Specified by:
underWatchConfigPaths
in interfaceBuildTask
-