-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
39 lines (35 loc) · 1.17 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {
IndependentPackageBuilder,
TargetBuilder,
BuildOptions,
} from '../builder';
import { JsiiModule } from '../packaging';
import { Toposorted } from '../toposort';
import { flatten } from '../util';
import { DotnetBuilder } from './dotnet';
import { Golang } from './go';
import { JavaBuilder } from './java';
import JavaScript from './js';
import Python from './python';
export enum TargetName {
DOTNET = 'dotnet',
GO = 'go',
JAVA = 'java',
JAVASCRIPT = 'js',
PYTHON = 'python',
}
export type BuilderFactory = (
modules: Toposorted<JsiiModule>,
options: BuildOptions,
) => TargetBuilder;
export const ALL_BUILDERS: { [key in TargetName]: BuilderFactory } = {
dotnet: (ms, o) => new DotnetBuilder(flatten(ms), o),
go: (ms, o) => new IndependentPackageBuilder(TargetName.GO, Golang, ms, o),
java: (ms, o) => new JavaBuilder(flatten(ms), o),
js: (ms, o) =>
new IndependentPackageBuilder(TargetName.JAVASCRIPT, JavaScript, ms, o),
python: (ms, o) =>
new IndependentPackageBuilder(TargetName.PYTHON, Python, ms, o),
};
export const INCOMPLETE_DISCLAIMER_NONCOMPILING =
'Example automatically generated from non-compiling source. May contain errors.';