def clean_up_package(file_system: FileSystem, package_path: str, extraction_path: str, logging_level: int): package = get_package_metadata(package_path) name = package['name'].replace(package_extension, '') organization = package['organization'] artifact = package['artifact'] architecture = package['architecture'] platform = package['platform'] compiler = package['compiler'] mode = package['mode'] yield_descriptor = get_compiler(file_system, compiler, architecture, platform, mode, logging_level).get_yield_descriptor() resources = join(extraction_path, 'resources', organization, artifact) headers = join(extraction_path, 'headers', organization, artifact) library = yield_descriptor.get_library(join(extraction_path, 'libraries'), name) library_interface = yield_descriptor.get_library_interface( join(extraction_path, 'libraries_interfaces'), name) symbols_table = yield_descriptor.get_symbols_table( join(extraction_path, 'symbols_tables'), name) executable = yield_descriptor.get_executable( join(extraction_path, 'executables'), name) if file_system.exists(resources): file_system.remove_directory_recursively(resources) if file_system.exists(headers): file_system.remove_directory_recursively(headers) if library and file_system.exists(library): file_system.remove_file(library) if library_interface and file_system.exists(library_interface): file_system.remove_file(library_interface) if symbols_table and file_system.exists(symbols_table): file_system.remove_file(symbols_table) if executable and file_system.exists(executable): file_system.remove_file(executable) if file_system.exists(package_path): file_system.remove_file(package_path)
def clean(file_system: FileSystem, resources: StageResources, cache: Dict[str, Any], program_arguments: Dict[str, Any], configuration: Dict[str, Any], remote_proxy: RemoteProxy): target = join(resources['project_directory'], 'target') if file_system.exists(target): file_system.remove_directory_recursively(target)