diff --git a/.vscode/launch.json b/.vscode/launch.json index f9a0524f..f5526c23 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,11 +12,19 @@ "stopDebuggerOnAppExit": false, "rootDir": "${workspaceFolder}/dist/build/playlet", "sourceDirs": [ - "${workspaceFolder}/playlet/src", - "${workspaceFolder}/playlet-lib/src" + "${workspaceFolder}/playlet/src" ], "files": [ - "**/*", + "**/*" + ], + "componentLibraries": [ + { + "rootDir": "${workspaceFolder}/dist/build/playlet-lib", + "outFile": "playlet-lib.zip", + "files": [ + "**/*" + ] + } ], "preLaunchTask": "build-dev", "name": "Playlet (dev)", diff --git a/playlet/src/components/BootstrapScene/BootstrapScene.bs b/playlet/src/components/BootstrapScene/BootstrapScene.bs index 86d6f674..7e00b40c 100644 --- a/playlet/src/components/BootstrapScene/BootstrapScene.bs +++ b/playlet/src/components/BootstrapScene/BootstrapScene.bs @@ -21,12 +21,12 @@ function GetPlayletLibUrls() as object return savedUrls end if - github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") } - embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") } - #if DEBUG - return [embedded] + debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") } + return [debug] #else + github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") } + embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") } return [github, embedded] #end if end function diff --git a/playlet/src/manifest b/playlet/src/manifest index dfcafd9c..bbd978cd 100644 --- a/playlet/src/manifest +++ b/playlet/src/manifest @@ -25,5 +25,6 @@ supports_input_launch=1 playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip playlet_lib_embedded_url=pkg:/lib/playlet-lib.zip +playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8080/playlet-lib.zip bs_const=DEBUG=false;WEB_SERVER_BASIC_AUTH=false;DASH_THUMBNAILS=false;WEB_SOCKETS=true \ No newline at end of file diff --git a/tools/manifest-bsconst-debug-plugin.ts b/tools/manifest-bsconst-debug-plugin.ts index d39a7839..e77e6755 100644 --- a/tools/manifest-bsconst-debug-plugin.ts +++ b/tools/manifest-bsconst-debug-plugin.ts @@ -4,6 +4,7 @@ import { } from 'brighterscript'; import path from 'path'; import fs from 'fs'; +const ip = require('ip'); export class ManifestBsConstDebugPlugin implements CompilerPlugin { public name = 'manifestBsConstDebugPlugin'; @@ -20,6 +21,7 @@ export class ManifestBsConstDebugPlugin implements CompilerPlugin { const manifestPath = path.join(builder.options.rootDir!, "manifest") this.originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' }) let manifestContent = this.originalManifestContent.replace(/DEBUG=(true|false)/i, `DEBUG=${value}`); + manifestContent = manifestContent.replace(/DEBUG_HOST_IP_ADDRESS/i, `${ip.address()}`) fs.writeFileSync(manifestPath, manifestContent) }