@@ -76,6 +76,41 @@ end toolsBuilderRunBundle
7676
7777// //////////////////////////////////////////////////////////////////////////////
7878
79+ private command toolsBuilderPrepareMergExt pMergExtVersion, pEdition, pPlatform
80+ -- Ensure that the MergExt bundle is downloaded and unpacked
81+ builderMergExtUnpack pMergExtVersion , (toUpper (char 1 of pEdition ) & toLower (char 2 to - 1 of pEdition ))
82+
83+ -- Remove un-needed files from the unpacked MergExt collection
84+ local tOldFolder
85+ local tCollectionFolder
86+ put builderMergExtFolder() & "/" & "MergExt" into tCollectionFolder
87+ put the defaultFolder into tOldFolder
88+ set the defaultFolder to tCollectionFolder
89+ repeat for each line tExtension in the folders
90+ -- Skip special names
91+ if tExtension is empty or tExtension is "." or tExtension is ".." then next repeat
92+
93+ -- Enter the extension directory
94+ set the defaultFolder to tCollectionFolder & "/" & tExtension
95+
96+ -- Remove any iOS code if we're not building the OSX installer
97+ if pPlatform is not "macosx" then
98+ get shell ("rm -rf *.lcext" )
99+ end if
100+
101+ -- If the directory contains no code any more, remove it
102+ local tFiles
103+ put the files & return & the folders into tFiles
104+ filter lines of tFiles with regex pattern "^.*\.(so|dylib|bundle|dll|lcext)$"
105+ if tFiles is empty then
106+ set the defaultFolder to tCollectionFolder
107+ get shell (merge ("rm -rf '[[tExtension]]'" ))
108+ end if
109+ end repeat
110+ end toolsBuilderPrepareMergExt
111+
112+ // //////////////////////////////////////////////////////////////////////////////
113+
79114private command toolsBuilderMakePackage pVersion, pEdition, pPlatform, pEngineFolders, pIdeFolder, pDocsFolder
80115 local tPackageFile
81116
@@ -106,6 +141,9 @@ private command toolsBuilderMakePackage pVersion, pEdition, pPlatform, pEngineFo
106141 put builderWorkFolder() & slash & "tools-" & pPlatform & "-" & pVersion & ".zip" into tPackageFile
107142 builderEnsureFolderForFile tPackageFile
108143
144+ -- Ensure that MergExt is available for inclusion
145+ toolsBuilderPrepareMergExt builderMergExtVersion(), pEdition , pPlatform
146+
109147 -- return tPackageFile
110148
111149 -- Configure the package compiler appropriately
@@ -131,6 +169,7 @@ private command toolsBuilderMakePackage pVersion, pEdition, pPlatform, pEngineFo
131169 packageCompilerConfigureSOurce tPackager , "emscripten" , pEngineFolders ["emscripten" ]
132170 packageCompilerConfigureSource tPackager , "prebuilt" , builderRepoFolder() & slash & "prebuilt"
133171 packageCompilerConfigureSource tPackager , "repo" , builderRepoFolder()
172+ packageCompilerConfigureSource tPackager , "mergext" , builderMergExtFolder()
134173 if tEditionType is among the items of "indy,business" then
135174 packageCompilerConfigureSource tPackager , "private" , builderPrivateRepoFolder()
136175 end if
@@ -238,6 +277,7 @@ on toolsBuilderPackageReport pType, pMessage, pLine
238277 builderLog pType , pMessage
239278end toolsBuilderPackageReport
240279
280+
241281// //////////////////////////////////////////////////////////////////////////////
242282
243283private command toolsBuilderMakeInstaller pVersion, pEdition, pPlatform, pIdeFolder, pPrivateFolder, pPackageFile
0 commit comments