More build info

This commit is contained in:
Ne_Eo
2024-07-17 20:54:10 +02:00
parent 6075da5220
commit 5fa4a04e18
3 changed files with 36 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
<!-- Lime Building -->
<if cond="build-lime || all">
<print pretty="true">Building Lime...</print>
<print pretty="true">Rebuilding Lime...</print>
<!-- Build lime -->
<cmd inLib="lime" cmd="lime rebuild . $PLATFORM" />
+12 -2
View File
@@ -1,20 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<libraries>
<if cond="time-fix">
<print pretty="true">Switching to branch...</print>
<print pretty="true">Switching to branch 'time-fix'...</print>
<cmd inLib="lime" cmd="git checkout time-fix" />
<cmd inLib="openfl" cmd="git checkout time-fix" />
<cmd inLib="away3d" cmd="git checkout time-fix" />
<cmd inLib="flixel" cmd="git checkout time-fix" />
<cmd inLib="flixel-addons" cmd="git checkout time-fix" />
<print pretty="true">Done!&#10;Make sure to switch the branch on Codename Engine to 'time-fix' before compiling!</print>
</if>
<if cond="normal">
<print pretty="true">Switching to branch...</print>
<print pretty="true">Switching to branch 'dev'...</print>
<cmd inLib="lime" cmd="git checkout develop" />
<cmd inLib="openfl" cmd="git checkout develop" />
<cmd inLib="away3d" cmd="git checkout master" />
<cmd inLib="flixel" cmd="git checkout dev" />
<cmd inLib="flixel-addons" cmd="git checkout dev" />
<print pretty="true">Done!&#10;Make sure to switch the branch on Codename Engine to 'main' before compiling!</print>
</if>
<print pretty="true">Rebuilding Lime...</print>
<cmd inLib="lime" cmd="lime rebuild . $PLATFORM" />
<cmd inLib="lime" >
<line>cd tools</line>
<line>haxe tools.hxml</line>
<line>cd ..</line>s
</cmd>
</libraries>
@@ -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"