"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 = 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdC1tYWluLWZpbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL3NjaGVtYXRpY3MvdXRpbHMvcHJvamVjdC1tYWluLWZpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBSUgsMkRBQStEO0FBQy9ELHVEQUEwRDtBQUUxRCxvRkFBb0Y7QUFDcEYsU0FBZ0Isa0JBQWtCLENBQUMsT0FBMEI7SUFDM0QsTUFBTSxZQUFZLEdBQUcseUNBQXVCLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBRS9ELElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxFQUFFO1FBQ3RCLE1BQU0sSUFBSSxnQ0FBbUIsQ0FBQyxxREFBcUQ7WUFDL0UscUJBQXFCLE9BQU8sQ0FBQyxVQUFVLEdBQUcsQ0FBQyxDQUFDO0tBQ2pEO0lBRUQsT0FBTyxZQUFZLENBQUMsSUFBWSxDQUFDO0FBQ25DLENBQUM7QUFURCxnREFTQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdod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