Exemplo n.º 1
0
	def run(self, ipAddress, password = None, debugToken = None):
		# TODO Mac: V8 runtime should be added and possibly a lot of other stuff

		retCode = self.build()
		if retCode != 0:
			return retCode
		info('Running')
		
		# Check if tiapp.xml changed since last run
		tiapp_delta = self.project_deltafy.scan_single_file(self.project_tiappxml)
		tiapp_changed = tiapp_delta is not None

		if (tiapp_changed):
			# regenerate bar-descriptor.xml
			# TODO MAC: Add blackberry specific properties. Needs update in tiapp.py script
			templates = os.path.join(template_dir,'templates')
			shutil.copy2(os.path.join(templates,'bar-descriptor.xml'), self.buildDir)
			newConfig = {
			'id':self.tiappxml.properties['id'],
			'appname':self.tiappxml.properties['name'],
			'platformversion':self.ndk.version,
			'description':(self.tiappxml.properties['description'] or 'not specified'),
			'version':(self.tiappxml.properties['version'] or '1.0'),
			'author':(self.tiappxml.properties['publisher'] or 'not specified'),
			'category':'core.games',
			'icon':'assets/%s' %(self.tiappxml.properties['icon'] or 'appicon.png'),
			'splashscreen':'assets/default.png'
			}
			try:
				Blackberry.renderTemplate(os.path.join(self.buildDir,'bar-descriptor.xml'), newConfig)
			except Exception, e:
				print >>sys.stderr, e
				sys.exit(1)
Exemplo n.º 2
0
	def run(self, ipAddress = None, password = None, debugToken = None, storePass = None, outputDir = None):
		# TODO Mac: V8 runtime should be added and possibly a lot of other stuff

		retCode = self.build()
		if retCode != 0:
			return retCode
		info('Running')

		templates = os.path.join(template_dir,'templates')

		# Check if tiapp.xml changed since last run
		bar_descriptor_exists = os.path.exists(os.path.join(self.buildDir, 'bar-descriptor.xml'))
		tiapp_delta = self.project_deltafy.scan_single_file(self.project_tiappxml)
		tiapp_changed = tiapp_delta is not None

		# Discover any splash images that follow this pattern:
		#     splash-widthxheight.[png|jpg]
		resources = os.listdir(self.blackberryResources)
		splashScreens = [r for r in resources if re.match('splash-[0-9]*x[0-9]*.png|jpg', r)]

		if (tiapp_changed or not bar_descriptor_exists):
			# regenerate bar-descriptor.xml
			# TODO MAC: Add blackberry specific properties. Needs update in tiapp.py script
			print 'Creating bar-descriptor.xml'
			shutil.copy2(os.path.join(templates,'bar-descriptor.xml'), self.buildDir)
			newConfig = {
			'id':self.tiappxml.properties['id'],
			'appname':self.tiappxml.properties['name'],
			'platformversion':self.ndk.version,
			'description':(self.tiappxml.properties['description'] or 'not specified'),
			'version':(self.tiappxml.properties['version'] or '1.0'),
			'author':(self.tiappxml.properties['publisher'] or 'not specified'),
			'category':'core.games',
			'icon':'assets/%s' %(self.tiappxml.properties['icon'] or 'appicon.png'),
			'splashScreens':splashScreens,
			'orientation': self.tiappxml.blackberry.get('orientation', 'default')
			}
			try:
				Blackberry.renderTemplate(os.path.join(self.buildDir,'bar-descriptor.xml'), newConfig)
			except Exception, e:
				print >>sys.stderr, e
				sys.exit(1)

			# Write application properties to INI file.
			write_app_properties(
				self.tiappxml.app_properties.items(),
				os.path.join(self.buildDir, 'app_properties.ini'))
    def run(self, ipAddress, password=None, debugToken=None):
        # TODO Mac: V8 runtime should be added and possibly a lot of other stuff

        retCode = self.build()
        if retCode != 0:
            return retCode
        info('Running')

        # Check if tiapp.xml changed since last run
        tiapp_delta = self.project_deltafy.scan_single_file(
            self.project_tiappxml)
        tiapp_changed = tiapp_delta is not None

        if (tiapp_changed):
            # regenerate bar-descriptor.xml
            # TODO MAC: Add blackberry specific properties. Needs update in tiapp.py script
            templates = os.path.join(template_dir, 'templates')
            shutil.copy2(os.path.join(templates, 'bar-descriptor.xml'),
                         self.buildDir)
            newConfig = {
                'id':
                self.tiappxml.properties['id'],
                'appname':
                self.tiappxml.properties['name'],
                'platformversion':
                self.ndk.version,
                'description': (self.tiappxml.properties['description']
                                or 'not specified'),
                'version': (self.tiappxml.properties['version'] or '1.0'),
                'author': (self.tiappxml.properties['publisher']
                           or 'not specified'),
                'category':
                'core.games',
                'icon':
                'assets/%s' %
                (self.tiappxml.properties['icon'] or 'appicon.png'),
                'splashscreen':
                'assets/default.png'
            }
            try:
                Blackberry.renderTemplate(
                    os.path.join(self.buildDir, 'bar-descriptor.xml'),
                    newConfig)
            except Exception, e:
                print >> sys.stderr, e
                sys.exit(1)