Merge branch 'develop' into 8.3.0-Dev

This commit is contained in:
Chris Speciale
2025-03-14 05:30:43 -04:00
4 changed files with 70 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
<files id="native-toolkit-mbedtls">
<compilerflag value="-std=c11" />
<compilerflag value="-std=c11" unless="isMsvc" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/mbedtls/include/" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/zlib/" />
<file name="${NATIVE_TOOLKIT_PATH}/mbedtls/library/aes.c" />

View File

@@ -1052,6 +1052,10 @@ namespace lime {
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
index = FT_Get_Char_Index ((FT_Face)face, character);
val_array_push (indices, alloc_int (index));
@@ -1064,22 +1068,30 @@ namespace lime {
unsigned long character;
int index;
int count = 0;
// TODO: Determine array size first
const char* characters_start = characters;
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
count++;
}
hl_varray* indices = (hl_varray*)hl_alloc_array (&hlt_i32, count);
int* indicesData = hl_aptr (indices, int);
characters = characters_start;
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
*indicesData++ = FT_Get_Char_Index ((FT_Face)face, character);
}

View File

@@ -280,14 +280,20 @@ namespace lime {
void lime_hb_buffer_add_utf8 (value buffer, HxString text, int itemOffset, int itemLength) {
hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), text.c_str (), text.length, itemOffset, itemLength);
int textLength = text.length;
if (hxs_encoding (text) == hx::StringUtf16) {
// hxs_utf8 doesn't give us the length, so treat it as null terminated
textLength = -1;
}
hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), hxs_utf8 (text, nullptr), textLength, itemOffset, itemLength);
}
HL_PRIM void HL_NAME(hl_hb_buffer_add_utf8) (HL_CFFIPointer* buffer, hl_vstring* text, int itemOffset, int itemLength) {
hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, text ? text->length : 0, itemOffset, itemLength);
hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, -1, itemOffset, itemLength);
}

View File

@@ -365,8 +365,10 @@ class IOSHelper
// 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;
// prefer an iOS device with State == 'connected'
// Note: Platform == 'iOS' includes iPadOS
var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]);
var ready = false;
for (line in listDevicesOutput.split("\n")) {
if (!ready) {
@@ -377,29 +379,59 @@ class IOSHelper
break;
}
if (deviceUUID == null || deviceUUID.length == 0) {
Log.error("No device connected");
// preferred fallback is an iOS device that is both
// available and wired
var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'available (paired)' AND connectionProperties.transportType == 'wired'"]);
ready = false;
for (line in listDevicesOutput.split("\n")) {
if (!ready) {
ready = StringTools.startsWith(line, "----");
continue;
}
deviceUUID = line;
break;
}
}
if (deviceUUID == null || deviceUUID.length == 0) {
// devices running iOS 16 and older don't support
// xcrun devicectl, so if no device was found, try falling
// back to ios-deploy
fallbackLaunch(project, applicationPath);
// Log.error("No device connected");
return;
}
if (Log.verbose)
{
Log.info("Detected iOS device UUID: " + deviceUUID);
}
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]);
System.runCommand("", launcher, [
"install",
"--noninteractive",
"--debug",
"--bundle",
FileSystem.fullPath(applicationPath)
]);
// continue using ios-deploy if Xcode version is 15 or older
fallbackLaunch(project, applicationPath);
}
}
}
private static function fallbackLaunch(project:HXProject, applicationPath:String):Void
{
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]);
System.runCommand("", launcher, [
"install",
"--noninteractive",
"--debug",
"--bundle",
FileSystem.fullPath(applicationPath)
]);
}
public static function sign(project:HXProject, workingDirectory:String):Void
{
initialize(project);