mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-08 06:28:29 +01:00
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
namespace OS {
|
|
export namespace application {
|
|
/**
|
|
*
|
|
* @class libantosdk
|
|
* @extends {BaseApplication}
|
|
*/
|
|
export class libantosdk extends BaseApplication {
|
|
private sdk: API.AntOSDKBuilder;
|
|
constructor(args: AppArgumentsType[]) {
|
|
super("libantosdk", args);
|
|
}
|
|
main(): void {
|
|
this.sdk = new API.AntOSDKBuilder(
|
|
{
|
|
info: (d) => console.log(d),
|
|
error: (d) => console.error(d)
|
|
},
|
|
"home://workspace/antosdk-apps/libantosdk");
|
|
(this.find("btnsend") as GUI.tag.ButtonTag).onbtclick = (e) => {
|
|
this.openDialog("PromptDialog", {
|
|
label: "Stages",
|
|
value: "build,uglify,copy"
|
|
}).then(v => {
|
|
this.load(this.compile(v.split(",")));
|
|
})
|
|
|
|
}
|
|
}
|
|
|
|
compile(stages): Promise<string> {
|
|
return new Promise( async (resolve, reject) => {
|
|
try {
|
|
const options = await "home://workspace/antosdk-apps/libantosdk/build.json".asFileHandle().read("json");
|
|
await this.sdk.batch(stages,options);
|
|
resolve("OK");
|
|
}
|
|
catch(e)
|
|
{
|
|
reject(__e(e));
|
|
}
|
|
|
|
})
|
|
}
|
|
}
|
|
}
|
|
} |