Minor cleanup

This commit is contained in:
Joshua Granick
2016-07-22 08:28:00 -07:00
parent c94f3258c3
commit 2ec8a818f0
17 changed files with 195 additions and 160 deletions

View File

@@ -502,8 +502,6 @@ class Cairo {
}
// Get & Set Methods

View File

@@ -333,7 +333,7 @@ class ImageDataUtil {
var format = image.buffer.format;
var premultiplied = image.buffer.premultiplied;
if (premultiplied) fillColor.multiplyAlpha();
if (premultiplied) fillColor.multiplyAlpha ();
var dataView = new ImageDataView (image, rect);
var row;

View File

@@ -1294,5 +1294,5 @@ class HXProject {
}
}
}

View File

@@ -41,6 +41,6 @@ class AntHelper {
ProcessHelper.runCommand (workingDirectory, ant, commands);
}
}
}

View File

@@ -133,5 +133,5 @@ class AssetHelper {
}
}

View File

@@ -434,8 +434,8 @@ class BlackBerryHelper {
ProcessHelper.runCommand (workingDirectory, exe, [ "-getFile", "logs/log", "-", "-device", deviceIP, "-password", devicePassword, targetPath ] );
}
}

View File

@@ -475,5 +475,5 @@ class FileHelper {
}
}
}

View File

@@ -324,5 +324,5 @@ class IOSHelper {
}
}
}

View File

@@ -12,6 +12,6 @@ class JavaHelper {
FileHelper.recursiveCopyTemplate (templatePaths, "java/ndll/" + platformName, targetPath);
}
}
}

View File

@@ -101,6 +101,6 @@ class PlatformHelper {
return _hostPlatform;
}
}
}

View File

@@ -271,6 +271,6 @@ class StringHelper {
return string + "\n" + StringTools.lpad ("", character, string.length);
}
}

View File

