added support for native extensions for Adobe AIR
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package lime.tools.helpers;
|
||||
|
||||
|
||||
import haxe.io.Path;
|
||||
import lime.project.HXProject;
|
||||
import lime.project.Platform;
|
||||
import sys.FileSystem;
|
||||
@@ -163,6 +164,29 @@ class AIRHelper {
|
||||
|
||||
args = args.concat (files);
|
||||
|
||||
var extDirs:Array<String> = [];
|
||||
|
||||
for (dependency in project.dependencies) {
|
||||
|
||||
if (StringTools.endsWith (dependency.path, ".ane") && extDirs.indexOf(dependency.path) == -1) {
|
||||
|
||||
extDirs.push(FileSystem.fullPath(Path.directory(dependency.path)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (extDirs.length > 0) {
|
||||
|
||||
args.push("-extdir");
|
||||
|
||||
for (extDir in extDirs) {
|
||||
|
||||
args.push(extDir);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (targetPlatform == ANDROID) {
|
||||
|
||||
Sys.putEnv ("AIR_NOANDROIDFLAIR", "true");
|
||||
|
||||
@@ -278,6 +278,20 @@ class AIRPlatform extends FlashPlatform {
|
||||
|
||||
if (iconData.length > 0) context.icons = iconData;
|
||||
|
||||
context.extensions = new Array<String>();
|
||||
|
||||
for (dependency in project.dependencies) {
|
||||
|
||||
if (StringTools.endsWith(dependency.path, ".ane")) {
|
||||
|
||||
var extension:Dynamic = { name: dependency.name };
|
||||
context.extensions.push(extension);
|
||||
context.HAXE_FLAGS += "\n-swf-lib " + dependency.path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "haxe", targetDirectory + "/haxe", context);
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "air/hxml", targetDirectory + "/haxe", context);
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "air/template", targetDirectory, context);
|
||||
|
||||
@@ -67,4 +67,7 @@
|
||||
<iPhone>
|
||||
<requestedDisplayResolution>::if WIN_ALLOW_HIGH_DPI::high::else::standard::end::</requestedDisplayResolution>
|
||||
</iPhone>
|
||||
::if (extensions != null)::<extensions>::foreach extensions::
|
||||
<extensionID>::name::</extensionID>::end::
|
||||
</extensions>::end::
|
||||
</application>
|
||||
Reference in New Issue
Block a user