|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright (C)2005-2016 Haxe Foundation
|
|
|
|
|
|
+ * Copyright (C)2005-2017 Haxe Foundation
|
|
*
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
@@ -23,11 +23,20 @@ import haxe.macro.Context;
|
|
|
|
|
|
class ImportAll {
|
|
class ImportAll {
|
|
|
|
|
|
|
|
+ static function isSysTarget() {
|
|
|
|
+ return Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ||
|
|
|
|
+ Context.defined("java") || Context.defined("python") ||
|
|
|
|
+ Context.defined("lua") || Context.defined("hl") || Context.defined("eval"); // TODO: have to add cs here, SPOD gets in the way at the moment
|
|
|
|
+ }
|
|
|
|
+
|
|
public static function run( ?pack ) {
|
|
public static function run( ?pack ) {
|
|
if( pack == null ) {
|
|
if( pack == null ) {
|
|
pack = "";
|
|
pack = "";
|
|
haxe.macro.Compiler.define("doc_gen");
|
|
haxe.macro.Compiler.define("doc_gen");
|
|
}
|
|
}
|
|
|
|
+ if (Context.defined("interp")) {
|
|
|
|
+ haxe.macro.Compiler.define("macro");
|
|
|
|
+ }
|
|
switch( pack ) {
|
|
switch( pack ) {
|
|
case "php":
|
|
case "php":
|
|
if( !Context.defined("php") ) return;
|
|
if( !Context.defined("php") ) return;
|
|
@@ -39,8 +48,10 @@ class ImportAll {
|
|
if( !Context.defined("cpp") ) return;
|
|
if( !Context.defined("cpp") ) return;
|
|
case "flash":
|
|
case "flash":
|
|
if( !Context.defined("flash9") ) return;
|
|
if( !Context.defined("flash9") ) return;
|
|
|
|
+ case "mt","mtwin":
|
|
|
|
+ return;
|
|
case "sys":
|
|
case "sys":
|
|
- if( !Context.defined("neko") && !Context.defined("php") && !Context.defined("cpp") ) return;
|
|
|
|
|
|
+ if(!isSysTarget()) return;
|
|
case "java":
|
|
case "java":
|
|
if( !Context.defined("java") ) return;
|
|
if( !Context.defined("java") ) return;
|
|
case "cs":
|
|
case "cs":
|
|
@@ -53,10 +64,9 @@ class ImportAll {
|
|
if( !Context.defined("lua") ) return;
|
|
if( !Context.defined("lua") ) return;
|
|
case "eval":
|
|
case "eval":
|
|
if( !Context.defined("eval") ) return;
|
|
if( !Context.defined("eval") ) return;
|
|
- case "tools":
|
|
|
|
- return;
|
|
|
|
- case "build-tool":
|
|
|
|
- return;
|
|
|
|
|
|
+ case "ssl":
|
|
|
|
+ if (!Context.defined("neko") && !Context.defined("cpp")) return;
|
|
|
|
+ case "tools", "build-tool": return;
|
|
}
|
|
}
|
|
for( p in Context.getClassPath() ) {
|
|
for( p in Context.getClassPath() ) {
|
|
if( p == "/" )
|
|
if( p == "/" )
|
|
@@ -78,12 +88,13 @@ class ImportAll {
|
|
switch( cl ) {
|
|
switch( cl ) {
|
|
case "ImportAll", "neko.db.MacroManager": continue;
|
|
case "ImportAll", "neko.db.MacroManager": continue;
|
|
case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;
|
|
case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;
|
|
- case "Sys": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;
|
|
|
|
|
|
+ case "Sys": if(!isSysTarget()) continue;
|
|
case "haxe.web.Request": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("js")) ) continue;
|
|
case "haxe.web.Request": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("js")) ) continue;
|
|
- case "haxe.macro.ExampleJSGenerator","haxe.macro.Context", "haxe.macro.Compiler": if( !Context.defined("neko") ) continue;
|
|
|
|
|
|
+ case "haxe.macro.ExampleJSGenerator","haxe.macro.Context", "haxe.macro.Compiler": if( !Context.defined("eval") ) continue;
|
|
case "haxe.remoting.SocketWrapper": if( !Context.defined("flash") ) continue;
|
|
case "haxe.remoting.SocketWrapper": if( !Context.defined("flash") ) continue;
|
|
case "haxe.remoting.SyncSocketConnection": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;
|
|
case "haxe.remoting.SyncSocketConnection": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;
|
|
- case "sys.db.Sqlite" | "sys.db.Mysql" | "cs.db.AdoNet": continue;
|
|
|
|
|
|
+ case "neko.vm.Ui" | "sys.db.Sqlite" | "sys.db.Mysql" if ( Context.defined("interp") ): continue;
|
|
|
|
+ case "sys.db.Sqlite" | "sys.db.Mysql" | "cs.db.AdoNet" if ( Context.defined("cs") ): continue;
|
|
}
|
|
}
|
|
Context.getModule(cl);
|
|
Context.getModule(cl);
|
|
} else if( sys.FileSystem.isDirectory(p + "/" + file) )
|
|
} else if( sys.FileSystem.isDirectory(p + "/" + file) )
|