Compare commits

..

3 Commits

Author SHA1 Message Date
7d30d9d971 added build doc 2024-08-05 13:59:23 +02:00
29285641a4 removed unused import 2024-08-05 13:54:31 +02:00
37eab6f8e2 debug guard for build info 2024-08-05 13:53:33 +02:00
3 changed files with 23 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ Also peripherals can be made accessible via the network. More on that later.
var back = Peripheral.getRedstone("back"); var back = Peripheral.getRedstone("back");
back.setOutput(true); back.setOutput(true);
var drive Peripheral.getDrive("drive_0"); var drive = Peripheral.getDrive("drive_0");
drive.eject(); drive.eject();
``` ```
@@ -114,7 +114,7 @@ The idea is that you can register all you disposable resources in the handle and
A process can be used as a command on the terminal or as a service. See [bin/HelloWorld.hx](../src/bin/HelloWorld.hx) for an example. A process can be used as a command on the terminal or as a service. See [bin/HelloWorld.hx](../src/bin/HelloWorld.hx) for an example.
Basically everything that runs and is not part of the kernel is a process. Basically everything that runs and is not part of the kernel is a process.
In order for you program to be used it needs to be registered in the `BinStore` and the `DCEHack` manually. ~~In order for you program to be used it needs to be registered in the `BinStore` and the `DCEHack` manually. ~~
# EndOfLoop # EndOfLoop
@@ -208,3 +208,19 @@ rpc.addNumber(3,7).handle((p)->{
} }
}); });
``` ```
# Build system and flags
We use `make` to build the project. If you want a prod build just run `make` and if you want the debug build run `make debug`.
The `build` directory should contain all needed files.
- `bundle.min.lua`: The minified final file
- `bundle.polyfill.lua`: The same as above just not minified. use this when debugging.
- `haxe.lua`: Intermediate file. Polyfill not yet added.
- `haxe.zip`: The compressed `bundle.min.lua`.
- `unpack.*`: Same as the bundle files. Used to unpack and run the `haxe.zip` file.
The follwing haxe flags can be used in the code or can be set in the makefile.
- `debug`: Is set when debug
- `kv_use_native`: If set use the native CC serialize and unserialize functions instead of the Haxe ones. See [KVStore.hx](../src/lib/KVStore.hx) for more.

View File

@@ -6,7 +6,6 @@ import lib.Color;
import lib.MathI; import lib.MathI;
import kernel.log.Log; import kernel.log.Log;
import kernel.ui.WindowContext; import kernel.ui.WindowContext;
import lib.ui.UIApp;
using tink.CoreApi; using tink.CoreApi;

View File

@@ -1,11 +1,13 @@
package kernel; package kernel;
#if debug
import lib.Debug;
#end
import kernel.service.ServiceManager; import kernel.service.ServiceManager;
import kernel.fs.FS; import kernel.fs.FS;
import kernel.gps.GPS; import kernel.gps.GPS;
import kernel.log.Log; import kernel.log.Log;
import kernel.net.Routing; import kernel.net.Routing;
import lib.Debug;
import kernel.ui.WindowManager; import kernel.ui.WindowManager;
import kernel.net.Net; import kernel.net.Net;
@@ -29,7 +31,9 @@ class Init {
KernelEvents.shutdown(); KernelEvents.shutdown();
}); });
#if debug
Debug.printBuildInfo(); Debug.printBuildInfo();
#end
if (!FS.exists("/var/ns")) { if (!FS.exists("/var/ns")) {
FS.makeDir("/var/ns"); FS.makeDir("/var/ns");