Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c582030

Browse files
author
runrevali
committed
[[ Bug 14552 ]] Make sure resources are reported to and displayed by the extensions plugin
1 parent b56ef74 commit c582030

2 files changed

Lines changed: 61 additions & 28 deletions

File tree

157 Bytes
Binary file not shown.

Toolset/libraries/revidedeveloperextensionlibrary.livecodescript

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -178,34 +178,8 @@ function revIDEDeveloperExtension pFolder
178178
return __revIDEDeveloperExtensionDetailsFromFile(pFolder, tFile)
179179
end revIDEDeveloperExtension
180180

181-
private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile
181+
private function __revIDEDeveloperExtensionFetchFolderDetails pFolder
182182
local tDetailsA
183-
put pFile into tDetailsA["file"]
184-
if not __revIDEDeveloperExtensionShouldRecompile(pFolder, pFile) then
185-
__revIDEDeveloperExtensionLog pFolder & slash & "module.lcm up to date"
186-
# The stored info is up to date.
187-
if sExtensionDetailsA[pFolder] is not empty then
188-
return sExtensionDetailsA[pFolder]
189-
end if
190-
# The compiled module and manifest are up to date, but we haven't fetched the information yet.
191-
else
192-
# The compiled module or manifest is not up to date, so compile.
193-
__revIDEDeveloperExtensionLog "Compiling module" && pFolder & slash & pFile
194-
__revIDEDeveloperCompileModule pFile, pFolder
195-
196-
if the result is not empty then
197-
# This may be better as a warning, and try to parse info direct from the file.
198-
__revIDEDeveloperExtensionSendError the result
199-
return tDetailsA
200-
end if
201-
end if
202-
203-
__revIDEDeveloperExtensionLog "Fetching metadata from" && pFolder & slash & "manifest.xml"
204-
__revIDEDeveloperExtensionFetchMetadata (pFolder & slash & "manifest.xml"), tDetailsA
205-
if the result is not empty then
206-
__revIDEDeveloperExtensionSendError the result
207-
return tDetailsA
208-
end if
209183

210184
# Check timestamps to see if API is out of date.
211185
local tLastGenerated, tLastModified
@@ -227,24 +201,83 @@ private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile
227201
local tLibraryA
228202
put revDocsParseDocTextToLibraryArray(tAPI, tDetailsA["name"], tDetailsA["author"]) into tLibraryA
229203
put tLibraryA["doc"] into tDetailsA["api"]
204+
else
205+
put empty into tDetailsA["api"]
230206
end if
231207

232208
if there is a file (pFolder & slash & "icon.png") then
233209
put (pFolder & slash & "icon.png") into tDetailsA["icon"]
210+
else
211+
put empty into tDetailsA["icon"]
234212
end if
235213

236214
if there is a file (pFolder & slash & "[email protected]") then
237215
put (pFolder & slash & "[email protected]") into tDetailsA["retina_icon"]
216+
else
217+
put empty into tDetailsA["retina_icon"]
238218
end if
239219

240220
if there is a file (pFolder & slash & "guide.md") then
241221
local tGuide
242222
put url ("binfile:" & pFolder & slash & "guide.md") into tGuide
243223
put textDecode(tGuide, "utf-8") into tDetailsA["guide"]
224+
else
225+
put empty into tDetailsA["guide"]
226+
end if
227+
228+
// AL-2015-02-23: [[ Bug 14552 ]] Find resource folder and return details
229+
local tResourceFolder, tResources
230+
put pFolder & slash & "resources" into tResourceFolder
231+
if there is a folder tResourceFolder then
232+
set the defaultfolder to tResourceFolder
233+
local tResource
234+
repeat for each line tResource in the files
235+
if tResource begins with "." then next repeat
236+
put tResource & CR after tResources
237+
end repeat
238+
delete the last char of tResources
239+
put tResources into tDetailsA["resources"]
244240
end if
245241

246-
put tDetailsA into sExtensionDetailsA[pFolder]
247242
return tDetailsA
243+
end __revIDEDeveloperExtensionFetchFolderDetails
244+
245+
private function __revIDEDeveloperExtensionDetailsFromFile pFolder, pFile
246+
local tDetailsA
247+
put __revIDEDeveloperExtensionFetchFolderDetails(pFolder) into tDetailsA
248+
249+
put pFile into tDetailsA["file"]
250+
if not __revIDEDeveloperExtensionShouldRecompile(pFolder, pFile) then
251+
__revIDEDeveloperExtensionLog pFolder & slash & "module.lcm up to date"
252+
# The stored info is up to date.
253+
if sExtensionDetailsA[pFolder] is not empty then
254+
union tDetailsA with sExtensionDetailsA[pFolder]
255+
put tDetailsA into sExtensionDetailsA[pFolder]
256+
return sExtensionDetailsA[pFolder]
257+
end if
258+
# The compiled module and manifest are up to date, but we haven't fetched the information yet.
259+
else
260+
# The compiled module or manifest is not up to date, so compile.
261+
__revIDEDeveloperExtensionLog "Compiling module" && pFolder & slash & pFile
262+
__revIDEDeveloperCompileModule pFile, pFolder
263+
264+
if the result is not empty then
265+
# This may be better as a warning, and try to parse info direct from the file.
266+
__revIDEDeveloperExtensionSendError the result
267+
return tDetailsA
268+
end if
269+
end if
270+
271+
__revIDEDeveloperExtensionLog "Fetching metadata from" && pFolder & slash & "manifest.xml"
272+
__revIDEDeveloperExtensionFetchMetadata (pFolder & slash & "manifest.xml"), tDetailsA
273+
if the result is not empty then
274+
__revIDEDeveloperExtensionSendError the result
275+
return tDetailsA
276+
end if
277+
278+
put tDetailsA into sExtensionDetailsA[pFolder]
279+
return sExtensionDetailsA[pFolder]
280+
248281
end __revIDEDeveloperExtensionDetailsFromFile
249282

250283
on revIDEDeveloperExtensionAddResourceFile pExtensionFolder, pResourcePath, pType

0 commit comments

Comments
 (0)