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

Commit db32c3a

Browse files
Merge pull request #6623 from bwmilby/bwm-lcb-manifest
[[ LCB ]] [[ Docs ]] Add OS and Platforms to LCB Metadata
2 parents 4268d87 + 0c18c26 commit db32c3a

16 files changed

Lines changed: 115 additions & 23 deletions

File tree

docs/guides/LiveCode Builder Language Reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ At the moment, the following keys are understood:
188188
- description: a simple description of the module's purpose
189189
- version: a string in the form X.Y.Z (with X, Y and Z integers) describing the modules version
190190
- author: the name of the author of the module
191+
- os: the operating systems where the module can be used
192+
- platforms: the platforms where the module can be used
191193

192194
> **Note:** The current metadata mechanism is unlikely to remain part of
193195
> the language. It is intended that it will be replaced by a package

docs/guides/LiveCode Builder Style Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the "any later version" clause.
2323
### Module name
2424

2525
The module name uses reverse DNS notation. For example, a module created by
26-
the Example Organisation would use module names beginning with `org.example`.
26+
the Example Organization would use module names beginning with `org.example`.
2727

2828
Replace any hyphen (`-`) characters in a domain name with underscore (`_`)
2929
characters. For example, a module derived from the `fizz-buzz.example.org`

extensions/libraries/androidaudiorecorder/androidaudiorecorder.lcb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ library com.livecode.library.androidaudiorecorder
1616
metadata version is "1.0.0"
1717
metadata author is "LiveCode"
1818
metadata title is "Android Audio Recorder"
19+
metadata os is "android"
1920

2021
-- We need permissions to record audio and write to the external
2122
-- storage directory.

extensions/libraries/androidbgaudio/androidbgaudio.lcb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use com.livecode.library.androidutils
3333
metadata version is "0.0.0"
3434
metadata author is "LiveCode"
3535
metadata title is "Android Background Audio"
36+
metadata os is "android"
3637

3738
----
3839

extensions/libraries/toast/toast.lcb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818
/**
1919
A library for displaying toasts on mobile
2020

21-
Platforms: android
22-
2321
Description:
2422
A toast is a non-modal temporary notification displayed to the user.
2523
*/
@@ -31,6 +29,7 @@ use com.livecode.java
3129
metadata version is "1.0.0"
3230
metadata author is "LiveCode"
3331
metadata title is "Toast Notification Library"
32+
metadata os is "android"
3433

3534
--==============================================================================
3635
-- Foreign handlers
@@ -77,8 +76,6 @@ end handler
7776
/**
7877
Display a toast notification
7978

80-
Platforms: android
81-
8279
Example:
8380
mobileToast "Hello, I am a toast!", "short"
8481

@@ -119,8 +116,6 @@ end handler
119116
/**
120117
Cancel the current toast
121118

122-
Platforms: android
123-
124119
Description:
125120
Use <mobileToastCancel> to cancel the currently displayed toast.
126121
*/

extensions/modules/android-utils/android-utils.lcb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use com.livecode.library.widgetutils
2929
metadata version is "1.0.0"
3030
metadata author is "LiveCode"
3131
metadata title is "Android Utilities"
32+
metadata os is "android"
3233

3334
private handler ColorComponentToInt(in pComponent as Real) returns Integer
3435
multiply pComponent by 255

extensions/script-libraries/extension-utils/extension-utils.livecodescript

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,8 @@ constant kNameKey = "name"
760760
constant kVersionKey = "version"
761761
constant kAuthorKey = "author"
762762
constant kTitleKey = "title"
763+
constant kPlatformsKey = "platforms"
764+
constant kOsKey = "os"
763765
constant kTypeKey = "type"
764766
constant kIdeKey = "ide"
765767
constant kModuleFilesKey = "module_files"
@@ -1475,6 +1477,20 @@ function extensionFetchMetadata pManifestPath
14751477
end if
14761478
put tTargetAuthor into tDataA[kAuthorKey]
14771479

1480+
local tTargetPlatforms
1481+
put textDecode(revXMLNodeContents(tTreeID, "/package/platforms"), "utf-8") into tTargetPlatforms
1482+
if tTargetPlatforms is empty or tTargetPlatforms begins with "xmlerr" then
1483+
put empty into tTargetPlatforms
1484+
end if
1485+
put tTargetPlatforms into tDataA[kPlatformsKey]
1486+
1487+
local tTargetOs
1488+
put textDecode(revXMLNodeContents(tTreeID, "/package/os"), "utf-8") into tTargetOs
1489+
if tTargetOs is empty or tTargetOs begins with "xmlerr" then
1490+
put empty into tTargetOs
1491+
end if
1492+
put tTargetOs into tDataA[kOsKey]
1493+
14781494
# Fetch property metadata
14791495
local tMetadataValue, tMetadataKey
14801496
local tMetadataNodes, tMetadataA, tKeys, tValue

