Skip to content

Commit e4c3790

Browse files
committed
[[ Bug 22084 ]] Fix extension release note edition section
This patch changes the release builder to interrogate the extension's built API file to determine the documented edition the extension will be available in.
1 parent 9bef869 commit e4c3790

File tree

2 files changed

+36
-42
lines changed

2 files changed

+36
-42
lines changed

builder/release_notes_builder.livecodescript

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ command releaseNotesBuilderRun pEdition, pVersion, pReleaseType, pOutputDir
5656
put "" into tComponents[tIndex]["metadata"]["edition"]
5757

5858
local tPath, tTypePath
59-
local tReposA, tEdition
59+
local tReposA, tDefaultEdition
6060
put builderPrivateRepoFolder() into tReposA["indy"]
6161
put builderRepoFolder() into tReposA["community"]
6262

63-
repeat for each key tEdition in tReposA
64-
put tReposA[tEdition] into tPath
65-
66-
repeat for each item tType in kExtensionLcbTypes
63+
repeat for each key tDefaultEdition in tReposA
64+
put tReposA[tDefaultEdition] into tPath
65+
66+
repeat for each item tType in kExtensionLcbTypes,kExtensionScriptTypes
6767
put tPath & slash & "extensions" & slash & tType into tTypePath
6868
if there is not a folder tTypePath then
6969
next repeat
@@ -74,37 +74,13 @@ command releaseNotesBuilderRun pEdition, pVersion, pReleaseType, pOutputDir
7474
put tFolder into tComponents[tIndex]["folder"]
7575
put "extension" into tComponents[tIndex]["metadata"]["category"]
7676

77+
local tEdition
78+
put ExtensionsGetEdition(tFolder) into tEdition
79+
if tEdition is empty then
80+
put tDefaultEdition into tEdition
81+
end if
7782
put tEdition into tComponents[tIndex]["metadata"]["edition"]
78-
put ExtensionsGetSectionName(tFolder) into tComponents[tIndex]["metadata"]["section"]
79-
end repeat
80-
end repeat
81-
82-
repeat for each item tType in kExtensionScriptTypes
83-
put tPath & slash & "extensions" & slash & tType into tTypePath
84-
if there is not a folder tTypePath then
85-
next repeat
86-
end if
87-
88-
repeat for each line tFolder in FileGetSubFolders(tTypePath)
89-
put the number of elements of tComponents + 1 into tIndex
90-
put tFolder into tComponents[tIndex]["folder"]
91-
put "extension" into tComponents[tIndex]["metadata"]["category"]
92-
93-
--!TODO move these extensions to components
94-
switch PathGetLastComponent(tFolder)
95-
case "revdeploylibrarydesktop"
96-
case "remotedebugger"
97-
case "scriptprofiler"
98-
case "securekey"
99-
case "pdf"
100-
case "androidbarcode"
101-
case "androidbarcodescanner"
102-
case "androidbarcodesupport"
103-
put "business" into tComponents[tIndex]["metadata"]["edition"]
104-
break
105-
default
106-
put tEdition into tComponents[tIndex]["metadata"]["edition"]
107-
end switch
83+
10884
put ExtensionsGetSectionName(tFolder) into tComponents[tIndex]["metadata"]["section"]
10985
end repeat
11086
end repeat
@@ -894,16 +870,32 @@ private function ExtensionsGetName pExtPath
894870
end ExtensionsGetName
895871

896872
private function ExtensionsGetLCSName pExtPath
897-
local tDoc, tTitle
873+
return ExtensionGetSingleLineElement(pExtPath, "Title")
874+
end ExtensionsGetLCSName
875+
876+
private function ExtensionsGetEdition pExtPath
877+
if there is a file ExtensionsGetDocPath(pExtPath) then
878+
return ExtensionGetSingleLineElement(pExtPath, "Edition")
879+
end if
880+
return empty
881+
end ExtensionsGetEdition
882+
883+
private function ExtensionGetSingleLineElement pExtPath, pElement
884+
local tDoc
898885
put builderFileGetContents(ExtensionsGetDocPath(pExtPath)) into tDoc
886+
887+
local tRegex
888+
put "(?i)^" & pElement &":\s+(.*)" into tRegex
889+
890+
local tValue
899891
repeat for each line tLine in tDoc
900-
get matchText(tLine, "(?i)^\s*(?:Title\:)\s+([\w.]*)", tTitle)
901-
if tTitle is not empty then
902-
exit repeat
892+
get matchText(word 1 to -1 of tLine, tRegex, tValue)
893+
if tValue is not empty then
894+
return tValue
903895
end if
904896
end repeat
905-
return tTitle
906-
end ExtensionsGetLCSName
897+
return empty
898+
end ExtensionGetSingleLineElement
907899

908900
private function ExtensionsGetLCBName pExtPath
909901
local tManifest, tXmlId
@@ -945,7 +937,8 @@ private function ExtensionsGetLCSKind pExtPath, pShortName
945937
end if
946938
put builderFileGetUTF8Contents(merge("[[pExtPath]]/[[pShortName]].livecodescript")) into tSource
947939
repeat for each line tLine in tSource
948-
get matchText(tLine, "(?i)^\s*(?:" & quote & "script" & quote & ")\s+([\w.]*)", tName)
940+
get matchText(tLine, "(?i)^script" && quote & "(.*)" & quote, tName)
941+
949942
if tName is not empty then
950943
exit repeat
951944
end if

docs/notes/bugfix-22084.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure extension release notes appear under correct heading

0 commit comments

Comments
 (0)