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": [
|
"files": [
|
||||||
"**/*",
|
"**/*",
|
||||||
],
|
],
|
||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build-dev",
|
||||||
"name": "Playlet (dev)",
|
"name": "Playlet (dev)",
|
||||||
"injectRdbOnDeviceComponent": true,
|
"injectRdbOnDeviceComponent": true,
|
||||||
"injectRaleTrackerTask": true,
|
"injectRaleTrackerTask": true,
|
||||||
"raleTrackerTaskFileLocation": "${workspaceFolder}/tools/RALE/TrackerTask.xml"
|
"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",
|
"command": "npm run dev:web",
|
||||||
"name": "Playlet Web (Dev)",
|
"name": "Playlet Web (Dev)",
|
||||||
|
|||||||
Vendored
+27
-5
@@ -2,27 +2,49 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "build",
|
"label": "build-dev",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build-app"
|
"build-app-dev"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "build-app",
|
"label": "build-app-dev",
|
||||||
"script": "build:app:dev",
|
"script": "build:app:dev",
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build-lib"
|
"build-lib-dev"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "build-lib",
|
"label": "build-lib-dev",
|
||||||
"script": "build:lib:dev",
|
"script": "build:lib:dev",
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build-web"
|
"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",
|
"label": "build-web",
|
||||||
"script": "build:web",
|
"script": "build:web",
|
||||||
|
|||||||
@@ -15,29 +15,28 @@ function Init() as void
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function GetPlayletLibUrls() as object
|
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") }
|
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
|
||||||
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
|
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
|
||||||
registry = { type: "registry", link: ReadRegistryKey("playlet_lib_url", "Playlet") }
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
return [embedded]
|
return [embedded]
|
||||||
|
#else
|
||||||
|
return [github, embedded]
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
urls = []
|
|
||||||
|
|
||||||
if registry.link <> invalid
|
|
||||||
urls.Push(registry)
|
|
||||||
end if
|
|
||||||
|
|
||||||
urls.push(github)
|
|
||||||
urls.push(embedded)
|
|
||||||
|
|
||||||
return urls
|
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function LoadPlayletLib() as void
|
function LoadPlayletLib() as void
|
||||||
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
|
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
|
||||||
m.loadingIndicator.visible = false
|
m.loadingIndicator.visible = false
|
||||||
|
if m.shouldClearRegistryOnLoadFail = true
|
||||||
|
DeleteRegistryKey("playlet_lib_urls", "Playlet")
|
||||||
|
end if
|
||||||
ShowPlayletLibLoadErrorDialog()
|
ShowPlayletLibLoadErrorDialog()
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
@@ -64,10 +63,6 @@ function OnLoadStatusChanged() as void
|
|||||||
|
|
||||||
if m.lib.loadStatus = "failed"
|
if m.lib.loadStatus = "failed"
|
||||||
?"Playlet lib failed to load from " uri
|
?"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
|
' Try next url
|
||||||
m.playletLibUrlIndex += 1
|
m.playletLibUrlIndex += 1
|
||||||
LoadPlayletLib()
|
LoadPlayletLib()
|
||||||
|
|||||||
@@ -11,3 +11,12 @@ function DeleteRegistryKey(key as string, section as string)
|
|||||||
sec.Delete(key)
|
sec.Delete(key)
|
||||||
sec.Flush()
|
sec.Flush()
|
||||||
end function
|
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