def _collect_libs(self): repository_level_subpath = join_ipath(self.repository_level_subpath, DotNetLib.LIB_DIR) global_libs = self._collect_framework_libs(repository_level_subpath) libs_by_framework = {"": global_libs} for item, item_path in listdir_full(self.repository.directory.to_full_path(repository_level_subpath)): if os.path.isdir(item_path): libs = self._collect_framework_libs(join_ipath(repository_level_subpath, item)) libs_by_framework[item.lower()] = global_libs + libs best_framework = self._find_best_framework(libs_by_framework.keys(), self.framework) self._libs = libs_by_framework[best_framework]
def _collect_framework_libs(self, repository_level_subpath): lib_files = [] for item, item_path in listdir_full(self.repository.directory.to_full_path(repository_level_subpath)): if os.path.isfile(item_path): lib_files.append(join_ipath(repository_level_subpath, item)) return lib_files
def _collect_framework_libs(self, repository_level_subpath): lib_files = [] for item, item_path in listdir_full( self.repository.directory.to_full_path( repository_level_subpath)): if os.path.isfile(item_path): lib_files.append(join_ipath(repository_level_subpath, item)) return lib_files
def _load_libs(self, externals_level_subpath, framework, is_auto): directory = self.directory.subdir(externals_level_subpath) if not os.path.isdir(directory.path): return for item, item_path in listdir_full(directory.path): if os.path.isdir(item_path): self._load_potential_dotnet_lib(item, join_ipath(externals_level_subpath, item), framework, is_auto)
def _collect_libs(self): repository_level_subpath = join_ipath(self.repository_level_subpath, DotNetLib.LIB_DIR) global_libs = self._collect_framework_libs(repository_level_subpath) libs_by_framework = {"": global_libs} for item, item_path in listdir_full( self.repository.directory.to_full_path( repository_level_subpath)): if os.path.isdir(item_path): libs = self._collect_framework_libs( join_ipath(repository_level_subpath, item)) libs_by_framework[item.lower()] = global_libs + libs best_framework = self._find_best_framework(libs_by_framework.keys(), self.framework) self._libs = libs_by_framework[best_framework]
def _load_potential_dotnet_lib(self, full_name, externals_level_subpath, framework, is_auto): lib_repository_level_subpath = join_ipath(self.repository_level_subpath, externals_level_subpath) lib = DotNetLib(self.repository, lib_repository_level_subpath, full_name, framework, is_auto) if lib.name in self._dotnet_lib_config and framework not in self._dotnet_lib_config[lib.name]['frameworks']: return lib.load() self._add_lib(framework, lib)
def _generate_csproj_external_dll_part(self, dll): params = { 'name': os.path.splitext(dll.split('/')[-1])[0], 'path': self._to_vs_path(join_ipath(self.project.to_repository_relative_path, dll)), } template = \ " <Reference Include=\"%(name)s\">\r\n" +\ " <HintPath>%(path)s</HintPath>\r\n" +\ " </Reference>" return template % params
def _generate_csproj_external_dll_part(self, dll): params = { 'name': os.path.splitext(dll.split('/')[-1])[0], 'path': self._to_vs_path( join_ipath(self.project.to_repository_relative_path, dll)), } template = \ " <Reference Include=\"%(name)s\">\r\n" +\ " <HintPath>%(path)s</HintPath>\r\n" +\ " </Reference>" return template % params