@@ -162,40 +162,36 @@ function revIDEDeveloperExtensions
162162 return tExtensionDetailsA
163163end revIDEDeveloperExtensions
164164
165- private command __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder, @rFile, @rType
166- local tExtFile , tType
167- revIDEExtensionFetchSourceFromFolder pFolder , tExtFile , tType
165+ private command __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder, @rFile, @rSupportFiles, @ rType
166+ local tMainFile , tType , tSupportFiles
167+ revIDEExtensionFetchSourceFromFolder pFolder , tMainFile , tSupportFiles , tType
168168
169- local tNumExtensions
170- put the number of lines in tExtFile into tNumExtensions
171-
172- # If there are multiple lcb files in one folder, it's an error.
173- if tNumExtensions > 1 then
174- put replaceText (tExtFile , return, "," ) into tExtFile
175- __revIDEDeveloperExtensionSendError "multiple lcb files in folder" && pFolder & ":" && tExtFile
176- return empty
169+ if the result is not empty then
170+ __revIDEDeveloperExtensionSendError the result
177171 end if
178172
179- put tExtFile into rFile
173+ put tMainFile into rFile
174+ put tSupportFiles into rSupportFiles
180175 put tType into rType
181176end __revIDEDeveloperExtensionFetchExtensionSourceInFolder
182177
183178function revIDEDeveloperExtensionNoCompile pFolder
184- local tFile , tType
185- __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tType
179+ local tFile , tType , tSupportFiles
180+ __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tSupportFiles , tType
186181
187182 if tFile is empty then
188183 return empty
189184 end if
190185
191186 if tType is "lcs" then
192- return __revIDEDeveloperExtensionDetailsFromFile(pFolder , tFile , tType )
187+ return __revIDEDeveloperExtensionDetailsFromFile(pFolder , tFile , tSupportFiles , tType )
193188 end if
194189
195190 local tDataA
196191 revIDEExtensionMetadata pFolder , tFile , tType , tDataA
197192 if the result is not empty then
198193 put tFile into tDataA ["file" ]
194+ put tSupportFiles into tDataA ["support_files" ]
199195 end if
200196 return tDataA
201197end revIDEDeveloperExtensionNoCompile
@@ -217,14 +213,14 @@ command revIDEDeveloperExtensionsActiveFolders pFolders
217213end revIDEDeveloperExtensionsActiveFolders
218214
219215function revIDEDeveloperExtension pFolder
220- local tFile , tType
221- __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tType
216+ local tFile , tType , tSupportFiles
217+ __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tSupportFiles , tType
222218
223219 if tFile is empty then
224220 return empty
225221 end if
226222
227- return __revIDEDeveloperExtensionDetailsFromFile(pFolder , tFile , tType )
223+ return __revIDEDeveloperExtensionDetailsFromFile(pFolder , tFile , tSupportFiles , tType )
228224end revIDEDeveloperExtension
229225
230226private function __revIDEDeveloperExtensionFetchFolderDetails pFolder, pFile
@@ -360,11 +356,12 @@ private function __revIDEDeveloperExtensionListResourcesRecursive pFolder, pPref
360356 return tResources
361357end __revIDEDeveloperExtensionListResourcesRecursive
362358
363- private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile, pType
359+ private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile, pSupportFiles, pType
364360 local tDetailsA
365361 put __revIDEDeveloperExtensionFetchFolderDetails(pFolder , pFile ) into tDetailsA
366362
367- put pFile into tDetailsA ["file" ]
363+ put pFile into tDetailsA ["file" ]
364+ put pSupportFiles into tDetailsA ["support_files" ]
368365 if pType is "lcb" then
369366 if not __revIDEDeveloperExtensionShouldRecompile(pFolder , pFile ) then
370367
@@ -380,7 +377,7 @@ private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile, pType
380377 else
381378 # The compiled module or manifest is not up to date, so compile.
382379 __revIDEDeveloperExtensionLog "Compiling module" && pFolder & slash & pFile
383- __revIDEDeveloperCompileModule pFolder & slash & pFile , pFolder
380+ __revIDEDeveloperCompileModule pFolder & slash & pFile , pSupportFiles , pFolder
384381 if the result is not empty then
385382 # This may be better as a warning, and try to parse info direct from the file.
386383 __revIDEDeveloperExtensionSendError the result
@@ -681,8 +678,8 @@ private command __revIDEDeveloperExtensionEditLCBScript pFile
681678end __revIDEDeveloperExtensionEditLCBScript
682679
683680on revIDEDeveloperExtensionOpen pFolder
684- local tFile , tType
685- __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tType
681+ local tFile , tType , tSupportFiles
682+ __revIDEDeveloperExtensionFetchExtensionSourceInFolder pFolder , tFile , tSupportFiles , tType
686683 if tFile is empty then
687684 exit revIDEDeveloperExtensionOpen
688685 end if
@@ -737,8 +734,8 @@ private function __fetchMetadatum pXmlId, pKey
737734 return textDecode (revXMLNodeContents (pXmlId , tNode ), "utf-8" )
738735end __fetchMetadatum
739736
740- private command __revIDEDeveloperCompileModule pFile, pTargetFolder
741- revIDEExtensionCompile pFile , pTargetFolder
737+ private command __revIDEDeveloperCompileModule pFile, pSupportFiles, pTargetFolder
738+ revIDEExtensionCompile pFile , pSupportFiles , pTargetFolder
742739
743740 if the result is not empty then
744741 __revIDEDeveloperCompilationError the result
@@ -892,9 +889,12 @@ private command __revIDEDeveloperExtensionBuildPackage pFolder, pTargetFolder, @
892889 put empty into tEditors
893890 end if
894891
892+ local tSupportFiles
893+ put tDetailsA ["support_files" ] into tSupportFiles
894+
895895 if tError is empty then
896896 put __revIDEDeveloperExtensionAddSpecifiedFilesToPackage(\
897- tFullPath , pFolder , tArchive , pFolder & slash & "module.lcm" , \
897+ tFullPath , tSupportFiles , pFolder , tArchive , pFolder & slash & "module.lcm" , \
898898 tIcon , tRetinaIcon , tGuide , tDocs , tResources , tCode , \
899899 tSamples , tInterfaceFile , tDefaultScript , tEditors ) \
900900 into tError
@@ -918,10 +918,10 @@ private command __revIDEDeveloperExtensionBuildPackage pFolder, pTargetFolder, @
918918end __revIDEDeveloperExtensionBuildPackage
919919
920920private function __revIDEDeveloperExtensionAddSpecifiedFilesToPackage \
921- pSource , pFolder , pArchive , pModule , pIcon , pRetinaIcon , pGuide , \
922- pDocs , pResourcesFolder , pCodeFolder , pSamplesFolder , \
923- pInterfaceFile , pDefaultScript , pEditors
924-
921+ pSource , pSupportFiles , pFolder , pArchive , pModule , pIcon , \
922+ pRetinaIcon , pGuide , pDocs , pResourcesFolder , pCodeFolder , \
923+ pSamplesFolder , pInterfaceFile , pDefaultScript , pEditors
924+
925925 local tError
926926
927927 set the itemdelimiter to slash
@@ -932,6 +932,16 @@ private function __revIDEDeveloperExtensionAddSpecifiedFilesToPackage \
932932 put "couldn't add source" into tError
933933 end if
934934
935+ # Add support files into package
936+ repeat for each line tSupport in pSupportFiles
937+ put pFolder & slash & tSupport into tSupport
938+ revZipAddItemWithFile pArchive , item - 1 of tSupport , tSupport
939+
940+ if the result begins with "ziperr" then
941+ put "couldn't add support file" && tSupport into tError
942+ end if
943+ end repeat
944+
935945 # Add module into package
936946 revZipAddItemWithFile pArchive , "module.lcm" , pModule
937947
@@ -951,10 +961,10 @@ private function __revIDEDeveloperExtensionAddSpecifiedFilesToPackage \
951961 # Add user guide
952962 if tError is empty then
953963 // AL-2015-03-03: [[ Bug 14781 ]] If there is no guide, warn and don't try to add a file
954- if pGuide is empty then
955- __revIDEDeveloperExtensionSendWarning "no user guide found"
956- else
957- revZipAddItemWithFile pArchive , "docs/guide/guide.md" , pGuide
964+ if pGuide is empty then
965+ __revIDEDeveloperExtensionSendWarning "no user guide found"
966+ else
967+ revZipAddItemWithFile pArchive , "docs/guide/guide.md" , pGuide
958968 end if
959969 if the result begins with "ziperr" then
960970 put "couldn't add guide" into tError
0 commit comments