diff --git a/lime/project/HXProject.hx b/lime/project/HXProject.hx index 9e4ba8381..fe54b1afb 100644 --- a/lime/project/HXProject.hx +++ b/lime/project/HXProject.hx @@ -138,7 +138,7 @@ class HXProject { defaultWindow.height = 0; defaultWindow.fps = 60; - case ANDROID, BLACKBERRY, IOS, TIZEN, WEBOS: + case ANDROID, BLACKBERRY, IOS, TIZEN, WEBOS, TVOS: platformType = PlatformType.MOBILE; @@ -158,6 +158,8 @@ class HXProject { } + } else if (target == Platform.TVOS) { + architectures = [ Architecture.ARM64 ]; } else { architectures = [ Architecture.ARMV6 ]; diff --git a/lime/project/Platform.hx b/lime/project/Platform.hx index 1fae49ac0..48ee6172f 100644 --- a/lime/project/Platform.hx +++ b/lime/project/Platform.hx @@ -21,6 +21,7 @@ package lime.project; var WIIU = "wiiu"; var XBOX1 = "xbox1"; var EMSCRIPTEN = "emscripten"; + var TVOS = "tvos"; var CUSTOM = null; } diff --git a/templates/compatibility/DefaultAssetLibrary.hx b/templates/compatibility/DefaultAssetLibrary.hx index 5553ae9c6..bb2961f5e 100644 --- a/templates/compatibility/DefaultAssetLibrary.hx +++ b/templates/compatibility/DefaultAssetLibrary.hx @@ -23,7 +23,7 @@ import openfl.net.URLLoader; import sys.FileSystem; #end -#if ios +#if (ios || tvos) import openfl.utils.SystemPath; #end @@ -305,7 +305,7 @@ class DefaultAssetLibrary extends AssetLibrary { public override function getPath (id:String):String { - #if ios + #if (ios || tvos) return SystemPath.applicationDirectory + "/assets/" + path.get (id); diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index d2e9f8c20..c18295306 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -689,7 +689,7 @@ class DefaultAssetLibrary extends AssetLibrary { var bytes = ByteArray.readFile ("assets/manifest"); #elseif (mac && java) var bytes = ByteArray.readFile ("../Resources/manifest"); - #elseif ios + #elseif (ios || tvos) var bytes = ByteArray.readFile ("assets/manifest"); #else var bytes = ByteArray.readFile ("manifest"); @@ -821,7 +821,7 @@ class DefaultAssetLibrary extends AssetLibrary { #else -::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }} +::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if (ios || tvos) "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }} ::end::::end::::end::::end:: #if (windows || mac || linux || cpp) @@ -839,7 +839,7 @@ class DefaultAssetLibrary extends AssetLibrary { #end #if (openfl && !flash) -::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::";::end:: super (); }} +::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = #if (ios || tvos) "assets/" + #end "::targetPath::"; name = "::fontName::";::end:: super (); }} ::end::::end::::end:: #end diff --git a/templates/tvos/PROJ/haxe/Build.hxml b/templates/tvos/PROJ/haxe/Build.hxml index 7629a5804..b1dfaa605 100644 --- a/templates/tvos/PROJ/haxe/Build.hxml +++ b/templates/tvos/PROJ/haxe/Build.hxml @@ -1,5 +1,4 @@ -main ApplicationMain ::HAXE_FLAGS:: --D iphone --D ios +-D tvos --macro keep("::APP_MAIN::") -D no-compilation \ No newline at end of file diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index f95182e27..bbc3bf29a 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -48,35 +48,35 @@ LIB_DEST := $(DEBUG)/libApplicationMain.a build-haxe-i386: @echo "Haxe simulator build: $(CONFIG)" haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG) - cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` + cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim.a ../lib/i386$(LIB_DEST) touch ../Classes/Main.mm build-haxe-x86_64: @echo "Haxe simulator build: $(CONFIG)-64" haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_M64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` + cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -Dsimulator -DHXCPP_M64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim-64.a ../lib/x86_64$(LIB_DEST) touch ../Classes/Main.mm build-haxe-armv6: @echo "Haxe device build: $(CONFIG)" haxe Build.hxml -D HXCPP_ARMV6 -cpp build/$(CONFIG) $(DEBUG) - cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` + cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos.a ../lib/armv6$(LIB_DEST) touch ../Classes/Main.mm build-haxe-armv7: @echo "Haxe device build: $(CONFIG)-v7" haxe Build.hxml -D HXCPP_ARMV7 -cpp build/$(CONFIG)-v7 $(DEBUG) - cd build/$(CONFIG)-v7; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` + cd build/$(CONFIG)-v7; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` cp build/$(CONFIG)-v7/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-v7.a ../lib/armv7$(LIB_DEST) touch ../Classes/Main.mm build-haxe-arm64: @echo "Haxe device build: $(CONFIG)-64" haxe Build.hxml -D HXCPP_ARM64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARM64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` + cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARM64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done` cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-64.a ../lib/arm64$(LIB_DEST) touch ../Classes/Main.mm diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index be60b35da..6bff1468d 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -582,6 +582,10 @@ class CommandLineTools { platform = new EmscriptenPlatform (command, project, targetFlags); + case TVOS: + + platform = new IOSPlatform (command, project, targetFlags); + default: } @@ -746,6 +750,7 @@ class CommandLineTools { LogHelper.println (" \x1b[1mlinux\x1b[0m -- Create a Linux application"); LogHelper.println (" \x1b[1mmac\x1b[0m -- Create a Mac OS X application"); LogHelper.println (" \x1b[1mtizen\x1b[0m -- Create a Tizen application"); + LogHelper.println (" \x1b[1mtvos\x1b[0m -- Create a tvOS application"); LogHelper.println (" \x1b[1mwebos\x1b[0m -- Create a webOS application"); LogHelper.println (" \x1b[1mwindows\x1b[0m -- Create a Windows application"); LogHelper.println (""); diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 0fbe6d743..4ad256e7b 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -475,6 +475,14 @@ class PlatformSetup { setupOpenFL (); + case "tvos": + + if (PlatformHelper.hostPlatform == Platform.MAC) { + + setupMac (); + + } + case "": switch (CommandLineTools.defaultLibrary) {