Improve snapshot handling
This commit is contained in:
@@ -118,8 +118,10 @@ git submodule update --init --recursive
|
||||
|
||||
**Generating a v8 snapshot file**
|
||||
```bash
|
||||
# Optional, used in release builds for best performance
|
||||
node armorcore/make -g api --snapshot
|
||||
./Krom . --snapshot
|
||||
# Generates a `krom.bin` file
|
||||
# Generates a `krom.bin` file from `krom.js` file
|
||||
```
|
||||
|
||||
**Generating a locale file**
|
||||
|
||||
+8
-3
@@ -23,15 +23,20 @@ class Main {
|
||||
public static var version = "0.8";
|
||||
public static var sha = BuildMacros.sha().substr(1, 7);
|
||||
public static var date = BuildMacros.date().split(" ")[0];
|
||||
|
||||
static var tasks: Int;
|
||||
|
||||
// Generating snapshot
|
||||
public static function main() {
|
||||
#if arm_snapshot
|
||||
|
||||
js.Syntax.code("globalThis.kickstart = Main.kickstart");
|
||||
|
||||
#else
|
||||
|
||||
kickstart();
|
||||
|
||||
#end
|
||||
}
|
||||
|
||||
// Program startup
|
||||
@:keep
|
||||
public static function kickstart() {
|
||||
// Used to locate external application data folder
|
||||
|
||||
@@ -12,4 +12,10 @@ class BuildMacros {
|
||||
var proc = new sys.io.Process("git", ["log", "--pretty=format:'%h'", "-n", "1"]);
|
||||
return Context.makeExpr(proc.stdout.readLine(), Context.currentPos());
|
||||
}
|
||||
|
||||
macro public static function embed(path: String) {
|
||||
var bytes = sys.io.File.getBytes(path);
|
||||
Context.addResource(path, bytes);
|
||||
return Context.makeExpr("", Context.currentPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ let vulkan = process.argv.indexOf("vulkan") >= 0;
|
||||
let raytrace = d3d12 || vulkan;
|
||||
let metal = process.argv.indexOf("metal") >= 0;
|
||||
let vr = process.argv.indexOf("--vr") >= 0;
|
||||
let snapshot = process.argv.indexOf("--snapshot") >= 0;
|
||||
|
||||
let project = new Project("ArmorPaint");
|
||||
project.addSources("Sources");
|
||||
@@ -86,6 +87,10 @@ if (vr) {
|
||||
project.addAssets("Assets/readme/readme_vr.txt", { notinlist: true, destination: "{name}" });
|
||||
}
|
||||
|
||||
if (snapshot) {
|
||||
project.addDefine("arm_snapshot");
|
||||
}
|
||||
|
||||
project.addAssets("Assets/readme/readme.txt", { notinlist: true, destination: "{name}" });
|
||||
|
||||
if (raytrace) {
|
||||
|
||||
Reference in New Issue
Block a user