Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-9843: BlackBerry: Package framework's .js files #89

Merged
merged 2 commits into from
Jul 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions blackberry/tibb/titanium/javascript/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
2 changes: 1 addition & 1 deletion site_scons/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def zip_blackberry(zf,basepath,version):
def zipBlackberryDir(dir):
for root, dirs, files in os.walk(dir):
for file in files:
if not file.endswith('.a'):
if not (file.endswith('.a') or file.endswith('.js')):
continue
from_ = os.path.join(root, file)
to_ = from_.replace(blackberryDir, toPath, 1)
Expand Down
14 changes: 12 additions & 2 deletions support/blackberry/blackberryndk.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,17 @@ def build(self, project, cpu):
return retCode

def package(self, package, appFile, projectName, type, debugToken, isUnitTest = False):
# Copy all needed resources to assets
templateDir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
buildDir = os.path.abspath(os.path.join(appFile, '..', '..', '..'))
projectDir = os.path.abspath(os.path.join(buildDir, '..', '..', '..'))

# Copy the framework's JavaScript
frameworkDir = os.path.join(buildDir, 'framework')
if os.path.exists(frameworkDir):
shutil.rmtree(frameworkDir)
shutil.copytree(os.path.join(templateDir, 'tibb', 'titanium', 'javascript'), frameworkDir)

# Copy all needed resources to assets
assetsDir = os.path.join(buildDir, 'assets')
resourcesDir = os.path.join(projectDir, 'Resources')
blackberryResourcesDir = os.path.join(resourcesDir, 'blackberry')
Expand All @@ -200,7 +208,9 @@ def package(self, package, appFile, projectName, type, debugToken, isUnitTest =
fullFilenameDest = fullFilenameSrc.replace(blackberryResourcesDir, assetsDir, 1)
shutil.copy2(fullFilenameSrc, fullFilenameDest)

command = [self.packagerProgram, '-package', package, 'bar-descriptor.xml', '-e', appFile, projectName, 'assets']
# TODO: minimize .js files in Release mode

command = [self.packagerProgram, '-package', package, 'bar-descriptor.xml', '-e', appFile, projectName, 'assets', 'framework']
if isUnitTest:
command.append('icon.png')
if type != 'deploy':
Expand Down