Example #1
0
	def __init__(self,tiapp,project_dir,java,classes_dir,root_dir, include_all_modules=False):
		self.tiapp = tiapp
		self.java = java
		self.appname = tiapp.properties['name']
		self.classes_dir = classes_dir
		self.template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
		self.appid = tiapp.properties['id']
		self.root_dir = root_dir
		self.project_dir = os.path.abspath(os.path.expanduser(project_dir))
		self.modules = set()
		self.jar_libraries = set()
		
		json_contents = open(os.path.join(self.template_dir,'dependency.json')).read()
		self.depends_map = simplejson.loads(json_contents)
		
		# go ahead and slurp in any required modules
		for required in self.depends_map['required']:
			self.add_required_module(required)
		
		if (tiapp.has_app_property('ti.android.include_all_modules')):
			if tiapp.to_bool(tiapp.get_app_property('ti.android.include_all_modules')):
				include_all_modules = True
		if include_all_modules:
			print '[INFO] Force including all modules...'
			sys.stdout.flush()
			for module in bindings.get_all_module_names():
				self.add_required_module(module)

		self.module_methods = set()
		self.js_files = {}
		self.html_scripts = []
		self.compiled_files = []
Example #2
0
    def __init__(self, tiapp, project_dir, java, classes_dir, root_dir):
        self.tiapp = tiapp
        self.java = java
        self.appname = tiapp.properties['name']
        self.classes_dir = classes_dir
        self.template_dir = os.path.abspath(
            os.path.dirname(sys._getframe(0).f_code.co_filename))
        self.appid = tiapp.properties['id']
        self.root_dir = root_dir
        self.project_dir = os.path.abspath(os.path.expanduser(project_dir))
        self.modules = set()
        self.jar_libraries = set()

        json_contents = open(os.path.join(self.template_dir,
                                          'dependency.json')).read()
        self.depends_map = simplejson.loads(json_contents)

        # go ahead and slurp in any required modules
        for required in self.depends_map['required']:
            self.add_required_module(required)

        if (tiapp.has_app_property('ti.android.include_all_modules')):
            if tiapp.to_bool(
                    tiapp.get_app_property('ti.android.include_all_modules')):
                print '[INFO] Force including all modules...'
                sys.stdout.flush()
                for module in bindings.get_all_module_names():
                    self.add_required_module(module)

        self.module_methods = set()
        self.js_files = {}
        self.html_scripts = []
        self.compiled_files = []
	def __init__(self, tiapp, project_dir, java, classes_dir, gen_dir, root_dir, include_all_modules=False, ti_sdk_dir=None):
		self.ti_sdk_dir = ti_sdk_dir
		self.ti_android_dir = None
		self.tiapp = tiapp
		self.java = java
		self.appname = tiapp.properties['name']
		self.classes_dir = classes_dir
		self.gen_dir = gen_dir
		self.this_dir = this_dir
		self.appid = tiapp.properties['id']
		self.root_dir = root_dir
		self.use_bytecode = False
		self.project_dir = os.path.abspath(os.path.expanduser(project_dir))
		self.modules = set()
		self.jar_libraries = set()
		
		json_contents = open(os.path.join(self.ti_sdk_dir, 'android', 'dependency.json')).read()
		self.depends_map = simplejson.loads(json_contents)

		if self.ti_sdk_dir:
			self.ti_android_dir = os.path.join(self.ti_sdk_dir, "android")
			bindings.init(self.ti_android_dir)
		
		# go ahead and slurp in any required modules
		for required in self.depends_map['required']:
			self.add_required_module(required)

		runtime = tiapp.app_properties.get('ti.android.runtime', self.depends_map['runtimes']['defaultRuntime'])
		for runtime_jar in self.depends_map['runtimes'][runtime]:
			self.jar_libraries.add(os.path.join(self.ti_android_dir, runtime_jar))

		if (tiapp.has_app_property('ti.android.include_all_modules')):
			if tiapp.to_bool(tiapp.get_app_property('ti.android.include_all_modules')):
				include_all_modules = True
		if include_all_modules:
			print '[INFO] Force including all modules...'
			sys.stdout.flush()
			for module in bindings.get_all_module_names():
				self.add_required_module(module)

		self.module_methods = set()
		self.js_files = {}
		self.html_scripts = []
		self.compiled_files = []