Fat widgets

hh hh at hyperhh.de
Sat Jul 8 13:27:57 EDT 2017


Thank you very much for that.

This solves the situation where the LC-8 version and the LC-9 version are the
same (have the same lcb file). 
Thus you can only have widgets that use LCB-syntax/features that are present
in both LC-8 and LC-9, especially no new/different LCB features from LC-9.

> Kevin wrote:
> I don¹t see why not:
> 
> on openStack
>    -- Build widgets and libraries
>    if the environment is "development" then
>       _checkExtension _rootFolder() & "/extensions/com.library.folder.here"
> -- insert any others here
> end if
> 
> end openStack
> 
> --
> -- Remove all the files with the extension pExtension in the
> -- current directory
> --
> command _removeExtension pExtension
>    get "find . -depth 1 -name " & quote & "*." & pExtension & quote && "
> -exec rm {} \;"
>    get shell(it)
> end _removeExtension
> --
> -- _checkExtension pFolder
> --
> -- Proceed to build and install the extension in pFolder if need be
> --
> command _checkExtension pFolder
>    local tOldFolder, tFiles
>    local tExtensionFolder
>    
>    set the itemDel to slash
>    
>    put item -1 of pFolder into tExtensionFolder
>    
>    put the defaultFolder into tOldFolder
>    set the defaultFolder to pFolder
>    
>    put the detailed files into tFiles
>    
>    set the itemDel to comma
>    
>    local tPackageTime, tLcbTime, tPackageName
>    
>    repeat for each line tFile in tFiles
>       local tFilename
>       put urlDecode(item 1 of tFile) into tFilename
>       
>       if tFilename ends with ".lce" then
>          -- Get the last modification date of the package
>          put item 5 of tFile into tPackageTime
>          put urlDecode(tFilename) into tPackageName
>          
>       else if tFilename ends with ".lcb" then
>          -- LCB file we want to check
>          put item 5 of tFile into tLcbTime
>       end if
>    end repeat
>    
>    -- Guess the extension name from the folder - only take the
>    -- first 4 segments, as orientabletext folder, for instance,
>    -- also has the version appended to the widget name
>    local tExtensionName
>    set the itemDel to "."
>    put item 1 to 4 of tExtensionFolder into tExtensionName
>    
>    if tPackageTime is empty or tPackagetime < tLcbTime or \
>          tExtensionName is not among the lines of the loadedExtensions then
>       -- Missing or outdated extension package, or extension not loaded
>       updateMessage "Building and installing extension" && tExtensionFolder
>       
>       _removeExtension "lci"
>       _removeExtension "lce"
>       _removeExtension "lcm"
>       _removeExtension "xml"
>       
>       -- Make sure to remove the extension beforehand, installation does
> not
>       -- work properly if the extension already exists
>       revIDEDeveloperExtensionUninstall pFolder
>       
>       wait 500 milliseconds with messages
>       
>       revIDEDeveloperExtensionInstall pFolder
>       
>       load extension from file tPackageName
>       
>       -- Let the IDE load the extension
>       wait 500 milliseconds with messages
>    end if
>    
>    set the defaultFolder to tOldFolder
> end _checkExtension
> 
> --
> -- _rootFolder
> --
> -- Return the root folder of the application
> --
> function _rootFolder
>    if the environment is "development" then
>       set the itemDel to slash
>       return item 1 to -3 of the filename of me
>       
>    else
>       return specialFolderPath("engine")
>    end if
> end _rootFolder




More information about the use-livecode mailing list