@@ -57,6 +57,84 @@ class TVOSHelper {
}
private static function getIOSVersion (project:HXProject):Void {
if (!project.environment.exists("TVOS_VER")) {
if (!project.environment.exists("DEVELOPER_DIR")) {
var proc = new Process ("xcode-select", ["--print-path"]);
var developer_dir = proc.stdout.readLine ();
proc.close ();
project.environment.set ("DEVELOPER_DIR", developer_dir);
}
var dev_path = project.environment.get ("DEVELOPER_DIR") + "/Platforms/AppleTVOS.platform/Developer/SDKs";
if (FileSystem.exists (dev_path)) {
var best = "";
var files = FileSystem.readDirectory (dev_path);
var extract_version = ~/^AppleTVOS(.*).sdk$/;
for (file in files) {
if (extract_version.match (file)) {
var ver = extract_version.matched (1);
if (ver > best) {
best = ver;
}
}
}
if (best != "") {
project.environment.set ("TVOS_VER", best);
}
}
}
}
private static function getOSXVersion ():String {
var output = ProcessHelper.runProcess ("", "sw_vers", [ "-productVersion" ]);
return StringTools.trim (output);
}
public static function getProvisioningFile ():String {
var path = PathHelper.expand ("~/Library/MobileDevice/Provisioning Profiles");
var files = FileSystem.readDirectory (path);
for (file in files) {
if (Path.extension (file) == "mobileprovision") {
return path + "/" + file;
}
}
return "";
}
public static function getSDKDirectory (project:HXProject):String {
initialize (project);
@@ -86,67 +164,6 @@ class TVOSHelper {
}
private static function getIOSVersion (project:HXProject):Void {
if (!project.environment.exists("TVOS_VER")) {
if (!project.environment.exists("DEVELOPER_DIR")) {
var proc = new Process("xcode-select", ["--print-path"]);
var developer_dir = proc.stdout.readLine();
proc.close();
project.environment.set("DEVELOPER_DIR", developer_dir);
}
var dev_path = project.environment.get("DEVELOPER_DIR") + "/Platforms/AppleTVOS.platform/Developer/SDKs";
if (FileSystem.exists (dev_path)) {
var best = "";
var files = FileSystem.readDirectory (dev_path);
var extract_version = ~/^AppleTVOS(.*).sdk$/;
for (file in files) {
if (extract_version.match (file)) {
var ver = extract_version.matched (1);
if (ver > best)
best = ver;
}
}
if (best != "")
project.environment.set ("TVOS_VER", best);
}
}
}
private static function getOSXVersion ():String {
var output = ProcessHelper.runProcess ("", "sw_vers", [ "-productVersion" ]);
return StringTools.trim (output);
}
public static function getProvisioningFile ():String {
var path = PathHelper.expand ("~/Library/MobileDevice/Provisioning Profiles");
var files = FileSystem.readDirectory (path);
for (file in files) {
if (Path.extension (file) == "mobileprovision") {
return path + "/" + file;
}
}
return "";
}
private static function getXcodeVersion ():String {
var output = ProcessHelper.runProcess ("", "xcodebuild", [ "-version" ]);
@@ -199,70 +216,90 @@ class TVOSHelper {
var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates") ].concat (project.templatePaths);
var launcher = PathHelper.findTemplate (templatePaths, "bin/ios-sim");
Sys.command ("chmod", [ "+x", launcher ]);
// device config
var defaultDevice = "apple-tv-1080p";
var devices:Array<String> = ["apple-tv-1080p"];
var oldDevices:Map<String, String> = ["appletv" => "apple-tv-1080p"];
var deviceFlag:String = null;
var deviceTypeID = null;
// check if old device flag and convert to current
for (key in oldDevices.keys())
{
if (project.targetFlags.exists(key))
{
deviceFlag = oldDevices[key];
break;
}
}
// check known device in command line args
if(deviceFlag == null)
{
for( i in 0...devices.length )
{
if (project.targetFlags.exists(devices[i]))
{
deviceFlag = devices[i];
break;
}
}
}
// default to iphone 6
if(deviceFlag == null)
deviceFlag = defaultDevice;
// check if device is available
// $ ios-sim showdevicetypes
var devicesOutput:String = ProcessHelper.runProcess ("", launcher, [ "showdevicetypes" ] );
var deviceTypeList:Array<String> = devicesOutput.split("\n");
for ( i in 0...deviceTypeList.length )
{
var r:EReg = new EReg(deviceFlag+",", "i");
if(r.match(deviceTypeList[i]))
{
deviceTypeID = deviceTypeList[i];
break;
}
}
if(deviceTypeID == null)
LogHelper.warn("Device \""+deviceFlag+"\" was not found");
else
LogHelper.info("Launch app on \""+deviceTypeID+"\"");
// run command with --devicetypeid if exists
if(deviceTypeID != null)
ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"),*/ "--devicetypeid", deviceTypeID, "--timeout", "60" ] );
else
ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"), "--devicetypeid", deviceTypeID,*/ "--timeout", "60" ] );
} else {
// device config
var defaultDevice = "apple-tv-1080p";
var devices:Array<String> = ["apple-tv-1080p"];
var oldDevices:Map<String, String> = ["appletv" => "apple-tv-1080p"];
var deviceFlag:String = null;
var deviceTypeID = null;
// check if old device flag and convert to current
for (key in oldDevices.keys ()) {
if (project.targetFlags.exists (key)) {
deviceFlag = oldDevices[key];
break;
}
}
// check known device in command line args
if (deviceFlag == null) {
for (i in 0...devices.length) {
if (project.targetFlags.exists (devices[i])) {
deviceFlag = devices[i];
break;
}
}
}
// default to iphone 6
if (deviceFlag == null) {
deviceFlag = defaultDevice;
}
// check if device is available
// $ ios-sim showdevicetypes
var devicesOutput:String = ProcessHelper.runProcess ("", launcher, [ "showdevicetypes" ]);
var deviceTypeList:Array<String> = devicesOutput.split ("\n");
for (i in 0...deviceTypeList.length) {
var r = new EReg (deviceFlag + ",", "i");
if (r.match (deviceTypeList[i])) {
deviceTypeID = deviceTypeList[i];
break;
}
}
if (deviceTypeID == null) {
LogHelper.warn("Device \"" + deviceFlag + "\" was not found");
} else {
LogHelper.info("Launch app on \"" + deviceTypeID + "\"");
}
// run command with --devicetypeid if exists
if (deviceTypeID != null) {
ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"),*/ "--devicetypeid", deviceTypeID, "--timeout", "60" ]);
} else {
ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"), "--devicetypeid", deviceTypeID,*/ "--timeout", "60" ]);
}
} else {
var applicationPath = "";
@@ -325,5 +362,5 @@ class TVOSHelper {
}
}
}

View File

@@ -73,6 +73,6 @@ class WebOSHelper {
runPalmCommand (project, "", "log", args);
}
}
}

View File

@@ -121,5 +121,5 @@ class ZipHelper {
}
}
}

View File

@@ -1,7 +1,7 @@
package lime.utils;
import haxe.io.Bytes;
import haxe.io.Bytes;
@:deprecated class LZMA {

View File

@@ -117,7 +117,7 @@ class RunScript {
}
public static function runCommand (path:String, command:String, args:Array<String>, throwErrors:Bool = true):Int {
var oldPath:String = "";

View File

@@ -123,7 +123,7 @@ class JavaExternGenerator
}
private function extractAndroidClasses()
{
if (!extractedAndroidClasses)
@@ -161,7 +161,7 @@ class JavaExternGenerator
extractedAndroidClasses = true;
}
private function generate(inClass:String, inMembers:Map<String, String>)
{
Lib.println(inClass);
@@ -887,7 +887,7 @@ class JavaExternGenerator
parseTypes(args, 0);
}
private function toHaxeType(inStr:String)
{
parsedTypes = [];