Magic Variables

Magic environment variables provide you with some fine-tuned control over your projects settings.

To define a magic variable:

  1. Navigate to the Environment page in your project settings.
  2. In the Environment variables section, type the variable name and value.
Adding a variable

Adding a variable

  1. Select Hidden if you wish to hide the value of the variable in Nevercode user interface.
  2. Click Add variable to save your magic variable.

To edit the variable name or value,

  1. Click the field of the value and enter a new one.
  2. Press Enter to save or click the Save icon on the right.
Editing variables

Editing variables

To delete a variable, click the Delete icon on the right.

For a list of environment variables we export see our environment variables and files page.

Below is a list of magic variables categorized by platform to which they apply.

Generic variables

Environment variable
Meaning

NC_CLONE_UNSHALLOW

Performs a full clone of the repository instead of top 50 commits.

NC_INFER_FLAGS

Additional flags for infer - static code analysis tool.

NC_JAVA_VERSION

Default value is 1.8. One of 1.7, 1.8, or 9.

NC_PLATFORM

Specify project’s platform before initial scan. It can be one of android, ios, cordova, ionic, react_native. Example: your repository has both Android and iOS projects and you want to pick up Android. You can achieve that by setting this variable to android.

NC_REQUIRE_ANDROID_EMULATOR

If set to any value, Android emulator is retained even if it is not required for tests.

NC_TEST_ONLY

If set to any value, build step will be skipped.

Android specific variables

Environment variable
Meaning

NC_ANDROID_INSTRUMENTATION_TEST_TARGET

Name of instrumentation test target

NC_ANDROID_MAIN_ARTEFACT

Path to the Android apk which is used for running the instrumentation. It can be uploaded as an environment file.

NC_ANDROID_NDK_REVISION

NDK version number

NC_ANDROID_UNIT_TEST_TARGET

Name of Unit test target

NC_ANDROID_USE_ORCHESTRATOR

If set to any value, Android instrumentation test run in Firebase will be executed with --use-orchestrator flag.

NC_GRADLE_LOG_LEVEL

One of debug, info or stacktrace. Will add --debug, --info or --stacktrace flag to Gradle commands.

NC_MAIN_EXPANSION_FILE_PATH

Specify main APK expansion file path for Google Play publishing.

NC_PATCH_EXPANSION_FILE_PATH

Specify patch APK expansion file path for Google Play publishing.

iOS specific variables

Environment variable
Meaning

NC_IOS_ARCHIVE_DONT_UPLOAD_BITCODE

Does not include the bitcode in the archive (only applies to native iOS applications).

NC_IOS_ARCHIVE_DONT_UPLOAD_SYMBOLS

Does not include the debug symbols in the archive (only applies to native iOS applications).

NC_IOS_ARCHIVE_METHOD

export method to be used in exportOptionsPlist for Xcode archive step. It can be one of app-store, ad-hoc, enterprise or development. The default value will be deduced from provisioning profiles that are used to perform code signing.

NC_IOS_CONFIG

iOS Build Configuration name. It defaults to Build Configuration of selected scheme Archive action.

NC_IOS_INCLUDE_SYMROOT

If set to any value, adds contents of iOS symroot folder to build artefacts zip bundle.

NC_IOS_USE_ARCHIVE

Example value: true
If set, Nevercode uses the archive action to build and package the application.

NC_ITC_PROVIDER

iTunes Connect provider name.

NC_SKIP_COCOAPODS

Example value: true. If any value is present, downloading and installing Cocoapods is skipped.

NC_XCODEBUILD_ARCH

xcodebuild architecture to compile for when code signing is not set up. Defaults to x86_64.

NC_XCODEBUILD_SDK

xcodebuild SDK name to compile for when code signing is not set up. Defaults to iphonesimulator.

Cordova and Ionic specific variables

Environment variable
Meaning

NC_CORDOVA_CLI_VERSION

Define the Cordova CLI version to be used for building your app.

NC_CORDOVA_ANDROID_PLATFORM_VERSION

Define the cordova-android plugin version to be used for adding Android platform with (ionic) cordova platform add android@<version>.

NC_CORDOVA_IOS_PLATFORM_VERSION

Define the cordova-ios plugin version to be used for adding iOS platform with (ionic) cordova platform add ios@<version>.

NC_CORDOVA_IGNORE_BUILD_JSON

If set to any value, code signing info from build.json for Cordova/Ionic apps will be ignored.

NC_CORDOVA_PRODUCTION_BUILD

If set to any value, the application for production will be built. The variable may be helpful for a debug build because Nevercode always uses --prod option for a release build.

NC_DONT_REMOVE_CORDOVA_PLATFORMS

If set to any value Nevercode will skip platfrom rm <platform> and platfrom add <platform> steps for Cordova and Ionic projects

NC_IONIC_CLI_VERSION

Define the Ionic CLI version to be used for building your app. Semver syntax is supported.

NC_NODE_VERSION

Default value is 8.
Node version to be used. Semver syntax is supported.

NC_NPM_VERSION

Default value is latest. npm version to be used. Semver syntax is supported.

NC_SKIP_NPM_INSTALL

If any value is present, automatic execution of npm install will be skipped.

NC_SKIP_YARN_INSTALL

If any value is present, automatic execution of yarn install will be skipped.

React Native specific variables

Environment variable
Meaning

NC_NODE_VERSION

Default value is 8.
Node version to be used. Semver syntax is supported.

NC_NPM_VERSION

Default value is latest. npm version to be used. Semver syntax is supported.

NC_REACT_NATIVE_ANDROID_TARGET

Custom Gradle target for your React Native Android build. It defaults to assembleDebug or assembleRelease based on the configuration value chosen from UI.

NC_REACT_NATIVE_SCHEME

iOS Scheme for your React Native iOS build. It defaults to the scheme that was automatically created by React Native command line tools.

NC_SKIP_NPM_DEPENDENCIES

If any value is present, automatic execution of npm install or yarn install will be skipped.

NC_SKIP_NPM_INSTALL

If any value is present, automatic execution of npm install will be skipped.

NC_SKIP_YARN_INSTALL

If any value is present, automatic execution of yarn install will be skipped.

Magic Variables