Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update helper callback stack paths in packaged app #208

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions framework/levure.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,22 @@ command levureLoadAppConfig pBuildProfile
put expandHelperAssetsFileReferenceArray(pBuildProfile, sAppA["helpers"], sAppFolder) into sAppA["helpers"]
put the result into tError

/* Update callback stackfiles */
local i, tKeyIndex, tKind, tHelperFilename
repeat with i = 1 to the number of elements of sAppA["helpers"]
repeat with tKeyIndex = 1 to the number of elements of sAppA["helpers"][i]["register components"]
put sAppA["helpers"][i]["register components"][tKeyIndex]["key"] into tKey
put sAppA["helpers"][i]["register components"][tKeyIndex]["kind"] into tKind

if sAppA["helpers"][i]["register components"][tKeyIndex]["callback stackfile"] is not empty then
put resolveFilenameReference( \
sAppA["helpers"][i]["register components"][tKeyIndex]["callback stackfile"], \
sAppA["helpers"][i]["filename"]) \
into sAppA["registered components"][tKind][tKey]["callback stackfile"]
end if
end repeat
end repeat

if tError is empty then
resolveHelperAssets pBuildProfile
put the result into tError
Expand All @@ -1205,7 +1221,7 @@ command levureLoadAppConfig pBuildProfile
end if

if tError is empty then
local i, j
local j
local tFilesA

##########
Expand Down Expand Up @@ -1258,7 +1274,7 @@ command levureLoadAppConfig pBuildProfile
# Get keys registered by helpers
##########
if tError is empty then
local tKeyIndex, tKind, tCallbackStack, k
local tCallbackStack, k

repeat with i = 1 to the number of elements of sAppA["helpers"]
repeat with tKeyIndex = 1 to the number of elements of sAppA["helpers"][i]["register components"]
Expand Down
5 changes: 5 additions & 0 deletions packager/packager.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ private command _pruneAppArray @xAppA, pBuildProfile, pPlatform
delete local xAppA["preferences filename"]["shared"][tKey]
end repeat

/* Delete callback stackfiles that will be resolved at runtime */
repeat for each key tKey in xAppA["registered components"]["files"]
delete local xAppA["registered components"]["files"][tKey]["callback stackfile"]
end repeat

return empty for error
end _pruneAppArray

Expand Down