forked from crayfellow/openfl-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNekoHelper.hx
33 lines (18 loc) · 819 Bytes
/
NekoHelper.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package helpers;
import sys.io.File;
class NekoHelper {
public static function copyLibraries (templatePaths:Array <String>, platformName:String, targetPath:String) {
FileHelper.recursiveCopyTemplate (templatePaths, "neko/ndll/" + platformName, targetPath);
}
public static function createExecutable (templatePaths:Array <String>, platformName:String, source:String, target:String):Void {
var executablePath = PathHelper.findTemplate (templatePaths, "neko/bin/neko-" + platformName);
var executable = File.getBytes (executablePath);
var sourceContents = File.getBytes (source);
var output = File.write (target, true);
output.write (executable);
output.write (sourceContents);
output.writeString ("NEKO");
output.writeInt32 (executable.length);
output.close ();
}
}