UNPKG

@nx/detox

Version:

The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.

28 lines (27 loc) 989 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.processBuildOptions = processBuildOptions; const devkit_1 = require("@nx/devkit"); function processBuildOptions(_tree, options, projectName, _projectRoot, target, _migrationLogs) { const args = []; if ('detoxConfiguration' in options) { // Need to wrap in --args since --configuration/-c is swallowed by Nx CLI. args.push(`--args="-c ${options.detoxConfiguration}"`); delete options.detoxConfiguration; } for (const key of Object.keys(options)) { let value = options[key]; if (typeof value === 'boolean') { if (value) args.push(`--${(0, devkit_1.names)(key).fileName}`); } else { args.push(`--${(0, devkit_1.names)(key).fileName}`, value); } delete options[key]; } if (target) { target.command = `nx run ${projectName}:build`; } options.args = args; }