Skip to content

Commit e58c91d

Browse files
committed
Update dab-config
1 parent 0f343db commit e58c91d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

res/classpath/src/ClassPathMacro.hx

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ class ClassPathMacro {
1212
Sys.println('[OUT]: ${Compiler.getOutput()}');
1313

1414
var ownPath = FileSystem.fullPath(Path.join([Context.resolvePath("ClassPathMacro.hx"), '..']));
15+
var fullPath = Context.defined('fullpath');
1516

16-
for (cp in haxe.macro.Context.getClassPath()) {
17+
for (cp in Context.getClassPath()) {
1718
if (cp == "") continue;
1819
if (FileSystem.fullPath(cp) == ownPath) continue;
20+
if (fullPath) cp = FileSystem.fullPath(cp);
1921
Sys.println('[CLASSPATH]: $cp');
2022
}
2123

22-
haxe.macro.Context.fatalError('Compilation aborted', haxe.macro.Context.currentPos());
24+
Context.fatalError('Compilation aborted', Context.currentPos());
2325
}
2426

2527
static function first(defines:Iterator<String>, targets:Array<String>) {

src/HaxeClasspath.hx

+9-4
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,24 @@ class HaxeClasspath {
3232

3333
static var stdRoot = FileSystem.fullPath(Path.join([Sys.getCwd(), "current", "std"]));
3434

35-
static function getClasspath(?hxml:String = "build.hxml"):ClasspathResult {
35+
static function getClasspath(?hxml:String = "build.hxml", ?fullpath:Bool = false):ClasspathResult {
3636
final cwd = Utils.getCallSite();
3737
hxml = Path.isAbsolute(hxml) ? hxml : Path.join([cwd, hxml]);
3838
if (!FileSystem.exists(hxml)) throw 'Cannot find hxml file $hxml';
3939

4040
Sys.putEnv("HAXE_STD_PATH", stdRoot);
41-
final proc = new Process("haxe", [
41+
final args = [
4242
"--cwd", cwd,
4343
hxml,
4444
"-cp", FileSystem.absolutePath("res/classpath/src"),
4545
"--macro", "ClassPathMacro.run()",
4646
"--no-output"
47-
]);
47+
];
48+
if (fullpath) {
49+
args.push("-D");
50+
args.push("fullpath");
51+
}
52+
final proc = new Process("haxe", args);
4853

4954
try {
5055
final code = proc.exitCode();
@@ -107,7 +112,7 @@ class HaxeClasspath {
107112

108113
public static function getDapConfig(?hxml:String = "build.hxml"):Void {
109114
try {
110-
var data = getClasspath(hxml);
115+
var data = getClasspath(hxml, true);
111116
Sys.println([
112117
'{',
113118
' name="HashLink",',

0 commit comments

Comments
 (0)