Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Updating 1_4_X to 4.2 compliance with new and improved tiJSCore (Alre…
Browse files Browse the repository at this point in the history
…ady in Master and 1.4.2, so more like a hand-me-down)
  • Loading branch information
Blain Hamon authored and Blain Hamon committed Nov 15, 2010
1 parent c377118 commit 050a4f4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
2 changes: 1 addition & 1 deletion iphone/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os,platform,sys,urllib,gzip,glob
from progressbar import ProgressBar

ticore_version = '7'
ticore_version = '9'

# NOTE: this is simply a pre-built version of the source at http://github.com/appcelerator/tijscore
# since this is so freaking complicated to setup and build in an stable environment, and since
Expand Down
32 changes: 32 additions & 0 deletions support/iphone/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,36 @@ def dequote(s):
return s[1:-1]
return s

def version_sort(a,b):
x = float(a[0:3]) # ignore more than 2 places
y = float(b[0:3]) # ignore more than 2 places
if x > y:
return -1
if x < y:
return 1
return 0

def check_iphone_sdk(s):
found = []
output = run.run(["xcodebuild","-showsdks"],True,False)
#print output
if output:
for line in output.split("\n"):
if line[0:1] == '\t':
line = line.strip()
i = line.find('-sdk')
if i < 0: continue
type = line[0:i]
cmd = line[i+5:]
if cmd.find("iphoneos")==0:
ver = cmd[8:]
found.append(ver)
# The sanity check doesn't have to be as thorough as prereq.
if s in found:
return s
# Sanity check failed. Let's find something close.
return sorted(found,version_sort)[0]

def kill_simulator():
run.run(['/usr/bin/killall',"iPhone Simulator"],True)

Expand Down Expand Up @@ -334,6 +364,7 @@ def main(args):


if command == 'distribute':
iphone_version = check_iphone_sdk(iphone_version)
appuuid = dequote(args[6].decode("utf-8"))
dist_name = dequote(args[7].decode("utf-8"))
output_dir = os.path.expanduser(dequote(args[8].decode("utf-8")))
Expand All @@ -349,6 +380,7 @@ def main(args):
if argc > 6:
devicefamily = dequote(args[6].decode("utf-8"))
elif command == 'install':
iphone_version = check_iphone_sdk(iphone_version)
appuuid = dequote(args[6].decode("utf-8"))
dist_name = dequote(args[7].decode("utf-8"))
if argc > 8:
Expand Down
21 changes: 13 additions & 8 deletions support/iphone/prereq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

# sort by the latest version first
def version_sort(a,b):
x = float(a[0:2]) # ignore more than 2 places
y = float(b[0:2]) # ignore more than 2 places
x = float(a[0:3]) # ignore more than 2 places
y = float(b[0:3]) # ignore more than 2 places
if x > y:
return -1
if x < y:
Expand All @@ -34,13 +34,18 @@ def get_sdks():
cmd = line[i+5:]
if cmd.find("iphoneos")==0:
ver = cmd[8:]
major = int(ver[0])
if major>=3 and ver!='3.0':
elif cmd.find("iphonesimulator")==0:
ver = cmd[15:]
else:
continue
major = int(ver[0])
if major>=3 and ver!='3.0':
if not (ver in found):
found.append(ver)
# ipad is anything 3.2+
if major>3 or ver.startswith('3.2'):
ipad=True
# ipad is anything 3.2+
if major>3 or ver.startswith('3.2'):
ipad=True

return (sorted(found,version_sort),ipad)

def check_iphone3():
Expand Down

0 comments on commit 050a4f4

Please sign in to comment.