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, "stopDebuggerOnAppExit": false,
"rootDir": "${workspaceFolder}/dist/build/playlet", "rootDir": "${workspaceFolder}/dist/build/playlet",
"sourceDirs": [ "sourceDirs": [
"${workspaceFolder}/playlet/src", "${workspaceFolder}/playlet/src"
"${workspaceFolder}/playlet-lib/src"
], ],
"files": [ "files": [
"**/*", "**/*"
],
"componentLibraries": [
{
"rootDir": "${workspaceFolder}/dist/build/playlet-lib",
"outFile": "playlet-lib.zip",
"files": [
"**/*"
]
}
], ],
"preLaunchTask": "build-dev", "preLaunchTask": "build-dev",
"name": "Playlet (dev)", "name": "Playlet (dev)",
@@ -21,12 +21,12 @@ function GetPlayletLibUrls() as object
return savedUrls return savedUrls
end if end if
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
#if DEBUG #if DEBUG
return [embedded] debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") }
return [debug]
#else #else
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
return [github, embedded] return [github, embedded]
#end if #end if
end function 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_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_embedded_url=pkg:/lib/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 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'; } from 'brighterscript';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
const ip = require('ip');
export class ManifestBsConstDebugPlugin implements CompilerPlugin { export class ManifestBsConstDebugPlugin implements CompilerPlugin {
public name = 'manifestBsConstDebugPlugin'; public name = 'manifestBsConstDebugPlugin';
@@ -20,6 +21,7 @@ export class ManifestBsConstDebugPlugin implements CompilerPlugin {
const manifestPath = path.join(builder.options.rootDir!, "manifest") const manifestPath = path.join(builder.options.rootDir!, "manifest")
this.originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' }) this.originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' })
let manifestContent = this.originalManifestContent.replace(/DEBUG=(true|false)/i, `DEBUG=${value}`); 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) fs.writeFileSync(manifestPath, manifestContent)
} }