UNPKG

2.55 kBTypeScriptView Raw
1import { RosettaTabletReader } from 'jsii-rosetta';
2import { JsiiModule } from './packaging';
3import { TargetConstructor } from './target';
4import { TargetName } from './targets';
5import { Toposorted } from './toposort';
6export interface BuildOptions {
7 /**
8 * Whether to fingerprint the produced artifacts.
9 * @default true
10 */
11 readonly fingerprint?: boolean;
12 /**
13 * Whether artifacts should be re-build even if their fingerprints look up-to-date.
14 * @default false
15 */
16 readonly force?: boolean;
17 /**
18 * Arguments provided by the user (how they are used is target-dependent)
19 */
20 readonly arguments: {
21 readonly [name: string]: any;
22 };
23 /**
24 * Only generate code, don't build
25 */
26 readonly codeOnly?: boolean;
27 /**
28 * Whether or not to clean
29 */
30 readonly clean?: boolean;
31 /**
32 * Whether to add an additional subdirectory for the target language
33 */
34 readonly languageSubdirectory?: boolean;
35 /**
36 * The Rosetta instance to load examples from
37 */
38 readonly rosetta: RosettaTabletReader;
39 /**
40 * Whether to generate runtime type checking code in places where compile-time
41 * type checking is not possible.
42 */
43 readonly runtimeTypeChecking: boolean;
44}
45/**
46 * Interface for classes that can build language targets
47 *
48 * Building can happen one target at a time, or multiple targets at a time.
49 */
50export interface TargetBuilder {
51 buildModules(): Promise<void>;
52}
53/**
54 * Base implementation, building the package targets for the given language independently of each other
55 *
56 * Some languages can gain substantial speedup in preparing an "uber project" for all packages
57 * and compiling them all in one go (Those will be implementing a custom Builder).
58 *
59 * For languages where it doesn't matter--or where we haven't figured out how to
60 * do that yet--this class can serve as a base class: it will build each package
61 * independently, taking care to build them in the right order.
62 */
63export declare class IndependentPackageBuilder implements TargetBuilder {
64 private readonly targetName;
65 private readonly targetConstructor;
66 private readonly modules;
67 private readonly options;
68 constructor(targetName: TargetName, targetConstructor: TargetConstructor, modules: Toposorted<JsiiModule>, options: BuildOptions);
69 buildModules(): Promise<void>;
70 private generateModuleCode;
71 private buildModule;
72 private makeTarget;
73 private finalOutputDir;
74}
75//# sourceMappingURL=builder.d.ts.map
\No newline at end of file