Fat widgets
Kevin Miller
kevin at livecode.com
Sat Jul 8 09:43:55 EDT 2017
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
Kind regards,
Kevin
Kevin Miller ~ kevin at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
On 08/07/2017, 14:30, "use-livecode on behalf of Matthias Rebbe via
use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of
use-livecode at lists.runrev.com> wrote:
>Kevin,
>
>is it possible to get that script or is it not for the public?
>
>Regards,
>Matthias
>
>Matthias Rebbe
>+49 5741 310000
>matthiasrebbe.eu <http://matthiasrebbe.eu/>
>
More information about the use-livecode
mailing list