-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.hxp
More file actions
140 lines (119 loc) · 2.95 KB
/
Copy pathProject.hxp
File metadata and controls
140 lines (119 loc) · 2.95 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package;
import hxp.*;
import lime.tools.*;
import sys.FileSystem;
class Project extends HXProject
{
public function new()
{
super();
setenv('HAXEPATH', './');
setupApplication();
setupPaths();
setupHaxelibs();
setupHaxeDefines();
setupHaxeFlags();
}
public function setupApplication():Void
{
meta.title = 'Funkin\' Converter';
meta.version = '0.1.0';
meta.packageName = 'org.tilnotdrip.funkinconverter';
meta.company = 'TilNotDrip';
meta.companyUrl = 'https://tilnotdrip.org/';
app.file = 'FunkinConverter';
app.main = 'Main';
app.path = 'export/${(debug) ? 'debug' : 'release'}';
window.width = 1280;
window.height = 720;
window.allowHighDPI = true;
}
public function setupPaths():Void
{
addAssetPath('assets', ['exclude']);
sources.push('src');
}
public function setupHaxelibs():Void
{
addHaxelib('lime', 'git');
addHaxelib('openfl', '9.5.0');
addHaxelib('haxeui-core', '1.7.0');
addHaxelib('haxeui-openfl', '1.7.0');
addHaxelib('hxcpp-debug-server', 'git', debug);
addHaxelib('polymod', 'git');
addHaxelib('thx.core', 'git');
addHaxelib('thx.semver', 'git');
}
public function setupHaxeDefines():Void
{
addHaxedef('hscriptPos');
addHaxedef('message.reporting', 'pretty');
addHaxedef('POLYMOD_DEBUG', debug);
addHaxedef("POLYMOD_MOD_ICON_FILE", '_polymod_icon.png');
addHaxedef("POLYMOD_MOD_METADATA_FILE", '_polymod_meta.json');
addHaxedef("POLYMOD_ROOT_PATH", 'scripts/');
addHaxedef("POLYMOD_SCRIPT_EXT", '.hxs');
addHaxedef("POLYMOD_SCRIPT_CLASS_EXT", '.hxc');
addHaxedef("POLYMOD_SCRIPT_LIBRARY", 'default');
}
public function setupHaxeFlags():Void
{
addHaxeFlag('-dce no');
addHaxeMacro("include('funkin.converter', true)");
}
public function addAssetPath(path:String, exclude:Array<String>):Void
{
if (!FileSystem.exists(path))
{
Log.error('Could not find asset path "${path}".');
}
else if (!FileSystem.isDirectory(path))
{
Log.error('Could not parse asset path "${path}", expected a directory.');
}
for (file in FileSystem.readDirectory(path))
{
if (!this.filter(file, ["*"], exclude))
{
continue;
}
if (FileSystem.isDirectory('${path}/${file}'))
{
addAssetPath('${path}/${file}', exclude);
}
else
{
addAsset('${path}/${file}');
}
}
}
public function addAsset(path:String):Void
{
assets.push(new Asset(path, path, null, true, true));
}
public function addHaxelib(name:String, version:String = '', conditions:Bool = true):Void
{
if (conditions)
{
haxelibs.push(new Haxelib(name, version));
}
}
public function addHaxedef(name:String, value:Dynamic = '', conditions:Bool = true):Void
{
if (conditions)
{
haxedefs.set(name, value);
}
}
public function addHaxeFlag(flag:String, conditions:Bool = true):Void
{
if (conditions)
{
haxeflags.push(flag);
}
}
public function addHaxeMacro(value:String, conditions:Bool = true):Void
{
addHaxeFlag('--macro ${value}', conditions);
}
}