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

import com.github.blindpirate.gogradle.core.dependency.GolangDependency;
import com.github.blindpirate.gogradle.core.dependency.ResolvedDependency;
import com.github.blindpirate.gogradle.core.dependency.VendorNotationDependency;
import com.github.blindpirate.gogradle.vcs.git.GitNotationDependency;
import org.gradle.api.GradleException;

import java.io.File;

public final class DependencyResolutionException extends GradleException {
    private DependencyResolutionException(String message) {
        super(message);
    }

    private DependencyResolutionException(String message, Throwable cause) {
        super(message, cause);
    }

    public static DependencyResolutionException cannotCloneRepository(GolangDependency dependency, Throwable e) {
        return new DependencyResolutionException("Cloning repository of " + dependency.getName() + " failed.", e);
    }

    public static DependencyResolutionException cannotParseNotation(Object notation) {
        return new DependencyResolutionException("Cannot parse notation " + String.valueOf(notation));
    }

    public static DependencyResolutionException cannotFindGitCommit(GitNotationDependency gitNotationDependency) {
        return new DependencyResolutionException("Cannot find commit " + gitNotationDependency.getCommit()
                + " in repository of " + gitNotationDependency.getName() + ", did they force to delete this commit?");
    }

    public static DependencyResolutionException cannotResolveDependency(GolangDependency dependency, Exception e) {
        return new DependencyResolutionException("Cannot resolve dependency:" + dependency, e);
    }

    public static DependencyResolutionException directoryIsInvalid(File rootDir) {
        return new DependencyResolutionException("Directory is invalid:" + rootDir.getPath());
    }


    public static DependencyResolutionException vendorNotExist(VendorNotationDependency vendorNotationDependency,
                                                               ResolvedDependency resolvedDependency) {
        return new DependencyResolutionException("vendor dependency " + vendorNotationDependency.toString()
                + " does not exist in transitive dependencies in " + resolvedDependency);
    }
}

@@ -327,15 +327,20 @@
 vcs.
-git.Git
+GitMercurial
 Nota
@@ -1199,19 +1199,41 @@
 tCommit(
-Git
+%0A            GitMercurial
 Notation
@@ -1242,24 +1242,33 @@
 pendency git
+Mercurial
 NotationDepe
@@ -1345,32 +1345,41 @@
 d commit %22 + git
+Mercurial
 NotationDependen
@@ -1431,22 +1431,47 @@
 ory of %22
- + git
+%0A                + gitMercurial
 Notation
@@ -1486,24 +1486,40 @@
 cy.getName()
+%0A               
  + %22, did th
@@ -1632,16 +1632,29 @@
 endency(
+%0A            
 GolangDe

Fix style