@task
@description("Prepares the project for building.")
def prepare(project, logger):
    target_directory = project.expand_path("$dir_target")
    if not os.path.exists(target_directory):
        logger.debug("Creating target directory %s", target_directory)
        os.mkdir(target_directory)

    reports_directory = project.expand_path("$dir_reports")
    if not os.path.exists(reports_directory):
        logger.debug("Creating reports directory %s", reports_directory)
        os.mkdir(reports_directory)

    plugin_dependency_versions = get_package_version(project.plugin_dependencies, logger)
    for plugin_dependency in project.plugin_dependencies:
        logger.debug("Processing plugin dependency %s" % plugin_dependency)
        if plugin_dependency.name.lower() not in plugin_dependency_versions or not \
            version_satisfies_spec(plugin_dependency.version,
                                   plugin_dependency_versions[plugin_dependency.name.lower()]):
            logger.info("Installing plugin dependency %s" % plugin_dependency)
            log_file = project.expand_path("$dir_reports", "dependency_%s_install.log" % plugin_dependency)
            pip_install(as_pip_install_target(plugin_dependency),
                        index_url=project.get_property("install_dependencies_index_url"),
                        extra_index_url=project.get_property("install_dependencies_extra_index_url"),
                        verbose=project.get_property("verbose"), logger=logger,
                        force_reinstall=plugin_dependency.url is not None, outfile_name=log_file,
                        error_file_name=log_file)
dataset/ETHPy150Open pybuilder/pybuilder/src/main/python/pybuilder/plugins/core_plugin.py/prepare/original