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

Commit d5f6504

Browse files
committed
Merge remote-tracking branch 'monte/coderesources' into develop
2 parents cd61ee8 + 0c464b2 commit d5f6504

3 files changed

Lines changed: 132 additions & 37 deletions

File tree

Toolset/home.livecodescript

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,21 @@ function revInternal__StackFiles
525525
if tFolder begins with "." then next repeat
526526
put return & tComponentFolder & slash & tFolder after tFolders
527527
end repeat
528+
529+
-- commercial extensions (ensure they are loaded from the repo)
530+
local tExtensionFolder
531+
put revEnvironmentCommercialRepositoryPath() & "/extensions/script-libraries" into tExtensionFolder
532+
repeat for each line tFolder in folders(tExtensionFolder)
533+
if tFolder begins with "." then next repeat
534+
put return & tExtensionFolder & slash & tFolder after tFolders
535+
end repeat
536+
537+
-- extensions (ensure they are loaded from the repo)
538+
put revEnvironmentRepositoryPath() & "/extensions/script-libraries" into tExtensionFolder
539+
repeat for each line tFolder in folders(tExtensionFolder)
540+
if tFolder begins with "." then next repeat
541+
put return & tExtensionFolder & slash & tFolder after tFolders
542+
end repeat
528543
end if
529544

530545
local tStackFiles, tStackName
@@ -2052,12 +2067,7 @@ function revEnvironmentExtensionsPaths
20522067
if revEnvironmentIsInstalled() then
20532068
return hookToolsPath("extensions", sToolsPath & "/Extensions")
20542069
else
2055-
-- Load the real extensions rather than the packaged versions
2056-
local tPaths
2057-
put revEnvironmentRepositoryPath() & slash & "extensions" into tPaths
2058-
put return & revEnvironmentCommercialRepositoryPath() \
2059-
& slash & "extensions" after tPaths
2060-
return tPaths
2070+
return sBinariesPath & slash & "packaged_extensions"
20612071
end if
20622072
end revEnvironmentExtensionsPaths
20632073

@@ -2168,50 +2178,53 @@ end revEnvironmentBinariesPath
21682178

21692179
// SN-2015-05-15: [[ DeployAllPlatforms ]] Allow the deployment to happen for any
21702180
// platform, from any repository platform
2171-
function revEnvironmentNonNativeBinariesPath pPlatform
2172-
local tNonNativeBinariesPath, tReleaseFolder, tDebugFolder
2173-
put sBinariesPath into tNonNativeBinariesPath
2174-
2175-
set the itemDelimiter to slash
2176-
2177-
// If the platform is Linux, there will be archs
2178-
if the platform is "linux" then
2179-
delete item -3 to -1 of tNonNativeBinariesPath
2180-
else
2181-
delete item -2 to -1 of tNonNativeBinariesPath
2182-
end if
2183-
2184-
// Init to lower-case, will change if Mac platform
2185-
put "release" into tReleaseFolder
2186-
put "debug" into tDebugFolder
2181+
function revEnvironmentNonNativeBinariesPath pPlatform, pSDK
2182+
local tNonNativeBinariesPath
2183+
put sRepositoryPath into tNonNativeBinariesPath
21872184

21882185
switch pPlatform
21892186
case "Windows"
2190-
put slash & "windows" after tNonNativeBinariesPath
2187+
put slash & "win-x86-bin" after tNonNativeBinariesPath
2188+
break
2189+
case "Windows x86-64"
2190+
case "Windows x64"
2191+
case "Windows x86_64"
2192+
put slash & "win-x86_64-bin" after tNonNativeBinariesPath
21912193
break
21922194
case "Linux"
2193-
put slash & "linux/i386" after tNonNativeBinariesPath
2195+
put slash & "linux-x86-bin" after tNonNativeBinariesPath
21942196
break
2197+
case "Linux x86-64"
21952198
case "Linux x64"
2196-
put slash & "linux/x86_64" after tNonNativeBinariesPath
2199+
case "Linux x86_64"
2200+
put slash & "linux-x86_64-bin" after tNonNativeBinariesPath
2201+
break
2202+
case "Linux armv6_hf"
2203+
put slash & "linux-armv6_hf-bin" after tNonNativeBinariesPath
21972204
break
21982205
case "MacOS"
2199-
case "MacOSX PowerPC-32"
22002206
case "MacOSX x86-32"
2201-
put slash & "mac" after tNonNativeBinariesPath
2202-
put "Release" into tReleaseFolder
2203-
put "Debug" into tDebugFolder
2207+
case "MacOSX x86_32"
2208+
case "MacOSX x86-64"
2209+
case "MacOSX x64"
2210+
case "MacOSX x86_64"
2211+
put slash & "mac-bin" after tNonNativeBinariesPath
2212+
break
2213+
case "Android"
2214+
case "Android armv6"
2215+
put slash & "android-armv6-bin" after tNonNativeBinariesPath
2216+
break
2217+
case "Emscripten"
2218+
case "HTML5"
2219+
put slash & "emscripten-bin" after tNonNativeBinariesPath
2220+
break
2221+
case "iOS"
2222+
put slash & "ios-bin" & slash & pSDK after tNonNativeBinariesPath
22042223
break
22052224
default
22062225
return empty
22072226
end switch
22082227

