Specifying supported platforms in Inclusions entry for LCB extension?

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Specifying supported platforms in Inclusions entry for LCB extension?

Post by trevordevore » Tue Jul 10, 2018 4:00 am

I have some extensions that use FFI and are specific to a single platform. In the Standalone Builder > Inclusions tab I want the supported platform icons to represent the supported platform. Looking at revsblibrary.livecodescript I can see that extensions are hard coded to be supported on all platforms as there is this line of code:

Code: Select all

-- LCB extensions are available on all platforms
put revSBAllPlatforms() into tExtension["platforms"]
 
Now that we have FFI it is more likely that an extension may only work on a single platform. Is there any support for specifying supported platforms in the extension header?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by bwmilby » Wed Aug 01, 2018 4:29 am

When the widget is generated, platform will need to be added to the manifest. If the "OS" and "Platforms" keys are included in the library level doc comment, then they do make it to the lcdoc file that is generated. I started looking at the code briefly, but didn't follow it all to way to see if more was needed than just getting those keys added to the manifest.

The code does mix the terminology though. In the dictionary, platforms are (desktop, server, mobile) and OS is (mac, windows, linux, ios, android, html5). revSBAllPlatforms() returns (MacOSX,Windows,Linux,iOS,Android,Emscripten).
As an aside, the Toast library does have "Platforms: android" in the LCB source so the dictionary currently shows android in both the platform and OS filter lists.
If that happens, then the revSBAvailableExtensions handler can check for tExtension["platforms"] being empty before populating it with revSBAllPlatforms().

To adjust the manifest, so far I think the following need to be modified:
ide/Toolset/libraries/revidedeveloperextensionlibrary.livecodescript - line 571
toolchain/lc-compile/src/generate.g - add after line 171, add after line 259

Update: I was able to add "metadata" tags for platforms and os so they get into the manifest.xml file and are then loaded into the array when the module is loaded. Metadata tags do not currently get inserted into the documentation though, so the information would need to be included in both places. I'm thinking it would make more sense to target certain pieces of metadata and include them in the dictionary entries. Title does get included, so just a matter of figuring out where to add them.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by bwmilby » Thu Aug 02, 2018 7:27 am

Is this what you are after?
extension.jpg
What I did was add 2 new metadata items that are processed at the module/library/widget level. Now 'os' and 'platforms' are both processed. If platforms are specified without os, then it is assumed that all os variants are supported. If any os is specified, then only the os list is used.

It is going to take 2 PRs since there are code changes on both the IDE and engine side of the project.

I'm still working on the built in widgets/libraries to get the entries in the right place.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by trevordevore » Thu Aug 02, 2018 2:04 pm

Yes bwmilby, that is what I am looking to do. Great work!
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by bwmilby » Fri Aug 03, 2018 4:17 am

PRs have been submitted. Not sure where the release note should go, so I'll add that once someone takes a look (could be in the LCB notes, engine notes, or IDE notes)

https://github.com/livecode/livecode/pull/6623
https://github.com/livecode/livecode-ide/pull/1988
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by trevordevore » Fri Aug 03, 2018 5:44 am

You are the man @bwmilby!
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by bwmilby » Sat Aug 04, 2018 7:34 pm

Thanks!

While I'm at it, would it be a good idea to add Version and Author to the dictionary for the Library level entry? We could script it to not include Livecode as an author, but for other authors that would seem to be a nice addition.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by trevordevore » Sat Aug 04, 2018 8:15 pm

I think those additions would be very useful.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by Simon Knight » Fri Dec 09, 2022 12:33 pm

BUMP!!!!! and some ;-)

Given that this thread is some five years old I was hoping that indicating which operating systems commands apply to would have been sorted out. I am working on a mac/ios extension that wraps portions of the EventKit framework (thinghy!).

My library includes the following :

Code: Select all

OS: mac, ios
Unfortunately the library still gets listed in the inclusions pane with all the systems icons that Livecode builds for.

Is there a simple way to control which icons are displayed as discussed in this thread back in 2018?

So far I have not been brave enough to start looking for manifest files or into the guts of livecode, mostly because I don't think I should have to.

