test: add tests

This commit is contained in:
2026-10-16 00:43:09 +03:00
parent c3c0b07d32
commit 0edfb12473
10 changed files with 2112 additions and 2952 deletions
+4 -5
View File
@@ -1,4 +1,5 @@
import gulp from "gulp";
import type { Task, TaskFunction } from "undertaker";
import { Config } from "../core/config";
import { BuildSystem, Platform } from "../core/type";
import { Builder } from "./core/builder";
@@ -7,8 +8,6 @@ import { Runner } from "./core/runner";
import { RuffleRunner } from "./impl/runner/ruffle";
export * from "./core";
export type Task = any; // TODO: gulp task type
export class Project {
// TODO: compatibility
static Config = Config;
@@ -56,8 +55,8 @@ export class Project {
return [packer.prepare.bind(packer), packer.call.bind(packer)];
}
compile(external_gulp?: any): Record<string, Task> {
const result: Record<string, Task> = {};
compile(external_gulp?: gulp.Gulp): Record<string, TaskFunction> {
const result: Record<string, TaskFunction> = {};
const _gulp = external_gulp || gulp;
for (const platform of this.platforms) {
result[`${this.config.name}:${platform}:build`] = _gulp.series(this.build(platform));
@@ -74,7 +73,7 @@ export class Project {
return result;
}
register(external_gulp?: any) {
register(external_gulp?: gulp.Gulp) {
const _gulp = external_gulp || gulp;
for (const [k, v] of Object.entries(this.compile(_gulp))) {
_gulp.task(k, v);