Skip to content

Commit

Permalink
Merge pull request #264 from Jarrio/main
Browse files Browse the repository at this point in the history
Added postbuild callback
  • Loading branch information
RobDangerous authored Oct 21, 2022
2 parents a73d250 + 167c295 commit d385eed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ProjectFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export let Callbacks = {
postHaxeRecompilation: [() => {}],
postCppCompilation: [() => {}],
postAssetReexporting: [(filePath: string) => {}],
postBuild: [() => {}],
onFailure: [(error: any) => {}]
};

Expand All @@ -31,6 +32,7 @@ export async function loadProject(from: string, projectfile: string, platform: s
postHaxeRecompilation: () => {},
postCppCompilation: () => {},
postAssetReexporting: (filePath: string) => {},
postBuild: () => {},
onFailure: (error: any) => {}
};
let resolver = (project: Project) => {
Expand All @@ -42,6 +44,7 @@ export async function loadProject(from: string, projectfile: string, platform: s
Callbacks.postHaxeRecompilation.push(callbacks.postHaxeRecompilation);
Callbacks.postCppCompilation.push(callbacks.postCppCompilation);
Callbacks.postAssetReexporting.push(callbacks.postAssetReexporting);
Callbacks.postBuild.push(callbacks.postBuild);
Callbacks.onFailure.push(callbacks.onFailure);
resolve(project);
};
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,10 @@ export async function run(options: Options, loglog: any): Promise<string> {
}
throw err;
}

for (let callback of Callbacks.postBuild) {
callback();
}

if ((options.target === Platform.Linux || options.target === Platform.FreeBSD) && options.run) {
await runProject(options, name);
Expand Down

0 comments on commit d385eed

Please sign in to comment.