Remember it was suppose to be "1000 widgets and extensions" by Christmas ...... 2016" hows it going?

best wishes
and Merry Christmas

Simon
best wishes
Skids

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by Klaus » Fri Dec 09, 2022 2:12 pm

Remember it was suppose to be "1000 widgets and extensions" by Christmas ...... 2016" hows it going?
The widget store still shows:
Big Square
Circle Progress
Clock (sic!)
My Pink circle

Which is embarrassing to the power of 10. 8)

Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by Simon Knight » Fri Dec 09, 2022 2:45 pm

The widget store still shows:
Big Square
Circle Progress
Clock (sic!)
My Pink circle
Which is embarrassing to the power of 10
I'm not surprised and as you say its embarrassing. I've struggled with my library and one reason is that there is no detailed documentation, even creating the documentation is difficult with seemingly minor modifications causing the dictionary to have a fit.

S
best wishes
Skids

stam
Posts: 2599
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by stam » Fri Dec 09, 2022 7:41 pm

I've half-heartedly tried to dabble with LCB but for something as complex there is really very little documentation and one does get the impression LC just haven't bothered garnering enthusiasm for LCB - quite the opposite (hence the embarrassingly empty store). The 'IDE' (if one can really call it that it that) for LCB is very poor indeed.

Actually a scripting helper tool that lists all the default libraries, easy addition of metadata, properties etc, to help construct the .lcb file so that devs only needed to populate handlers with code, would have gone a long way to getting people on board with it, especially if it included some contextual help. The LCB files I've seen seem to be at least 50% declarations and if you just provided a list of handlers and properties to declare a lot of this could be pre-populated. But LCB always seems to be treated like an illegitimate lovechild LC Ltd. don't want to talk about...
For me that is one of the biggest disappointments/missed opportunities with the current IDE...
'My pink circle' indeed!

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by mwieder » Sat Dec 10, 2022 2:46 am

Simon- Brian's PRs were merged into the code in 2018.
You can specify both the os and the platform metadata items.

metadata author is "Simon Knight"
metadata title is "Some Android thing"
metadata os is "android"
metadata platforms is "mobile"

Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Specifying supported platforms in Inclusions entry for LCB extension?

Post by Simon Knight » Sat Dec 10, 2022 8:03 am

#mwieder
Thanks for the steer, I have now found a reference in the livecode builder language reference guide :
The metadata clauses allow a set of key-values to be encoded in the compiled module. These are not used in compilation or execution, but may be used by the system loading and using the module.

At the moment, the following keys are understood:

title: a human-readable name for the module
description: a simple description of the module's purpose
version: a string in the form X.Y.Z (with X, Y and Z integers) describing the modules version
author: the name of the author of the module
os: the operating systems where the module can be used
platforms: the platforms where the module can be used
Note: The current metadata mechanism is unlikely to remain part of the language. It is intended that it will be replaced by a package description file, which will allow modules to be grouped together with other resources.
The note is a worry: is LCB stable yet?

Echoing Stam's experiences I am finding penetrating the mist that surrounds LCB frustrating. It seems that it was new and shiny in 2016 and now its been put on a back burner. Trying to find out how to do basic tasks such as setting the metadata is difficult and, as I found, easy to miss. Elements such as the FFI don't appear to be documented, instead a few have published their code and the findings of their own investigations.

I have spent almost two weeks trying to work out how to get Mac OS to prompt the user for permission to access their calendar data. I now have the answer but don't understand how the call to the callback handler is working why, for example, all my efforts to process an NSError object fail and crash livecode, or why when I change the metadata title of my library the previously working inline dictionary entries disappear or why does the automatically allocated SVG icon keep changing?

I think that, while clever, the inline dictionary entries make the code harder to read but despite having looked at the documentation on documentation I have no idea of what files I should be creating or how I stop the Extensions Builder from overwriting them. Talking of Extensions Builder why are the icons so SMALL? Some of us wear glasses.

Sorry for the rant, I'm off to find a new wall to bang my head against.

best wishes and Merry Christmas*

Simon

* Please note that the syntax "Happy Holidays" or similar crash this compiler!
best wishes
Skids

Post Reply

Return to “LiveCode Builder”