@nx-dotnet/core
Version:
- Have an existing nx workspace. For creating this, see [nrwl's documentation](https://nx.dev/latest/angular/getting-started/nx-setup). - .NET SDK is installed, and `dotnet` is available on the path. For help on this, see [Microsoft's documentation](https
31 lines • 1.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = runExecutor;
const devkit_1 = require("@nx/devkit");
const path_1 = require("path");
const dotnet_1 = require("@nx-dotnet/dotnet");
const utils_1 = require("@nx-dotnet/utils");
let projectDirectory;
async function runExecutor(options, context, dotnetClient = new dotnet_1.DotNetClient((0, dotnet_1.dotnetFactory)())) {
const nxProjectConfiguration = (0, utils_1.getExecutedProjectConfiguration)(context);
projectDirectory = (0, path_1.resolve)(devkit_1.workspaceRoot, nxProjectConfiguration.root);
const projectFilePath = await (0, utils_1.getProjectFileForNxProject)(nxProjectConfiguration);
dotnetClient.cwd = projectDirectory;
const { watch, extraParameters, ...parsedOptions } = options;
try {
const result = dotnetClient.test((0, path_1.resolve)(devkit_1.workspaceRoot, projectFilePath), watch, parsedOptions, extraParameters);
if (watch && (0, utils_1.isChildProcess)(result)) {
await (0, utils_1.handleChildProcessPassthrough)(result);
await (0, utils_1.rimraf)(projectDirectory + '/bin');
await (0, utils_1.rimraf)(projectDirectory + '/obj');
}
return {
success: true,
};
}
catch (e) {
devkit_1.logger.error(e);
return { success: false };
}
}
//# sourceMappingURL=executor.js.map