"use strict"; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getProjectMainFile = void 0; const schematics_1 = require("@angular-devkit/schematics"); const project_targets_1 = require("./project-targets"); /** Looks for the main TypeScript file in the given project and returns its path. */ function getProjectMainFile(project) { const buildOptions = (0, project_targets_1.getProjectTargetOptions)(project, 'build'); if (!buildOptions.main) { throw new schematics_1.SchematicsException(`Could not find the project main file inside of the ` + `workspace config (${project.sourceRoot})`); } return buildOptions.main; } exports.getProjectMainFile = getProjectMainFile; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdC1tYWluLWZpbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL3NjaGVtYXRpY3MvdXRpbHMvcHJvamVjdC1tYWluLWZpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBR0gsMkRBQStEO0FBQy9ELHVEQUEwRDtBQUUxRCxvRkFBb0Y7QUFDcEYsU0FBZ0Isa0JBQWtCLENBQUMsT0FBcUM7SUFDdEUsTUFBTSxZQUFZLEdBQUcsSUFBQSx5Q0FBdUIsRUFBQyxPQUFPLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFFL0QsSUFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLEVBQUU7UUFDdEIsTUFBTSxJQUFJLGdDQUFtQixDQUMzQixxREFBcUQ7WUFDbkQscUJBQXFCLE9BQU8sQ0FBQyxVQUFVLEdBQUcsQ0FDN0MsQ0FBQztLQUNIO0lBRUQsT0FBTyxZQUFZLENBQUMsSUFBWSxDQUFDO0FBQ25DLENBQUM7QUFYRCxnREFXQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqI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