Merge branch 'develop' into 8.2.0-Dev

This commit is contained in:
Joseph Cloutier
2024-01-18 13:23:51 -05:00
2 changed files with 269 additions and 407 deletions

View File

@@ -52,31 +52,39 @@ class PlatformTarget
this.additionalArguments = additionalArguments;
var metaFields = Meta.getFields(Type.getClass(this));
if (/*!Reflect.hasField (metaFields.watch, "ignore") && */ (project.targetFlags.exists("watch")))
// known issue: this may not log in `-eval` mode on Linux
inline function logCommand(command:String):Void
{
if (!Reflect.hasField(metaFields, command)
|| !Reflect.hasField(Reflect.field(metaFields, command), "ignore"))
{
Log.info("", "\n" + Log.accentColor + "Running command: " + command.toUpperCase() + Log.resetColor);
}
}
if (project.targetFlags.exists("watch"))
{
Log.info("", "\n" + Log.accentColor + "Running command: WATCH" + Log.resetColor);
watch();
return;
}
if ((!Reflect.hasField(metaFields, "display") || !Reflect.hasField(metaFields.display, "ignore")) && (command == "display"))
if (command == "display")
{
display();
}
// if (!Reflect.hasField (metaFields.clean, "ignore") && (command == "clean" || targetFlags.exists ("clean"))) {
if ((!Reflect.hasField(metaFields, "clean") || !Reflect.hasField(metaFields.clean, "ignore"))
&& (command == "clean"
|| (project.targetFlags.exists("clean") && (command == "update" || command == "build" || command == "test"))))
// if (command == "clean" || project.targetFlags.exists ("clean")) {
if (command == "clean"
|| (project.targetFlags.exists("clean") && (command == "update" || command == "build" || command == "test")))
{
Log.info("", Log.accentColor + "Running command: CLEAN" + Log.resetColor);
logCommand("CLEAN");
clean();
}
if ((!Reflect.hasField(metaFields, "rebuild") || !Reflect.hasField(metaFields.rebuild, "ignore"))
&& (command == "rebuild" || project.targetFlags.exists("rebuild")))
if (command == "rebuild" || project.targetFlags.exists("rebuild"))
{
Log.info("", "\n" + Log.accentColor + "Running command: REBUILD" + Log.resetColor);
logCommand("REBUILD");
// hack for now, need to move away from project.rebuild.path, probably
@@ -88,60 +96,53 @@ class PlatformTarget
rebuild();
}
if ((!Reflect.hasField(metaFields, "update") || !Reflect.hasField(metaFields.update, "ignore"))
&& (command == "update" || command == "build" || command == "test"))
if (command == "update" || command == "build" || command == "test")
{
Log.info("", "\n" + Log.accentColor + "Running command: UPDATE" + Log.resetColor);
logCommand("update");
// #if lime
// AssetHelper.processLibraries (project, targetDirectory);
// #end
update();
}
if ((!Reflect.hasField(metaFields, "build") || !Reflect.hasField(metaFields.build, "ignore"))
&& (command == "build" || command == "test"))
if (command == "build" || command == "test")
{
CommandHelper.executeCommands(project.preBuildCallbacks);
Log.info("", "\n" + Log.accentColor + "Running command: BUILD" + Log.resetColor);
logCommand("build");
build();
CommandHelper.executeCommands(project.postBuildCallbacks);
}
if ((!Reflect.hasField(metaFields, "deploy") || !Reflect.hasField(metaFields.deploy, "ignore")) && (command == "deploy"))
if (command == "deploy")
{
Log.info("", "\n" + Log.accentColor + "Running command: DEPLOY" + Log.resetColor);
logCommand("deploy");
deploy();
}
if ((!Reflect.hasField(metaFields, "install") || !Reflect.hasField(metaFields.install, "ignore"))
&& (command == "install" || command == "run" || command == "test"))
if (command == "install" || command == "run" || command == "test")
{
Log.info("", "\n" + Log.accentColor + "Running command: INSTALL" + Log.resetColor);
logCommand("install");
install();
}
if ((!Reflect.hasField(metaFields, "run") || !Reflect.hasField(metaFields.run, "ignore"))
&& (command == "run" || command == "rerun" || command == "test"))
if (command == "run" || command == "rerun" || command == "test")
{
Log.info("", "\n" + Log.accentColor + "Running command: RUN" + Log.resetColor);
logCommand("run");
run();
}
if ((!Reflect.hasField(metaFields, "trace") || !Reflect.hasField(metaFields.trace, "ignore"))
&& (command == "test" || command == "trace" || command == "run" || command == "rerun"))
if ((command == "test" || command == "trace" || command == "run" || command == "rerun")
&& (traceEnabled || command == "trace"))
{
if (traceEnabled || command == "trace")
{
Log.info("", "\n" + Log.accentColor + "Running command: TRACE" + Log.resetColor);
this.trace();
}
logCommand("trace");
this.trace();
}
if ((!Reflect.hasField(metaFields, "uninstall") || !Reflect.hasField(metaFields.uninstall, "ignore")) && (command == "uninstall"))
if (command == "uninstall")
{
Log.info("", "\n" + Log.accentColor + "Running command: UNINSTALL" + Log.resetColor);
logCommand("UNINSTALL");
uninstall();
}
}