More build info
This commit is contained in:
@@ -1,10 +1,32 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
using StringTools;
|
||||
|
||||
#if macro
|
||||
class BuildInfo {
|
||||
public static function printBuildInfo() {
|
||||
var haxeVersion = haxe.macro.Context.definedValue("haxe");
|
||||
Sys.println('[ BUILD INFO ]');
|
||||
Sys.println('Haxe Version: ${haxe.macro.Context.definedValue("haxe")}');
|
||||
Sys.println('Haxe Version: ${haxeVersion}');
|
||||
try {
|
||||
var lastBuiltWith:Null<String> = null;
|
||||
var compiling = #if final "final" #elseif debug "debug" #else "release" #end;
|
||||
var target = #if windows "windows" #elseif mac "macos" #elseif linux "linux" #elseif android "android" #elseif ios "ios" #elseif html5 "html5" #else "" #end;
|
||||
if(target == "") throw "Unknown target";
|
||||
var exportPath = Sys.getCwd() + "/export/" + compiling + "/" + target + "/";
|
||||
exportPath += "obj/Options.txt";
|
||||
|
||||
var options = sys.io.File.getContent(exportPath);
|
||||
for(option in options.split("\n")) {
|
||||
if(option.startsWith("haxe=")) {
|
||||
lastBuiltWith = option.substr(5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(lastBuiltWith != null && lastBuiltWith != haxeVersion)
|
||||
Sys.println('Last Built With Haxe: ${lastBuiltWith} [!!!! MAKE SURE IF YOU SWITCHED VERSIONS YOU DELETE EXPORT FOLDERS !!!!]');
|
||||
} catch(e) {}
|
||||
Sys.println('Target Platform: ${
|
||||
#if windows "Windows"
|
||||
#elseif mac "Mac"
|
||||
|
||||
Reference in New Issue
Block a user