UNPKG

@nx/gradle

Version:

The Nx Plugin for Gradle allows Gradle tasks to be run through Nx

22 lines (21 loc) 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; const devkit_1 = require("@nx/devkit"); const has_gradle_plugin_1 = require("../../utils/has-gradle-plugin"); // This function changes !{projectRoot}/test/**/* in nx.json for production to !{projectRoot}/src/test/**/* function update(tree) { if (!(0, has_gradle_plugin_1.hasGradlePlugin)(tree)) { return; } const nxJson = (0, devkit_1.readNxJson)(tree); if (!nxJson) { return; } const production = nxJson.namedInputs?.production; if (production?.includes('!{projectRoot}/test/**/*')) { production[production.indexOf('!{projectRoot}/test/**/*')] = '!{projectRoot}/src/test/**/*'; (0, devkit_1.updateNxJson)(tree, nxJson); } }