def _gen_available_platforms(self, proj_info): # generate the platform list for different projects if self._project._is_lua_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX ] else: if self._project.has_android_libs(): platform_list = [Platforms.ANDROID] else: platform_list = [] elif self._project._is_js_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB, Platforms.LINUX ] else: if self._project.has_android_libs(): platform_list = [Platforms.ANDROID, Platforms.WEB] else: platform_list = [Platforms.WEB] elif self._project._is_cpp_project(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.WP8, Platforms.WP8_1, Platforms.METRO ] # filter the available platform list platform_list = self._filter_platforms(platform_list) # check the real available platforms self._available_platforms = {} root_path = self._project.get_project_dir() for p in platform_list: cfg_class = cocos.get_class(Platforms.CFG_CLASS_MAP[p]) if cfg_class is None: continue cfg_key = "%s_cfg" % p if proj_info.has_key(cfg_key): cfg_obj = cfg_class(root_path, self._project._is_script_project(), proj_info[cfg_key]) else: cfg_obj = cfg_class(root_path, self._project._is_script_project()) if cfg_obj._is_available(): self._available_platforms[p] = cfg_obj # don't have available platforms if len(self._available_platforms) == 0: raise cocos.CCPluginError("There isn't any available platforms")
def _gen_available_platforms(self, proj_info, proj_dir): # generate the platform list for different projects if self._project._is_lua_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.TIZEN ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID ] else: platform_list = [] elif self._project._is_js_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID, Platforms.WEB ] else: platform_list = [ Platforms.WEB ] elif self._project._is_cpp_project(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ] # filter the available platform list platform_list = self._filter_platforms(platform_list) # check the real available platforms self._available_platforms = {} root_path = self._project.get_project_dir() for p in platform_list: cfg_class = cocos.get_class(Platforms.CFG_CLASS_MAP[p]) if cfg_class is None: continue cfg_key = "%s_cfg" % p if proj_info.has_key(cfg_key): cfg_obj = cfg_class(root_path, self._project._is_script_project(), proj_info[cfg_key]) else: cfg_obj = cfg_class(root_path, self._project._is_script_project()) if proj_dir is not None: cfg_obj.proj_path = os.path.join(root_path, proj_dir) if cfg_obj._is_available(): self._available_platforms[p] = cfg_obj # don't have available platforms if len(self._available_platforms) == 0: raise cocos.CCPluginError(MultiLanguage.get_string('PROJECT_NO_AVAILABLE_PLATFORMS'), cocos.CCPluginError.ERROR_WRONG_CONFIG)
def _gen_available_platforms(self, proj_info, proj_dir): # generate the platform list for different projects if self._project._is_lua_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.AMAZON, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.TIZEN ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID ] else: platform_list = [] elif self._project._is_js_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.AMAZON, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID, Platforms.WEB ] else: platform_list = [ Platforms.WEB ] elif self._project._is_cpp_project(): platform_list = [ Platforms.ANDROID, Platforms.AMAZON, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ] # filter the available platform list platform_list = self._filter_platforms(platform_list) # check the real available platforms self._available_platforms = {} root_path = self._project.get_project_dir() for p in platform_list: cfg_class = cocos.get_class(Platforms.CFG_CLASS_MAP[p]) if cfg_class is None: continue cfg_key = "%s_cfg" % p if proj_info.has_key(cfg_key): cfg_obj = cfg_class(root_path, self._project._is_script_project(), proj_info[cfg_key]) else: cfg_obj = cfg_class(root_path, self._project._is_script_project()) if proj_dir is not None: cfg_obj.proj_path = os.path.join(root_path, proj_dir) if cfg_obj._is_available(): self._available_platforms[p] = cfg_obj # don't have available platforms if len(self._available_platforms) == 0: raise cocos.CCPluginError(MultiLanguage.get_string('PROJECT_NO_AVAILABLE_PLATFORMS'), cocos.CCPluginError.ERROR_WRONG_CONFIG)
def _gen_available_platforms(self, proj_info): # generate the platform list for different projects if self._project._is_lua_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID ] else: platform_list = [] elif self._project._is_js_project(): if self._project._is_native_support(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB ] else: if self._project.has_android_libs(): platform_list = [ Platforms.ANDROID, Platforms.WEB ] else: platform_list = [ Platforms.WEB ] elif self._project._is_cpp_project(): platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX ] # filter the available platform list platform_list = self._filter_platforms(platform_list) # check the real available platforms self._available_platforms = {} root_path = self._project.get_project_dir() for p in platform_list: cfg_class = cocos.get_class(Platforms.CFG_CLASS_MAP[p]) if cfg_class is None: continue cfg_key = "%s_cfg" % p if proj_info.has_key(cfg_key): cfg_obj = cfg_class(root_path, self._project._is_script_project(), proj_info[cfg_key]) else: cfg_obj = cfg_class(root_path, self._project._is_script_project()) if cfg_obj._is_available(): self._available_platforms[p] = cfg_obj # don't have available platforms if len(self._available_platforms) == 0: raise cocos.CCPluginError("There isn't any available platforms")