package com.github.blindpirate.gogradle.core.dependency;

/**
 * Manages global dependency register.
 * When a dependency is resolved, its repo information will be registered here.
 * Later, resolving dependency of same repo can be faster.
 */
public interface DependencyRegistry {
    /**
     * Registers a dependency
     *
     * @param dependency
     * @return true if the dependency is newer than existing dependency with same name.
     */
    boolean register(ResolvedDependency dependency);

    ResolvedDependency retrive(String name);
}

@@ -51,16 +51,44 @@
 dency;%0A%0A
+import java.util.Optional;%0A%0A
 /**%0A * M
@@ -567,11 +567,184 @@
 g name);
+%0A%0A    Optional%3CResolvedDependency%3E getFromCache(NotationDependency dependency);%0A%0A    void putIntoCache(NotationDependency dependency, ResolvedDependency resolvedDependency);
 %0A%7D%0A

Add cache methods in DependencyRegistry