Пример #1
0
def require(artifact_id):
    _prepare()

    artifact = Artifact.from_id(artifact_id)
    artifact_set = _resolve_artifacts([artifact])

    ## download to cache first
    for artifact in artifact_set:
        if artifact.repos != cache_manager.as_repos():
             artifact.repos.download_jar(artifact, 
                 cache_manager.get_jar_path(artifact))
    pool.join()

    ## append jars to path
    for artifact in artifact_set:
        sys.path.append(cache_manager.get_jar_path(artifact, filepath=True))
Пример #2
0
def _install(artifacts, exclusions=[], options={}):
    dryrun = options.get("dry-run", False)
    verify = not options.get("insecure", True)
    _exclusions = options.get('exclude', [])
    copy_pom = options.get('copy-pom', False)
    if _exclusions:
        _exclusions = map(lambda x: Artifact(*(x.split(":"))), _exclusions)
        exclusions.extend(_exclusions)

    download_list = _resolve_artifacts(artifacts, exclusions, verify)

    if not dryrun:
        ## download to cache first
        for artifact in download_list:
            if artifact.repos != cache_manager.as_repos():
                artifact.repos.download_jar(
                    artifact, cache_manager.get_jar_path(artifact), verify)
        pool.join()
        for artifact in download_list:
            cache_manager.get_artifact_jar(artifact, get_lib_path())
            if copy_pom:
                cache_manager.get_artifact_pom(artifact, get_lib_path())

        index_manager.commit()
        logger.info("[Finished] dependencies resolved")
    else:
        logger.info("[Install] Artifacts to install:")
        for artifact in download_list:
            logger.info(artifact)
Пример #3
0
def _install(artifacts, exclusions=[], options={}):
    dryrun = options.get("dry-run", False)
    _exclusions = options.get('exclude', [])
    if _exclusions:
        _exclusions = map(lambda x: Artifact(*(x.split(":"))), _exclusions)
        exclusions.extend(_exclusions)

    download_list = _resolve_artifacts(artifacts, exclusions)
    
    if not dryrun:
        ## download to cache first
        for artifact in download_list:
            if artifact.repos != cache_manager.as_repos():
                artifact.repos.download_jar(artifact, 
                        cache_manager.get_jar_path(artifact))
        pool.join()
        for artifact in download_list:
            cache_manager.get_artifact_jar(artifact, get_lib_path())

        index_manager.commit()
        logger.info("[Finished] dependencies resolved")
    else:
        logger.info("[Install] Artifacts to install:")
        for artifact in download_list:
            print artifact
Пример #4
0
def require(artifact_id):
    _prepare()

    artifact = Artifact.from_id(artifact_id)
    artifact_set = _resolve_artifacts([artifact])

    ## download to cache first
    for artifact in artifact_set:
        if artifact.repos != cache_manager.as_repos():
            artifact.repos.download_jar(artifact,
                                        cache_manager.get_jar_path(artifact))
    pool.join()

    ## append jars to path
    for artifact in artifact_set:
        sys.path.append(cache_manager.get_jar_path(artifact, filepath=True))