24 lines
731 B
TypeScript
24 lines
731 B
TypeScript
import type { Config } from "../../core/config";
|
|
import { Target } from "./target";
|
|
|
|
export class Builder extends Target {
|
|
static factory: Record<string, typeof Builder> = {};
|
|
|
|
public buildSystem: string;
|
|
public debug: boolean;
|
|
|
|
constructor(config: Config, platform: string, buildSystem: string, debug: boolean = false) {
|
|
super(config, platform);
|
|
this.buildSystem = buildSystem;
|
|
this.debug = debug;
|
|
}
|
|
|
|
static register(buildSystem: string, builder: typeof Builder) {
|
|
Builder.factory[buildSystem] = builder;
|
|
}
|
|
|
|
static new(config: Config, platform: string, buildSystem: string, debug: boolean = false): Builder {
|
|
return new Builder.factory[buildSystem](config, platform, buildSystem, debug);
|
|
}
|
|
}
|