32 lines
814 B
TypeScript
32 lines
814 B
TypeScript
import gulp from "gulp";
|
|
import { type Config, Platform } from "../../../core/type";
|
|
import { Android } from "../../../impl/android";
|
|
import { Runner } from "../../core/runner";
|
|
|
|
export class AndroidRunner extends Runner {
|
|
protected android: Android;
|
|
|
|
constructor(config: Config, debug?: boolean) {
|
|
super(config, Platform.ANDROID, debug);
|
|
this.android = new Android();
|
|
}
|
|
|
|
setup() {
|
|
return this.android.prepare();
|
|
}
|
|
|
|
call() {
|
|
const target = this.targetPath;
|
|
return this.log(
|
|
gulp
|
|
.src(`${target}/${this.config.meta.filename}_${this.config.meta.version}.apk`)
|
|
.pipe(this.android.apk())
|
|
.pipe(this.android.install())
|
|
.pipe(this.android.start())
|
|
.pipe(this.android.logcat()),
|
|
);
|
|
}
|
|
}
|
|
|
|
Runner.register(Platform.ANDROID, AndroidRunner);
|