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=developmentwill be set as data with keyenvand valuedevelopmenton'sinvalid reference
DataTree#getRootNode().invalid reference
DataNode#getData() -
"JSTATIC_DATA_ROOT__"SOME_FIELD="the value"will be set as data with keysomeFieldand valuethe valueon'sinvalid 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(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:BuildTaskIf 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:
underWatchInputPathsin interfaceBuildTask
-
underWatchConfigPaths
Description copied from interface:BuildTaskIf 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:
underWatchConfigPathsin interfaceBuildTask
-