From 76b541d581d63f763323e7080aed9c5f569ad62c Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Mon, 20 Mar 2023 08:58:14 +1100 Subject: [PATCH] Implement `finalizePackagedApp` callback This patch implements a new packager callback `finalizePackagedApp` to be called as a last chance to mutate the app configuration just prior to saving it in the standalone mainstack. --- packager/packager.livecodescript | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packager/packager.livecodescript b/packager/packager.livecodescript index 2f158e0..50737ba 100644 --- a/packager/packager.livecodescript +++ b/packager/packager.livecodescript @@ -175,6 +175,8 @@ command packagerPackageApplication pStandaloneStackFilename, pBuildProfile, pSim _pruneAppArray tAppA, pBuildProfile, tPlatform + _dispatchFinalizeApp pBuildProfile, tPlatform, tAppA, tAppFolder + log "tAppA:" && _printArray(tAppA,,true) set the itemdelimiter to "/" @@ -498,6 +500,18 @@ private command _dispatchFinalizePackagedAssets pBuildProfile, pPlatform, @xAppA end repeat end _dispatchFinalizePackagedAssets +private command _dispatchFinalizeApp pBuildProfile, pPlatform, @xAppA, pAppFolder + local tCallbackStacks, tFilename + + # Send callbacks + put _packagerCallbackStacks(xAppA, pBuildProfile) into tCallbackStacks + repeat for each line tFilename in tCallbackStacks + log "Dispatching finalizePackagedApp to stack" && tFilename + + dispatch "finalizePackagedApp" to stack tFilename with pBuildProfile, pPlatform, xAppA, pAppFolder + put "" into sCallbackStacksA[ tFilename ] + end repeat +end _dispatchFinalizeApp private command _dispatchPackagingComplete pBuildProfile, @xAppA, pOutputFolder local tCallbackStacks, tFilename