Merge branch 'develop' into 8.3.0-Dev

This commit is contained in:
Joseph Cloutier
2024-12-31 16:57:54 -05:00
25 changed files with 510 additions and 78 deletions

View File

@@ -31,6 +31,16 @@ class AssetsMacro
var fields = embedData(":file");
if (fields == null) return null;
for (autoBuild in Context.getLocalClass().get().meta.extract(":autoBuild"))
{
switch (autoBuild.params[0])
{
case macro lime._internal.macros.AssetsMacro.embedByteArray():
return null;
default:
}
}
var superCall = Context.defined("html5") ? macro super(bytes.b.buffer)
: Context.defined("hl") ? macro super(bytes.b, bytes.length)
: macro super(bytes.length, bytes.b);

View File

@@ -61,13 +61,13 @@ class Promise<T>
Whether the `Promise` (and related `Future`) has finished with a completion state.
This will be `false` if the `Promise` has not been resolved with a completion or error state.
**/
public var isComplete(get, null):Bool;
public var isComplete(get, never):Bool;
/**
Whether the `Promise` (and related `Future`) has finished with an error state.
This will be `false` if the `Promise` has not been resolved with a completion or error state.
**/
public var isError(get, null):Bool;
public var isError(get, never):Bool;
#if commonjs
private static function __init__()
@@ -179,12 +179,12 @@ class Promise<T>
}
// Get & Set Methods
@:noCompletion private function get_isComplete():Bool
@:noCompletion private inline function get_isComplete():Bool
{
return future.isComplete;
}
@:noCompletion private function get_isError():Bool
@:noCompletion private inline function get_isError():Bool
{
return future.isError;
}

View File

@@ -201,11 +201,17 @@ class CPPHelper
path = project.config.get("project.rebuild.path");
}
if (path == null || !FileSystem.exists(path))
if (path == null)
{
return;
}
if (!FileSystem.exists(path))
{
Log.warn("Skipping rebuild. Path not found: " + path + "\nIf you are using a release from Haxelib, source code for native binaries may not be bundled. To rebuild, you may need to check out the full repository.");
return;
}
if (buildFile == null && project.config.exists("project.rebuild.file"))
{
buildFile = project.config.get("project.rebuild.file");
@@ -215,6 +221,7 @@ class CPPHelper
if (!FileSystem.exists(Path.combine(path, buildFile)))
{
Log.warn("Skipping rebuild. Path not found: " + path + "\nIf you are using a release from Haxelib, source code for native binaries may not be bundled. To rebuild, you may need to check out the full repository.");
return;
}

View File

@@ -765,7 +765,7 @@ class HXProject extends Script
defines.set("targetType", "cpp");
defines.set("cpp", "1");
}
else if (target == Platform.WINDOWS && targetFlags.exists("mingw"))
else if (target == Platform.WINDOWS && (targetFlags.exists("cpp") || targetFlags.exists("mingw")))
{
defines.set("targetType", "cpp");
defines.set("cpp", "1");
@@ -773,6 +773,8 @@ class HXProject extends Script
}
else
{
targetFlags.set("neko", "1");
defines.set("targetType", "neko");
defines.set("neko", "1");
}

View File

@@ -20,7 +20,7 @@ class HashlinkHelper
case MAC: "Mac";
case WINDOWS: "Windows";
default:
Log.error('Hashlink is not supported on ${project.target} (Supported: Windows, Mac and Linux)');
Log.error('HashLink is not supported on ${project.target} (Supported: Windows, Mac and Linux)');
Sys.exit(1);
"";
};

View File

@@ -324,6 +324,12 @@ class IOSHelper
var currentDeviceID = XCodeHelper.getSimulatorID(project);
if (Log.verbose)
{
var currentSimulatorName = XCodeHelper.getSimulatorName(project);
Log.info("Using iOS simulator: " + currentSimulatorName);
}
try
{
System.runProcess("", "open", ["-Ra", "iOS Simulator"], true, false);
@@ -353,21 +359,44 @@ class IOSHelper
applicationPath = workingDirectory + "/build/" + configuration + "-iphoneos/" + project.app.file + ".app";
}
var templatePaths = [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
].concat(project.templatePaths);
var launcher = System.findTemplate(templatePaths, "bin/ios-deploy");
Sys.command("chmod", ["+x", launcher]);
var xcodeVersion = Std.parseFloat(getXcodeVersion());
if (!Math.isNaN(xcodeVersion) && xcodeVersion >= 16) {
// ios-deploy doesn't work with newer iOS SDKs where it can't
// find DeveloperDiskImage.dmg. however, Xcode 16 adds new
// commands for installing and launching apps on connected
// devices, so we'll prefer those, if available.
var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]);
var deviceUUID:String = null;
var ready = false;
for (line in listDevicesOutput.split("\n")) {
if (!ready) {
ready = StringTools.startsWith(line, "----");
continue;
}
deviceUUID = line;
break;
}
if (deviceUUID == null || deviceUUID.length == 0) {
Log.error("No device connected");
return;
}
System.runCommand("", "xcrun", ["devicectl", "device", "install", "app", "--device", deviceUUID, FileSystem.fullPath(applicationPath)]);
System.runCommand("", "xcrun", ["devicectl", "device", "process", "launch", "--console", "--device", deviceUUID, project.meta.packageName]);
} else {
var templatePaths = [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
].concat(project.templatePaths);
var launcher = System.findTemplate(templatePaths, "bin/ios-deploy");
Sys.command("chmod", ["+x", launcher]);
// var xcodeVersion = getXcodeVersion ();
System.runCommand("", launcher, [
"install",
"--noninteractive",
"--debug",
"--bundle",
FileSystem.fullPath(applicationPath)
]);
System.runCommand("", launcher, [
"install",
"--noninteractive",
"--debug",
"--bundle",
FileSystem.fullPath(applicationPath)
]);
}
}
}

View File

@@ -1738,6 +1738,9 @@ class ProjectXMLParser extends HXProject
case "gradle-version":
config.set("android.gradle-version", value);
case "gradle-plugin":
config.set("android.gradle-plugin", value);
default:
name = formatAttributeName(attribute);

View File

@@ -60,7 +60,11 @@ class XCodeHelper
{
if (StringTools.startsWith(line, "--"))
{
if (line.indexOf("iOS") > -1)
if (line.indexOf("Unavailable") > -1)
{
foundSection = false;
}
else if (line.indexOf("iOS") > -1)
{
foundSection = true;
}