@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
24 lines • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = update;
const xmldoc_1 = require("xmldoc");
const utils_1 = require("@nx-dotnet/utils");
const generate_project_1 = require("../../../generators/utils/generate-project");
async function update(host) {
const projects = await (0, utils_1.getNxDotnetProjects)(host);
for (const [name, project] of projects.entries()) {
const projectFilePath = await (0, utils_1.getProjectFileForNxProject)(project);
const buffer = host.read(projectFilePath);
if (!buffer) {
throw new Error(`Error reading file ${projectFilePath}`);
}
const xml = new xmldoc_1.XmlDocument(buffer.toString());
if (!xml
.childrenNamed('Target')
.some((x) => x.attr['Name'] === 'CheckNxModuleBoundaries')) {
(0, generate_project_1.addPrebuildMsbuildTask)(host, { projectName: name, projectRoot: project.root }, xml);
host.write(projectFilePath, xml.toString());
}
}
}
//# sourceMappingURL=migrate.js.map