// 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/resolve/LibraryResolver.java
// public interface LibraryResolver {
// 
//     List<String> resolveLibraries(Dependency dependency, String type, MavenProject project);
// 
// }


import java.io.File;
import java.util.ArrayList;
import java.util.List;
import me.gladwell.eclipse.m2e.android.configuration.ProjectConfigurationException;
import me.gladwell.eclipse.m2e.android.resolve.LibraryResolver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Resource;
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;
        for (Artifact a : mavenProject.getArtifacts()) {
            if (a.getArtifactHandler().isAddedToClasspath()) {
                if (!Artifact.SCOPE_COMPILE.equals(a.getScope()) && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
                    list.add(new MavenDependency(a));
                }
            }
        }

        return list;
    }

    public List<String> getPlatformProvidedDependencies() {
        final Dependency android = getAndroidDependency();
        final List<String> platformProvidedDependencies = new ArrayList<String>();

        final List<String> libraries = dependencyResolver.resolveLibraries(android, "jar", mavenProject);

        for (String library : libraries) {
            platformProvidedDependencies.add(library);
        }

        return platformProvidedDependencies;
    }

    private Dependency getAndroidDependency() {
        for (Artifact artifact : mavenProject.getArtifacts()) {
            if (isAndroidGroupId(artifact) && artifact.getArtifactId().equals("android")) {
                return new MavenDependency(artifact);
            }
        }
// 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/resolve/LibraryResolver.java
// public interface LibraryResolver {
// 
//     List<String> resolveLibraries(Dependency dependency, String type, MavenProject project);
// 
// }


// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/JaywayMavenAndroidProject.java
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import me.gladwell.eclipse.m2e.android.configuration.ProjectConfigurationException;
import me.gladwell.eclipse.m2e.android.resolve.LibraryResolver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Resource;
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;

        for (Artifact a : mavenProject.getArtifacts()) {
            if (a.getArtifactHandler().isAddedToClasspath()) {
                if (!Artifact.SCOPE_COMPILE.equals(a.getScope()) && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
                    list.add(new MavenDependency(a));
                }
            }
        }

        return list;
    }

    public List<String> getPlatformProvidedDependencies() {
        final Dependency android = getAndroidDependency();
        final List<String> platformProvidedDependencies = new ArrayList<String>();

        final List<String> libraries = dependencyResolver.resolveLibraries(android, "jar", mavenProject);

        for (String library : libraries) {
            platformProvidedDependencies.add(library);
        }

        return platformProvidedDependencies;
    }

    private Dependency getAndroidDependency() {
        for (Artifact artifact : mavenProject.getArtifacts()) {
            if (isAndroidGroupId(artifact) && artifact.getArtifactId().equals("android")) {
                return new MavenDependency(artifact);
            }
        }
        throw new ProjectConfigurationException("cannot find android dependency for project=[" + getName() + "]");