@nativescript/windows-v8 0.1.0-alpha.138 → 0.1.0-alpha.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,7 +33,7 @@ namespace __PROJECT_NAME__
|
|
|
33
33
|
private static extern void runtime_set_local_folder([MarshalAs(UnmanagedType.LPUTF8Str)] string localFolder);
|
|
34
34
|
|
|
35
35
|
// Escape hatch for apps packed with `nsbundle_pack --key-hex <hex>` (custom-key
|
|
36
|
-
// app.nsbundle containers). Must be called before runtime_init if used at all
|
|
36
|
+
// app.nsbundle containers). Must be called before runtime_init if used at all: apps
|
|
37
37
|
// packed with the default pepper (no --key-hex) never need to call this. Not wired to a
|
|
38
38
|
// default call site here; an app author supplies their own key material and calls this
|
|
39
39
|
// from Initialize() before runtime_init(...).
|
|
@@ -69,6 +69,18 @@ namespace __PROJECT_NAME__
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
#if DEBUG
|
|
72
|
+
// Engine runtimes (@nativescript/windows-<engine>) only: a debug host always allows
|
|
73
|
+
// dev-server modules (Vite HMR). The classic runtime derives this from its devtools build
|
|
74
|
+
// and doesn't export it.
|
|
75
|
+
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_set_debug_build))]
|
|
76
|
+
private static extern void runtime_set_debug_build(int debug);
|
|
77
|
+
|
|
78
|
+
private static void TrySetDebugBuild()
|
|
79
|
+
{
|
|
80
|
+
try { runtime_set_debug_build(1); }
|
|
81
|
+
catch (EntryPointNotFoundException) { }
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
[DllImport(NativeScriptLibrary, EntryPoint = nameof(ns_set_log_to_console))]
|
|
73
85
|
private static extern int ns_set_log_to_console(int enabled);
|
|
74
86
|
|
|
@@ -154,6 +166,7 @@ namespace __PROJECT_NAME__
|
|
|
154
166
|
runtime_set_local_folder(Windows.Storage.ApplicationData.Current.LocalFolder.Path);
|
|
155
167
|
_runtime = runtime_init(AppContext.BaseDirectory);
|
|
156
168
|
#if DEBUG
|
|
169
|
+
TrySetDebugBuild();
|
|
157
170
|
var trySet = TrySetLogToConsole(true);
|
|
158
171
|
System.Diagnostics.Debug.WriteLine($"[NativeScript] TrySetLogToConsole returned={trySet}");
|
|
159
172
|
|
|
@@ -208,7 +221,7 @@ namespace __PROJECT_NAME__
|
|
|
208
221
|
/// Reads a file that may live inside a sealed app.nsbundle instead of on disk: tries the
|
|
209
222
|
/// protected-VFS native call first (cheap no-op when no bundle is loaded), falls back to
|
|
210
223
|
/// the real filesystem. `path` is whatever candidate the caller already built for
|
|
211
|
-
/// `File.Exists`/`File.ReadAllText
|
|
224
|
+
/// `File.Exists`/`File.ReadAllText`: the native side strips it down to the bundle's
|
|
212
225
|
/// virtual (app/App-relative) path itself, so no extra bookkeeping is needed here.
|
|
213
226
|
private static string TryReadVirtual(string path)
|
|
214
227
|
{
|
|
Binary file
|