extensions/widgets/androidbutton/androidbutton.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ use com.livecode.library.androidutils
4747
metadata version is "1.0.0"
4848
metadata author is "LiveCode"
4949
metadata title is "Android Native Button"
50+
metadata os is "android"
51+
metadata platforms is "mobile"
5052
metadata svgicon is "M25.34,0H2.1A2.1,2.1,0,0,0,0,2.1V13.19a2.1,2.1,0,0,0,2.1,2.1H25.34a2.1,2.1,0,0,0,2.1-2.1V2.1A2.1,2.1,0,0,0,25.34,0Zm-15,9.49a.76.76,0,0,1-1.51.15.85.85,0,0,1,0-.15q0-1.58,0-3.16a.76.76,0,0,1,1.51-.12.91.91,0,0,1,0,.13q0,.78,0,1.57T10.35,9.49Zm7.08,1.11a.8.8,0,0,1-.4.71.78.78,0,0,1-.42.12h-.49c-.05,0-.05,0-.05.05,0,.54,0,1.08,0,1.62a.76.76,0,0,1-1.51.13.75.75,0,0,1,0-.14q0-.81,0-1.62s0,0,0,0h-.94s0,0,0,0c0,.55,0,1.09,0,1.64a.76.76,0,0,1-1.51.12.76.76,0,0,1,0-.14q0-.81,0-1.62s0,0,0,0h-.5a.82.82,0,0,1-.81-.64.8.8,0,0,1,0-.18q0-2.44,0-4.88s0,0,0,0h6.71s0,0,0,0Q17.43,8.17,17.43,10.6Zm0-5.18H10.68s0,0,0,0a2.93,2.93,0,0,1,.14-.86,3,3,0,0,1,.49-.92,3.27,3.27,0,0,1,.89-.79l.18-.1s0,0,0,0l-.51-.92a.11.11,0,0,1,0-.16.11.11,0,0,1,.16,0l.17.3.35.64s0,0,.06,0a3.5,3.5,0,0,1,.93-.26,3.67,3.67,0,0,1,1.89.24h0c.07,0,.07,0,.1,0l.5-.9a.11.11,0,0,1,.12-.07.11.11,0,0,1,.09.08.12.12,0,0,1,0,.09l-.51.91s0,0,0,.07a3.23,3.23,0,0,1,1.35,1.34,2.91,2.91,0,0,1,.33,1.08c0,.09,0,.17,0,.26S17.43,5.42,17.41,5.42Zm1.82,2.49q0,.79,0,1.59a.76.76,0,0,1-1.51.11.85.85,0,0,1,0-.12q0-1.58,0-3.15a.76.76,0,0,1,1.51-.15.88.88,0,0,1,0,.16Q19.24,7.12,19.24,7.91Zm-3.35-4a.28.28,0,1,1-.28-.28A.29.29,0,0,1,15.89,3.89Zm-3.14,0a.28.28,0,1,1-.28-.28A.28.28,0,0,1,12.75,3.89Z"
5153

5254
/**

extensions/widgets/androidfield/androidfield.lcb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ use com.livecode.library.scriptitems
127127
metadata version is "1.0.0"
128128
metadata author is "LiveCode"
129129
metadata title is "Android Native Field"
130+
metadata os is "android"
130131
metadata svgicon is "M28.06,4.95a.34.34,0,1,1,.34.34A.34.34,0,0,1,28.06,4.95Zm-3.45.34a.34.34,0,1,0-.34-.34A.34.34,0,0,0,24.6,5.29ZM36.25,2V17.24a2,2,0,0,1-2,2H2a2,2,0,0,1-2-2V2A2,2,0,0,1,2,0h32.3A2,2,0,0,1,36.25,2ZM22.39,6.8h8.23a3.76,3.76,0,0,0-2.1-3.31l.65-1.17a.13.13,0,0,0-.05-.18l-.06,0a.13.13,0,0,0-.11.07l-.66,1.19a4.43,4.43,0,0,0-3.56,0l-.66-1.19a.13.13,0,1,0-.23.13l.65,1.17A3.76,3.76,0,0,0,22.39,6.8ZM9.57,2.57H5v1.5H6.53v11H5v1.5H9.57v-1.5H8v-11H9.57ZM22,7.89a.92.92,0,0,0-1.84,0v3.84a.92.92,0,1,0,1.84,0Zm8.57-.76H22.39v6a1,1,0,0,0,1,1H24v2a.92.92,0,1,0,1.84,0v-2h1.23v2a.92.92,0,1,0,1.84,0v-2h.66a1,1,0,0,0,1-1Zm2.19.76a.92.92,0,0,0-1.84,0v3.84a.92.92,0,1,0,1.84,0Z"
131132

132133
__safe foreign handler _JNI_GetSystemService(in pContext as JObject, in pService as JString) returns JObject \

extensions/widgets/html5button/html5button.lcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818
/**
1919
This widget is a native button in HTML5.
2020
*/
21-
2221
widget com.livecode.widget.native.emscripten.button
2322

2423
use com.livecode.foreign
@@ -30,6 +29,7 @@ use com.livecode.engine
3029
metadata version is "1.0.0"
3130
metadata author is "LiveCode"
3231
metadata title is "HTML5 Native Button"
32+
metadata os is "html5"
3333
metadata svgicon is "M 397,551.25195 a 2.1,2.1 0 0 0 -2.09961,2.09961 v 11.08985 A 2.1,2.1 0 0 0 397,566.54297 h 23.24023 a 2.1,2.1 0 0 0 2.09961,-2.10156 v -11.08985 a 2.1,2.1 0 0 0 -2.09961,-2.09961 z m 7.11328,2.52344 h 9.01367 l -0.81836,9.20703 -3.70117,1.03711 -3.67383,-1.03711 z m 1.67774,1.88281 0.30078,3.41797 h 3.91797 l -0.14063,1.46094 -1.26172,0.33789 -1.2539,-0.33789 -0.084,-0.89649 h -1.12109 l 0.14258,1.7793 2.3164,0.64063 h 0.0274 v -0.008 l 2.29882,-0.63476 0.31836,-3.48242 h -4.12304 l -0.0957,-1.15821 h 4.31446 l 0.10351,-1.11914 Z"
3434

3535
/**

0 commit comments

Comments
 (0)