package org.robolectric;

import org.apache.maven.model.Dependency;

public class SdkConfig {
  private final String artifactVersionString;

  public SdkConfig(String artifactVersionString) {
    this.artifactVersionString = artifactVersionString;
  }

  public String getArtifactVersionString() {
    return artifactVersionString;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SdkConfig sdkConfig = (SdkConfig) o;

    if (!artifactVersionString.equals(sdkConfig.artifactVersionString)) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return artifactVersionString.hashCode();
  }

  public Dependency getSystemResourceDependency() {
    return realAndroidDependency("android-res");
  }

  public Dependency[] getSdkClasspathDependencies() {
    return new Dependency[] {
        realAndroidDependency("android-base"),
        realAndroidDependency("android-kxml2"),
        realAndroidDependency("android-luni"),
        createDependency("org.json", "json", "20080701", "jar", null),
        createDependency("org.ccil.cowan.tagsoup", "tagsoup", "1.2", "jar", null)
    };
  }


  public Dependency realAndroidDependency(String artifactId) {
    return createDependency("org.robolectric", artifactId, getArtifactVersionString(), "jar", "real");
  }

  public Dependency createDependency(String groupId, String artifactId, String version, String type, String classifier) {
    Dependency dependency = new Dependency();
    dependency.setGroupId(groupId);
    dependency.setArtifactId(artifactId);
    dependency.setVersion(version);
    dependency.setType(type);
    dependency.setClassifier(classifier);
    return dependency;
  }
}

@@ -1041,24 +1041,73 @@
 oid-luni%22),%0A
+        realAndroidDependency(%22android-policy%22),%0A
         crea

Add android-policy jar to dependencies. This needs to be uploaded to maven central.