Merge branch 'develop' into 8.2.0-Dev
This commit is contained in:
1
dependencies/extension-api/build.gradle
vendored
1
dependencies/extension-api/build.gradle
vendored
@@ -12,6 +12,7 @@ buildscript {
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
namespace 'org.haxe.extension'
|
||||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
||||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
|
||||
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.haxe.extension" >
|
||||
|
||||
</manifest>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
|
||||
|
||||
@@ -458,12 +458,6 @@
|
||||
|
||||
<section if="mac">
|
||||
<vflag name="-install_name" value="@executable_path/lime.hdll" if="LIME_HASHLINK"/>
|
||||
<!--
|
||||
starting in xcode 15, rpath doesn't automatically include
|
||||
/usr/local/lib, but we need it for neko
|
||||
-->
|
||||
<vflag name="-rpath" value="/usr/local/lib" />
|
||||
<vflag name="-rpath" value="/opt/homebrew/lib" if="HXCPP_ARM64"/>
|
||||
|
||||
<vflag name="-l" value="iconv" />
|
||||
<vflag name="-framework" value="IOKit" />
|
||||
|
||||
@@ -165,6 +165,11 @@ class CFFI
|
||||
{
|
||||
result = __tryLoad(ndllFolder + __sysName() + "64/" + library, library, method, args);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = __tryLoad(ndllFolder + __sysName() + "Arm64/" + library, library, method, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ class Clipboard
|
||||
{
|
||||
_text = FlashClipboard.generalClipboard.getData(TEXT_FORMAT);
|
||||
}
|
||||
#elseif (js || html5)
|
||||
_text = cacheText;
|
||||
#end
|
||||
__updated = true;
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ class AndroidHelper
|
||||
{
|
||||
private static var adbName:String;
|
||||
private static var adbPath:String;
|
||||
private static var androidName:String;
|
||||
private static var androidPath:String;
|
||||
private static var emulatorName:String;
|
||||
private static var emulatorPath:String;
|
||||
|
||||
@@ -159,30 +157,33 @@ class AndroidHelper
|
||||
|
||||
public static function initialize(project:HXProject):Void
|
||||
{
|
||||
adbPath = project.environment.get("ANDROID_SDK") + "/tools/";
|
||||
androidPath = project.environment.get("ANDROID_SDK") + "/tools/";
|
||||
emulatorPath = project.environment.get("ANDROID_SDK") + "/tools/";
|
||||
adbPath = project.environment.get("ANDROID_SDK") + "/platform-tools/";
|
||||
emulatorPath = project.environment.get("ANDROID_SDK") + "/emulator/";
|
||||
|
||||
adbName = "adb";
|
||||
androidName = "android";
|
||||
emulatorName = "emulator";
|
||||
|
||||
if (System.hostPlatform == WINDOWS)
|
||||
{
|
||||
adbName += ".exe";
|
||||
androidName += ".bat";
|
||||
emulatorName += ".exe";
|
||||
}
|
||||
|
||||
if (!FileSystem.exists(adbPath + adbName))
|
||||
{
|
||||
adbPath = project.environment.get("ANDROID_SDK") + "/platform-tools/";
|
||||
// in older SDKs, adb was located in /tools/
|
||||
adbPath = project.environment.get("ANDROID_SDK") + "/tools/";
|
||||
}
|
||||
|
||||
if (!FileSystem.exists(emulatorPath + emulatorName))
|
||||
{
|
||||
// in older SDKs, emulator was located in /tools/
|
||||
emulatorPath = project.environment.get("ANDROID_SDK") + "/tools/";
|
||||
}
|
||||
|
||||
if (System.hostPlatform != WINDOWS)
|
||||
{
|
||||
adbName = "./" + adbName;
|
||||
androidName = "./" + androidName;
|
||||
emulatorName = "./" + emulatorName;
|
||||
}
|
||||
|
||||
@@ -194,8 +195,18 @@ class AndroidHelper
|
||||
|
||||
public static function install(project:HXProject, targetPath:String, deviceID:String = null):String
|
||||
{
|
||||
if (!FileSystem.exists(adbPath + adbName))
|
||||
{
|
||||
Log.error("adb not found in Android SDK: " + project.environment.get("ANDROID_SDK"));
|
||||
}
|
||||
|
||||
if (project.targetFlags.exists("emulator") || project.targetFlags.exists("simulator"))
|
||||
{
|
||||
if (!FileSystem.exists(emulatorPath + emulatorName))
|
||||
{
|
||||
Log.error("emulator not found in Android SDK: " + project.environment.get("ANDROID_SDK"));
|
||||
}
|
||||
|
||||
Log.info("", "Searching for Android emulator");
|
||||
|
||||
var devices = listDevices();
|
||||
@@ -280,16 +291,13 @@ class AndroidHelper
|
||||
public static function listAVDs():Array<String>
|
||||
{
|
||||
var avds = new Array<String>();
|
||||
var output = System.runProcess(androidPath, androidName, ["list", "avd"]);
|
||||
|
||||
var output = System.runProcess(emulatorPath, emulatorName, ["-list-avds"]);
|
||||
if (output != null && output != "")
|
||||
{
|
||||
// -list-avds returns only the avd names, separated by line breaks
|
||||
for (line in output.split("\n"))
|
||||
{
|
||||
if (line.indexOf("Name") > -1)
|
||||
{
|
||||
avds.push(StringTools.trim(line.substr(line.indexOf("Name") + 6)));
|
||||
}
|
||||
avds.push(StringTools.trim(line));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +351,11 @@ class AndroidHelper
|
||||
|
||||
public static function trace(project:HXProject, debug:Bool, deviceID:String = null, customFilter:String = null):Void
|
||||
{
|
||||
if (!FileSystem.exists(adbPath + adbName))
|
||||
{
|
||||
Log.error("adb not found in Android SDK: " + project.environment.get("ANDROID_SDK"));
|
||||
}
|
||||
|
||||
// Use -DFULL_LOGCAT or <set name="FULL_LOGCAT" /> if you do not want to filter log messages
|
||||
|
||||
var args = ["logcat"];
|
||||
@@ -395,6 +408,11 @@ class AndroidHelper
|
||||
|
||||
public static function uninstall(packageName:String, deviceID:String = null):Void
|
||||
{
|
||||
if (!FileSystem.exists(adbPath + adbName))
|
||||
{
|
||||
Log.error("adb not found in Android SDK");
|
||||
}
|
||||
|
||||
var args = ["uninstall", packageName];
|
||||
|
||||
if (deviceID != null && deviceID != "")
|
||||
|
||||
@@ -894,7 +894,10 @@ class ProjectXMLParser extends HXProject
|
||||
Log.error(substitute(element.att.value));
|
||||
|
||||
case "echo":
|
||||
if (command != "display")
|
||||
{
|
||||
Log.println(substitute(element.att.value));
|
||||
}
|
||||
|
||||
case "log":
|
||||
var verbose = "";
|
||||
@@ -908,7 +911,9 @@ class ProjectXMLParser extends HXProject
|
||||
{
|
||||
Log.error(substitute(element.att.error), verbose);
|
||||
}
|
||||
else if (element.has.warn)
|
||||
else if (command != "display")
|
||||
{
|
||||
if (element.has.warn)
|
||||
{
|
||||
Log.warn(substitute(element.att.warn), verbose);
|
||||
}
|
||||
@@ -924,6 +929,7 @@ class ProjectXMLParser extends HXProject
|
||||
{
|
||||
Log.info("", verbose);
|
||||
}
|
||||
}
|
||||
|
||||
case "path":
|
||||
var value = "";
|
||||
|
||||
@@ -13,6 +13,7 @@ System.setProperty('java.awt.headless','false')
|
||||
} */
|
||||
|
||||
android {
|
||||
namespace "::APP_PACKAGE::"
|
||||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
||||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
|
||||
::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end::
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="::APP_PACKAGE::" android:versionCode="::APP_BUILD_NUMBER::" android:versionName="::APP_VERSION::" android:installLocation="::ANDROID_INSTALL_LOCATION::">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="::APP_BUILD_NUMBER::" android:versionName="::APP_VERSION::" android:installLocation="::ANDROID_INSTALL_LOCATION::">
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||
|
||||
@@ -12,6 +12,7 @@ buildscript {
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
namespace "org.haxe.extension.::extensionLowerCase::"
|
||||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
||||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
|
||||
}
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.haxe.extension.::extensionLowerCase::" >
|
||||
|
||||
|
||||
|
||||
</manifest>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
|
||||
|
||||
@@ -485,15 +485,14 @@ class CommandLineTools
|
||||
}
|
||||
|
||||
case MAC:
|
||||
// if (System.hostArchitecture == X64) {
|
||||
|
||||
if (System.hostArchitecture == X64)
|
||||
{
|
||||
untyped $loader.path = $array(path + "Mac64/", $loader.path);
|
||||
|
||||
// } else {
|
||||
|
||||
// untyped $loader.path = $array (path + "Mac/", $loader.path);
|
||||
|
||||
// }
|
||||
}
|
||||
else if (System.hostArchitecture == ARM64)
|
||||
{
|
||||
untyped $loader.path = $array(path + "MacArm64/", $loader.path);
|
||||
}
|
||||
|
||||
case LINUX:
|
||||
var arguments = Sys.args();
|
||||
|
||||
@@ -35,7 +35,7 @@ class RunScript
|
||||
|
||||
if (!rebuildBinaries) return;
|
||||
|
||||
var platforms = ["Windows", "Mac", "Mac64", "Linux", "Linux64"];
|
||||
var platforms = ["Windows", "Mac", "Mac64", "MacArm64", "Linux", "Linux64"];
|
||||
|
||||
for (platform in platforms)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ class RunScript
|
||||
System.runCommand(limeDirectory, "neko", args.concat(["windows", toolsDirectory]));
|
||||
}
|
||||
|
||||
case "Mac", "Mac64":
|
||||
case "Mac", "Mac64", "MacArm64":
|
||||
if (System.hostPlatform == MAC)
|
||||
{
|
||||
System.runCommand(limeDirectory, "neko", args.concat(["mac", toolsDirectory]));
|
||||
|
||||
@@ -67,8 +67,14 @@ class SVGExport
|
||||
// }
|
||||
|
||||
case MAC:
|
||||
untyped $loader.path = $array(path + "Mac/", $loader.path);
|
||||
if (System.hostArchitecture == X64)
|
||||
{
|
||||
untyped $loader.path = $array(path + "Mac64/", $loader.path);
|
||||
}
|
||||
else if (System.hostArchitecture == ARM64)
|
||||
{
|
||||
untyped $loader.path = $array(path + "MacArm64/", $loader.path);
|
||||
}
|
||||
|
||||
case LINUX:
|
||||
var arguments = Sys.args();
|
||||
|
||||
@@ -2,6 +2,7 @@ package;
|
||||
|
||||
import haxe.io.Eof;
|
||||
import hxp.Haxelib;
|
||||
import hxp.HostArchitecture;
|
||||
import hxp.HXML;
|
||||
import hxp.Log;
|
||||
import hxp.Path;
|
||||
@@ -190,6 +191,17 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
NekoHelper.createExecutable(project.templatePaths, "mac" + dirSuffix.toLowerCase(), targetDirectory + "/obj/ApplicationMain.n", executablePath);
|
||||
NekoHelper.copyLibraries(project.templatePaths, "mac" + dirSuffix.toLowerCase(), executableDirectory);
|
||||
|
||||
// starting in xcode 15, rpath doesn't automatically include
|
||||
// /usr/local/lib, but we need it for libneko dylib
|
||||
System.runCommand("", "install_name_tool", ["-add_rpath", "/usr/local/lib", Path.join([executableDirectory, "lime.ndll"])]);
|
||||
if (System.hostArchitecture == HostArchitecture.ARM64)
|
||||
{
|
||||
// on Apple Silicon, the user may have installed Neko with
|
||||
// Homebrew, which has a different path. however, if the
|
||||
// Homebrew path doesn't exist, that's okay.
|
||||
System.runCommand("", "install_name_tool", ["-add_rpath", "/opt/homebrew/lib", Path.join([executableDirectory, "lime.ndll"])]);
|
||||
}
|
||||
}
|
||||
else if (targetType == "hl")
|
||||
{
|
||||
@@ -584,7 +596,7 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
private inline function get_dirSuffix():String
|
||||
{
|
||||
return targetArchitecture == X64 ? "64" : "";
|
||||
return targetArchitecture == X64 ? "64" : targetArchitecture == ARM64 ? "Arm64" : "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user