// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/configuration/ProjectConfigurationException.java
// public class ProjectConfigurationException extends AndroidMavenException {
// 
//     private static final long serialVersionUID = -4510508504367403748L;
// 
//     public ProjectConfigurationException(String message) {
//         super(message);
//     }
// 
//     public ProjectConfigurationException(Throwable cause) {
//         super(cause);
//     }
// 
//     public ProjectConfigurationException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/Dependency.java
// public interface Dependency {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isLibrary();
// 
//     public String getPath();
// }


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import me.gladwell.eclipse.m2e.android.configuration.ProjectConfigurationException;
import me.gladwell.eclipse.m2e.android.project.Dependency;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.m2e.core.embedder.IMaven;
import com.google.inject.Inject;
    }};

    private final IMaven maven;

    @Inject
    public HardCodedLibraryResolver(IMaven maven) {
        this.maven = maven;
    }

    public List<String> resolveLibraries(Dependency dependency, String type, MavenProject project) {
        List<Dependency> dependenciesForPlatform = getDependenciesForPlatform(dependency,
                project.getRemoteArtifactRepositories());

        List<String> libraries = new ArrayList<String>();

        Artifact androidArtifact = resolve(dependency.getGroup(), dependency.getName(), dependency.getVersion(), type,
                project.getRemoteArtifactRepositories());
        libraries.add(androidArtifact.getFile().getAbsolutePath());

        for (Dependency platformDependency : dependenciesForPlatform) {
            Artifact artifact = resolve(platformDependency.getGroup(), platformDependency.getName(),
                    platformDependency.getVersion(), "jar", project.getRemoteArtifactRepositories());

            libraries.add(artifact.getFile().getAbsolutePath());
        }

        return libraries;
    }

    private List<Dependency> getDependenciesForPlatform(Dependency dependency,
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/configuration/ProjectConfigurationException.java
// public class ProjectConfigurationException extends AndroidMavenException {
// 
//     private static final long serialVersionUID = -4510508504367403748L;
// 
//     public ProjectConfigurationException(String message) {
//         super(message);
//     }
// 
//     public ProjectConfigurationException(Throwable cause) {
//         super(cause);
//     }
// 
//     public ProjectConfigurationException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/Dependency.java
// public interface Dependency {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isLibrary();
// 
//     public String getPath();
// }


// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/resolve/HardCodedLibraryResolver.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import me.gladwell.eclipse.m2e.android.configuration.ProjectConfigurationException;
import me.gladwell.eclipse.m2e.android.project.Dependency;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.m2e.core.embedder.IMaven;
import com.google.inject.Inject;

    }};

    private final IMaven maven;

    @Inject
    public HardCodedLibraryResolver(IMaven maven) {
        this.maven = maven;
    }

    public List<String> resolveLibraries(Dependency dependency, String type, MavenProject project) {
        List<Dependency> dependenciesForPlatform = getDependenciesForPlatform(dependency,
                project.getRemoteArtifactRepositories());

        List<String> libraries = new ArrayList<String>();

        Artifact androidArtifact = resolve(dependency.getGroup(), dependency.getName(), dependency.getVersion(), type,
                project.getRemoteArtifactRepositories());
        libraries.add(androidArtifact.getFile().getAbsolutePath());

        for (Dependency platformDependency : dependenciesForPlatform) {
            Artifact artifact = resolve(platformDependency.getGroup(), platformDependency.getName(),
                    platformDependency.getVersion(), "jar", project.getRemoteArtifactRepositories());

            libraries.add(artifact.getFile().getAbsolutePath());
        }

        return libraries;
    }

    private List<Dependency> getDependenciesForPlatform(Dependency dependency,
            List<ArtifactRepository> artifactRepositories) throws ProjectConfigurationException {