Config Files
JSON Configurations
App configs are ReNative compliant app configuration folders which follow prescribed structure
Applies for:
renative.json
- standard config (commited to git)renative.private.json
- config containing sensitive values (ignored from git)renative.local.json
- config containing local values (ignored from git)renative.build.json
- final merged config located in./platformBuilds/renative.build.json
(ignored from git)renative.runtime.json
- final merged config available to app runtime located in./platformBuilds/renative.runtime.json
(ignored from git)renative.template.json
- config for renative template projects used to generate new projects (commited to git)renative.plugin.json
- config for renative plugin projects (commited to git)
Structure
DEV_PATH_X
.
└── [PROJECT_NAME]
├── appConfigs
│ └── [APP_ID]
│ ├── renative.json
│ └── renative.local.json
├── platformBuilds
│ └── renative.build.json
├── renative.json
└── renative.local.json
~/.rnv
.
└── [PROJECT_NAME]
├── appConfigs
│ └── [APP_ID]
│ ├── renative.json
│ └── renative.private.json
├── renative.json
└── renative.private.json
Merges
Following is the order of merges of various renative configs (if present) producing final platformAssets/renative.json
config file.
~/.rnv/renative.json
⬇️
~/.rnv/renative.private.json
⬇️
~/.rnv/renative.local.json
⬇️
./renative.json
⬇️
./renative.private.json
⬇️
./renative.local.json
⬇️
~/.rnv/[PROJECT-NAME]/renative.json
⬇️
~/.rnv/[PROJECT-NAME]/renative.private.json
⬇️
~/.rnv/[PROJECT-NAME]/renative.local.json
⬇️
./appConfigs/[APP_ID_BASE]/renative.json
⬇️
./appConfigs/[APP_ID]/renative.json
⬇️
./appConfigs/[APP_ID]/renative.private.json
⬇️
./appConfigs/[APP_ID]/renative.local.json
⬇️
~/.rnv/[PROJECT-NAME]/appConfigs/[APP_ID]/renative.json
⬇️
~/.rnv/[PROJECT-NAME]/appConfigs/[APP_ID]/renative.private.json
⬇️
~/.rnv/[PROJECT-NAME]/appConfigs/[APP_ID]/renative.local.json
./platformBuilds/renative.build.json
./platformAssets/renative.runtime.json
- (subset of renative config available at runtime and packaged with final app)
Config Spec
CONFIG_ROOT
{
"env": {},
"hidden": false,
"disabled": false,
"definitions": {},
"profiles": {},
"isWrapper": true,
"sdks": {
...SDK_PROPS
},
"paths": {
...PATH_PROPS
},
"defaults": {
...DEFAULTS_PROPS
},
"plugins": {
"[PLUGIN_KEY]": {
...PLUGIN_PROPS
}
},
"permissions": {
"[PLATFORM]": {}
},
"common": {
...COMMON_PROPS
...BUILD_SCHEME_PROPS
},
"platforms": {
"[PLATFORM]": {
...COMMON_PROPS
...[PLATFORM]_COMMON_PROPS
...BUILD_SCHEME_PROPS
}
},
"runtime": {}
}
env
TODO
hidden
TODO
disabled
TODO
definitions
TODO
profiles
TODO
isWrapper
TODO
sdks
TODO
paths
TODO
defaults
TODO
plugins
TODO
permissions
TODO
common
TODO
platforms
TODO
runtime
Common Props
PLUGIN_PROPS
{
"version": "",
"no-npm": false,
"enabled": true,
"[PLATFORM]": {
...[PLATFORM]_PLUGIN_PROPS
...[PLATFORM]_COMMON_PROPS
},
"webpack": {
"modulePaths": false,
"moduleAliases": {}
}
}
COMMON_PROPS
{
"id": "",
"title": "",
"description": "",
"author": {
"name": "",
"email": "",
"url": ""
},
"license": "",
"runScheme": "",
"bundleAssets": false,
"entryFile": "",
"scheme": "",
"bundleAssets": true,
"bundleIsDev": true,
"includedPlugins": [],
"excludedPlugins": [],
"includedPermissions": [],
"excludedPermissions": [],
"includedFonts": [],
"excludedFonts": [],
"backgroundColor": "",
"port": 1111
}
BUILD_SCHEME_PROPS
{
"buildSchemes": {
"[BUILD_SCHEME_KEY]": {
"[PLATFORM]": {
...COMMON_PROPS
...[PLATFORM]_COMMON_PROPS
}
}
}
}
PATH_PROPS
{
"appConfigsDir": "",
"appConfigsDirs": "",
"platformTemplatesDir": "",
"entryDir": "",
"platformAssetsDir": "",
"platformBuildsDir": "",
"projectConfigDir": ""
}
SDK_PROPS
{
"ANDROID_SDK": "",
"ANDROID_NDK": "",
"IOS_SDK": "",
"TIZEN_SDK": "",
"WEBOS_SDK": "",
"KAIOS_SDK": ""
}
DEFAULTS_PROPS
{
"template": "",
"supportedPlatforms": ["[PLATFORM]"],
"schemes": {},
"targets": {
"[PLATFORM]": ""
}
}
Platform Specific Props
Following props are only accepted per specific platform
iOS Props
IOS_COMMON_PROPS
{
"appDelegateImports": [],
"appDelegateMethods": {},
"Podfile": {
"sources": []
},
"plist": {},
"xcodeproj": {},
"appDelegateApplicationMethods": {
"didFinishLaunchingWithOptions": [],
"open": [],
"supportedInterfaceOrientationsFor": [],
"didReceiveRemoteNotification": [],
"didFailToRegisterForRemoteNotificationsWithError": [],
"didReceive": [],
"didRegister": [],
"didRegisterForRemoteNotificationsWithDeviceToken": []
}
}
IOS_PLUGIN_PROPS
{
"reactSubSpecs": [],
"appDelegateMethods": {},
"podName": "",
"path": ""
}
IOS_CONFIG_PROPS
{
"teamID": "",
"deploymentTarget": "",
"provisioningStyle": "",
"systemCapabilities": {},
"scheme": "",
"entitlements": {},
"orientationSupport": {
"phone": [],
"tab": []
},
}
Android Props
ANDROID_COMMON_PROPS
{
"gradle.properties": {},
"AndroidManifest": {},
"BuildGradle": {},
"AppBuildGradle": {},
"implementation": "",
}
ANDROID_PLUGIN_PROPS
{
"path": "",
"package": ""
}
ANDROID_CONFIG_PROPS
{
"universalApk": false,
"multipleAPKs": false,
"minSdkVersion": 21,
"signingConfig": "",
"aab": false,
"storeFile": "",
"storePassword": "",
"keyAlias": "",
"keyPassword": ""
}
Web Props
WEB_COMMON_PROPS
{
}
WEB_PLUGIN_PROPS
{
}
WEB_CONFIG_PROPS
{
"environment": "",
"webpackConfig": {
"devServerHost": "",
"customScripts": []
}
}
Tizen Props
TIZEN_COMMON_PROPS
{
}
TIZEN_PLUGIN_PROPS
{
}
TIZEN_CONFIG_PROPS
{
"appName": "",
"package": "",
"certificateProfile": ""
}
Config Values Overrides
There are 3 levels of override entry objects for your props to fine-tune your app config:
.common
//Applies for all platforms + all schemes.platforms.YOUR_PLATFORM
//Applies specific platforms + all schemes.platforms.YOUR_PLATFORM.buildSchemes.YOUR_SCHEME
//Applies for specific platform + specific scheme
Example:
{
"common": {
"MY_PROP": "Value1"
},
"platforms": {
"ios": {
"MY_PROP": "Value2 overrides Value1",
"buildSchemes": {
"debug": {
"MY_PROP": "Value3 overrides Value 2"
}
}
}
}
}
Override Rules for json props:
Strings
=> ReplacedNumbers
=> ReplacedArrays
=> ReplacedObjects
=> Merged by top level (not deep merge)
Will be overridden by: https://github.com/pavjacko/renative/blob/develop/packages/renative-template-hello-world/appConfigs/helloWorld/renative.json#L59
Output config will be decorated with few extra props to help with debugging:
{
"_timestamp": "",
"_mergeSources": []
}
Build Flavours
You can configure different app ID, Title etc. with buildScheme field in you appConfig file.
Example:
"buildSchemes": {
"debug": {
"id": "renative.helloworld.debug",
"runScheme": "Debug",
"bundleAssets": false,
"bundleIsDev": true
},
"release": {
"id": "renative.helloworld.release",
"runScheme": "Release",
"bundleAssets": true,
"bundleIsDev": false
}
}
this will allow you to build 2 separate iOS apps with slightly different configurations:
$ rnv run -p ios -s debug
(-s debug
is DEFAULT option so you don't have to add it every time)
and
$ rnv run -p ios -s release