Fix debugger

This commit is contained in:
Brahim Hadriche committed 2023-02-04 11:30:35 -05:00
1 parent 9dcfd20c57
commit 0bd05cdba6
4 files changed
+18 -7

No files matched your search

+11 -3
View File
@@ -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)",
@@ -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
+1
View File
@@ -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
+2
View File
@@ -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)
}