json playlet lib urls
This commit is contained in:
1 parent
2cffe72d7b
commit
ae37623756
4 files changed
+68
-22
No files matched your search
Vendored
+21
-1
@@ -18,12 +18,32 @@
|
||||
"files": [
|
||||
"**/*",
|
||||
],
|
||||
"preLaunchTask": "build",
|
||||
"preLaunchTask": "build-dev",
|
||||
"name": "Playlet (dev)",
|
||||
"injectRdbOnDeviceComponent": true,
|
||||
"injectRaleTrackerTask": true,
|
||||
"raleTrackerTaskFileLocation": "${workspaceFolder}/tools/RALE/TrackerTask.xml"
|
||||
},
|
||||
{
|
||||
"type": "brightscript",
|
||||
"request": "launch",
|
||||
"envFile": "${workspaceFolder}/.vscode/.env",
|
||||
"host": "${env:ROKU_DEV_TARGET}",
|
||||
"password": "${env:ROKU_DEVPASSWORD}",
|
||||
"stopOnEntry": false,
|
||||
"enableDebuggerAutoRecovery": false,
|
||||
"stopDebuggerOnAppExit": false,
|
||||
"rootDir": "${workspaceFolder}/dist/build/playlet",
|
||||
"sourceDirs": [
|
||||
"${workspaceFolder}/playlet/src",
|
||||
"${workspaceFolder}/playlet-lib/src"
|
||||
],
|
||||
"files": [
|
||||
"**/*",
|
||||
],
|
||||
"preLaunchTask": "build-prod",
|
||||
"name": "Playlet (prod)"
|
||||
},
|
||||
{
|
||||
"command": "npm run dev:web",
|
||||
"name": "Playlet Web (Dev)",
|
||||
|
||||
Vendored
+27
-5
@@ -2,27 +2,49 @@
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"label": "build-dev",
|
||||
"dependsOn": [
|
||||
"build-app"
|
||||
"build-app-dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-app",
|
||||
"label": "build-app-dev",
|
||||
"script": "build:app:dev",
|
||||
"type": "npm",
|
||||
"dependsOn": [
|
||||
"build-lib"
|
||||
"build-lib-dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-lib",
|
||||
"label": "build-lib-dev",
|
||||
"script": "build:lib:dev",
|
||||
"type": "npm",
|
||||
"dependsOn": [
|
||||
"build-web"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-prod",
|
||||
"dependsOn": [
|
||||
"build-app-prod"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-app-prod",
|
||||
"script": "build:app:prod",
|
||||
"type": "npm",
|
||||
"dependsOn": [
|
||||
"build-lib-prod"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-lib-prod",
|
||||
"script": "build:lib:prod",
|
||||
"type": "npm",
|
||||
"dependsOn": [
|
||||
"build-web"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "build-web",
|
||||
"script": "build:web",
|
||||
|
||||
@@ -15,29 +15,28 @@ function Init() as void
|
||||
end function
|
||||
|
||||
function GetPlayletLibUrls() as object
|
||||
savedUrls = GetPlayletLibUrlsFromRegistry()
|
||||
if savedUrls <> invalid
|
||||
m.shouldClearRegistryOnLoadFail = true
|
||||
return savedUrls
|
||||
end if
|
||||
|
||||
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
|
||||
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
|
||||
registry = { type: "registry", link: ReadRegistryKey("playlet_lib_url", "Playlet") }
|
||||
|
||||
#if DEBUG
|
||||
return [embedded]
|
||||
#else
|
||||
return [github, embedded]
|
||||
#end if
|
||||
|
||||
urls = []
|
||||
|
||||
if registry.link <> invalid
|
||||
urls.Push(registry)
|
||||
end if
|
||||
|
||||
urls.push(github)
|
||||
urls.push(embedded)
|
||||
|
||||
return urls
|
||||
end function
|
||||
|
||||
function LoadPlayletLib() as void
|
||||
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
|
||||
m.loadingIndicator.visible = false
|
||||
if m.shouldClearRegistryOnLoadFail = true
|
||||
DeleteRegistryKey("playlet_lib_urls", "Playlet")
|
||||
end if
|
||||
ShowPlayletLibLoadErrorDialog()
|
||||
return
|
||||
end if
|
||||
@@ -64,10 +63,6 @@ function OnLoadStatusChanged() as void
|
||||
|
||||
if m.lib.loadStatus = "failed"
|
||||
?"Playlet lib failed to load from " uri
|
||||
if m.playletLibUrls[m.playletLibUrlIndex].type = "registry"
|
||||
' Delete library url from registry since it failed
|
||||
DeleteRegistryKey("playlet_lib_url", "Playlet")
|
||||
end if
|
||||
' Try next url
|
||||
m.playletLibUrlIndex += 1
|
||||
LoadPlayletLib()
|
||||
|
||||
@@ -11,3 +11,12 @@ function DeleteRegistryKey(key as string, section as string)
|
||||
sec.Delete(key)
|
||||
sec.Flush()
|
||||
end function
|
||||
|
||||
function GetPlayletLibUrlsFromRegistry() as object
|
||||
urlsJson = ReadRegistryKey("playlet_lib_urls", "Playlet")
|
||||
if urlsJson = invalid
|
||||
return invalid
|
||||
end if
|
||||
urls = ParseJson(urlsJson)
|
||||
return urls
|
||||
end function
|
||||
Reference in new issue
Block a user