Skip to content

Commit

Permalink
Merge pull request #3819 from euforic/timob-12458
Browse files Browse the repository at this point in the history
added blackberry support to scons packager
  • Loading branch information
cb1kenobi committed Jan 30, 2013
2 parents 9a61dac + 2a29978 commit f529af2
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 56 deletions.
28 changes: 21 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if clean and os.path.exists('iphone/iphone/build'):
shutil.rmtree('iphone/iphone/build')

build_type = 'full'
build_dirs = ['iphone', 'android', 'mobileweb']
build_dirs = ['iphone', 'android', 'mobileweb', 'blackberry']
force_iphone = False

if ARGUMENTS.get('iphone',0):
Expand All @@ -88,6 +88,10 @@ if ARGUMENTS.get('mobileweb',0):
build_type='mobileweb'
build_dirs=['mobileweb']

if ARGUMENTS.get('blackberry',0):
build_type='blackberry'
build_dirs=['blackberry']

if ARGUMENTS.get('force_iphone',0):
force_iphone = True

Expand All @@ -106,7 +110,7 @@ if build_type in ['full', 'android'] and not only_package:
try:
sdk = AndroidSDK(ARGUMENTS.get("android_sdk", None), 14)
build_x86 = int(ARGUMENTS.get('build_x86', 1))

# TODO re-enable javadoc targets = ["full.build", "build.titanium.javadoc"]
targets = ["full.build"]
if clean: targets = ["clean"]
Expand All @@ -127,7 +131,7 @@ if build_type in ['full', 'iphone', 'ipad'] and not only_package \
try:
#output = 0
if clean: build_type = "clean"
output = os.system("scons PRODUCT_VERSION=%s COMPILER_FLAGS='%s' BUILD_TYPE='%s'" % (version,flags,build_type))
output = os.system("scons PRODUCT_VERSION=%s COMPILER_FLAGS='%s' BUILD_TYPE='%s'" % (version,flags,build_type))
if output!=0:
sys.stderr.write("BUILD FAILED!!!!\n")
# beep, please
Expand All @@ -149,6 +153,15 @@ if build_type in ['full', 'mobileweb'] and not only_package:
finally:
os.chdir(d)

if build_type in ['full', 'blackberry'] and not only_package:
d = os.getcwd()
os.chdir('blackberry')
try:
if clean: build_type = "clean"
# nothing to do... yet
finally:
os.chdir(d)

def install_mobilesdk(version_tag):
if (platform.system() == "Darwin"):
os_names = { "Windows":"win32", "Linux":"linux", "Darwin":"osx" }
Expand All @@ -163,15 +176,16 @@ def package_sdk(target, source, env):
iphone = build_type in ['full', 'iphone']
ipad = build_type in ['full', 'ipad']
mobileweb = build_type in ['full', 'mobileweb']
blackberry = build_type in ['full', 'blackberry']
package_all = ARGUMENTS.get('package_all', 0)
version_tag = ARGUMENTS.get('version_tag', version)
build_jsca = int(ARGUMENTS.get('build_jsca', 1))
print "Packaging MobileSDK (%s)..." % version_tag
packager = package.Packager(build_jsca=build_jsca)
if package_all:
packager.build_all_platforms(os.path.abspath('dist'), version, module_apiversion, android, iphone, ipad, mobileweb, version_tag, node_appc_branch)
packager.build_all_platforms(os.path.abspath('dist'), version, module_apiversion, android, iphone, ipad, mobileweb, blackberry, version_tag, node_appc_branch)
else:
packager.build(os.path.abspath('dist'), version, module_apiversion, android, iphone, ipad, mobileweb, version_tag, node_appc_branch)
packager.build(os.path.abspath('dist'), version, module_apiversion, android, iphone, ipad, mobileweb, blackberry, version_tag, node_appc_branch)
if install and not clean:
install_mobilesdk(version_tag)

Expand All @@ -188,7 +202,7 @@ if run_drillbit:
package_builder = Builder(action = package_sdk)
env.Append(BUILDERS = {'PackageMobileSDK': package_builder})
env.PackageMobileSDK("#dummy-sdk-target", [])

if clean:
# don't error
# don't error
Exit(0)

0 comments on commit f529af2

Please sign in to comment.