build: Bazel builds ngfactories for packages/core (#18289)
PR Close #18289
This commit is contained in:
17
packages/compiler-cli/BUILD.bazel
Normal file
17
packages/compiler-cli/BUILD.bazel
Normal file
@ -0,0 +1,17 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "compiler-cli",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"integrationtest/**",
|
||||
"test/**",
|
||||
]),
|
||||
module_name = "@angular/compiler-cli",
|
||||
deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/tsc-wrapped",
|
||||
],
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
)
|
@ -41,8 +41,8 @@ export class CompilerHost implements AotCompilerHost {
|
||||
protected program: ts.Program, protected options: AngularCompilerOptions,
|
||||
protected context: CompilerHostContext, collectorOptions?: CollectorOptions) {
|
||||
// normalize the path so that it never ends with '/'.
|
||||
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
|
||||
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
|
||||
this.basePath = path.normalize(path.join(this.options.basePath !, '.')).replace(/\\/g, '/');
|
||||
this.genDir = path.normalize(path.join(this.options.genDir !, '.')).replace(/\\/g, '/');
|
||||
|
||||
const genPath: string = path.relative(this.basePath, this.genDir);
|
||||
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
|
||||
@ -312,7 +312,7 @@ export class CompilerHost implements AotCompilerHost {
|
||||
relativePath = relativePath.substr(3);
|
||||
}
|
||||
|
||||
return path.join(this.options.genDir, relativePath);
|
||||
return path.join(this.options.genDir !, relativePath);
|
||||
}
|
||||
|
||||
private hasBundleIndex(filePath: string): boolean {
|
||||
|
@ -36,7 +36,7 @@ export class Extractor {
|
||||
return promiseBundle.then(bundle => {
|
||||
const content = this.serialize(bundle, formatName);
|
||||
const dstFile = outFile || `messages.${ext}`;
|
||||
const dstPath = path.join(this.options.genDir, dstFile);
|
||||
const dstPath = path.join(this.options.genDir !, dstFile);
|
||||
this.host.writeFile(dstPath, content, false);
|
||||
return [dstPath];
|
||||
});
|
||||
|
@ -27,8 +27,8 @@ class SingleRootDirModuleFilenameResolver implements ModuleFilenameResolver {
|
||||
|
||||
constructor(private host: ModuleFilenameResolutionHost, private options: CompilerOptions) {
|
||||
// normalize the path so that it never ends with '/'.
|
||||
this.basePath = path.normalize(path.join(options.basePath, '.')).replace(/\\/g, '/');
|
||||
this.genDir = path.normalize(path.join(options.genDir, '.')).replace(/\\/g, '/');
|
||||
this.basePath = path.normalize(path.join(options.basePath !, '.')).replace(/\\/g, '/');
|
||||
this.genDir = path.normalize(path.join(options.genDir !, '.')).replace(/\\/g, '/');
|
||||
|
||||
const genPath: string = path.relative(this.basePath, this.genDir);
|
||||
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
|
||||
@ -153,7 +153,7 @@ class MultipleRootDirModuleFilenameResolver implements ModuleFilenameResolver {
|
||||
|
||||
constructor(private host: ModuleFilenameResolutionHost, private options: CompilerOptions) {
|
||||
// normalize the path so that it never ends with '/'.
|
||||
this.basePath = path.normalize(path.join(options.basePath, '.')).replace(/\\/g, '/');
|
||||
this.basePath = path.normalize(path.join(options.basePath !, '.')).replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
getNgCanonicalFileName(fileName: string): string {
|
||||
|
Reference in New Issue
Block a user