2209-
if the last item of sBinariesPath is "release" then
2210-
put slash & tReleaseFolder after tNonNativeBinariesPath
2211-
else
2212-
put slash & tDebugFolder after tNonNativeBinariesPath
2213-
end if
2214-
22152228
return tNonNativeBinariesPath
22162229
end revEnvironmentNonNativeBinariesPath
22172230

Toolset/libraries/revideextensionlibrary.livecodescript

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,12 +1047,94 @@ private command __extensionLoad pID, pExtensionDataA
10471047
tError, tIDEExtension, tSourceFile, tToLoadA, true
10481048
end __extensionLoad
10491049

1050+
private command __MapCodeLibraryForIDE pFolder
1051+
local tLibraries
1052+
if revEnvironmentIsInstalled() and \
1053+
pFolder begins with revEnvironmentToolsPath() and \
1054+
the platform is "MacOS" then
1055+
-- special case bundled extensions must load code from within MacOS dir
1056+
-- the libs to load should be in Contents/MacOS/<extension>/
1057+
local tExtension
1058+
set the itemDelimiter to slash
1059+
put item -2 of pFolder into tExtension
1060+
1061+
put files(specialFolderPath("engine") & "/" & tExtension) & return & \
1062+
folders(specialFolderPath("engine") & "/" & tExtension) into tLibraries
1063+
filter tLibraries without ".*"
1064+
1065+
if tLibraries is not empty then
1066+
set the itemDelimiter to "."
1067+
repeat for each line tLibrary in tLibraries
1068+
-- remove extension
1069+
delete the last item of tLibrary
1070+
if tLibrary is not empty then
1071+
set the revLibraryMapping[tLibrary] to "./" & tExtension & "/" & tLibrary
1072+
end if
1073+
end repeat
1074+
end if
1075+
else
1076+
-- code folders should be platform ID triples however for the
1077+
-- time being as we have no way to access the data required to
1078+
-- determine the options section of the platform ID so we filter only
1079+
-- arch and platform and hope for the best. Ideally we would have
1080+
-- access to a build options string and give a complete match precedence.
1081+
local tCodeFolders
1082+
put folders(pFolder) into tCodeFolders
1083+
switch the platform
1084+
case "MacOS"
1085+
filter tCodeFolders with "*-mac*"
1086+
break
1087+
case "Win32"
1088+
filter tCodeFolders with "*-win*"
1089+
break
1090+
default
1091+
filter tCodeFolders with "*-"& toLower(the platform) & "*"
1092+
break
1093+
end switch
1094+
1095+
local tFilteredCodeFolders
1096+
filter tCodeFolders with the processor & "-*" into tFilteredCodeFolders
1097+
split tFilteredCodeFolders by return as set
1098+
if the platform is "MacOS" then
1099+
-- explicit processor should take precedence over universal builds but
1100+
-- in the event multiple libraries are included and some are universal
1101+
-- we must merge
1102+
local tUniveralFilteredCodeFolders
1103+
filter tCodeFolders with "universal-*" into tUniveralFilteredCodeFolders
1104+
split tUniveralFilteredCodeFolders by return as set
1105+
union tFilteredCodeFolders with tUniveralFilteredCodeFolders
1106+
end if
1107+
1108+
repeat for each key tFolder in tFilteredCodeFolders
1109+
put files(pFolder & "/" & tFolder) & return & \
1110+
folders(pFolder & "/" & tFolder) into tLibraries
1111+
filter tLibraries without ".*"
1112+
1113+
if tLibraries is not empty then
1114+
set the itemDelimiter to "."
1115+
repeat for each line tLibrary in tLibraries
1116+
-- remove extension
1117+
delete the last item of tLibrary
1118+
if tLibrary is not empty then
1119+
set the revLibraryMapping[tLibrary] to pFolder & "/" & tFolder & "/" & tLibrary
1120+
end if
1121+
end repeat
1122+
end if
1123+
end repeat
1124+
end if
1125+
end __MapCodeLibraryForIDE
1126+
10501127
private command __LoadExtension pCacheIndex, pSourceType, pSourceFile, pFolder, pStatus, @xError
10511128
if xError is empty then
10521129
if pSourceType is "lcb" then
1053-
local tResources, tModule
1130+
local tResources, tModule, tCode
10541131
put pFolder & slash & "resources" into tResources
10551132
put pFolder & slash & "module.lcm" into tModule
1133+
put pFolder & slash & "code" into tCode
1134+
# map code before loading extension
1135+
if there is a folder tCode then
1136+
__MapCodeLibraryForIDE tCode
1137+
end if
10561138
# If we have a resources folder then load with resource path
10571139
if there is a folder tResources then
10581140
load extension from file tModule with resource path tResources

Toolset/libraries/revinitialisationlibrary.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ command revInternal__LoadLibrary pLibrary, pFullPath
2424
put kLCLibraryPrefix & "." & pLibrary into tStackName
2525
else if the environment begins with "development" and \
2626
there is a stack pFullPath then
27-
put the name of stack pFullPath into tStackName
27+
put the short name of stack pFullPath into tStackName
2828
else
2929
return "no stack for library" && pLibrary
3030
end if

0 commit comments

Comments
 (0)