am 1a848650: am 8f312e0c: Merge "Switch from core to core-libart"

* commit '1a8486507e3feb42078ca2581404700a65110f0a':
  Switch from core to core-libart
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..6e0a62e
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,57 @@
+apply plugin: 'java'
+
+configurations {
+    // similar to 'default', export compile-time dependencies
+    host.extendsFrom(hostCompile)
+    target.extendsFrom(targetCompile)
+}
+
+sourceSets {
+    host {
+        java {
+            srcDirs = ['src']
+        }
+    }
+
+    target {
+        java {
+            srcDirs = ['src']
+            include 'org/**',
+                    'junit/extensions/**',
+                    // remove these packages since they are in android.test.runner
+                    // and proguard complains if they are present
+                    // 'junit/runner/**',
+                    // 'junit/textui/**',
+                    'junit/framework/ComparisonCompactor.java',
+                    'junit/framework/JUnit4TestAdapterCache.java',
+                    'junit/framework/JUnit4TestAdapter.java',
+                    'junit/framework/JUnit4TestCaseFacade.java'
+        }
+    }
+}
+
+dependencies {
+    targetCompile getAndroidPrebuilt('4')
+    targetCompile project(':hamcrest')
+
+    hostCompile project(':hamcrest')
+}
+
+task targetJar(type: Jar) {
+    from sourceSets.target.output
+    dependsOn targetClasses
+    baseName "junit4"
+    classifier "target"
+}
+
+task hostJar(type: Jar) {
+    from sourceSets.host.output
+    dependsOn hostClasses
+    baseName "junit4"
+    classifier "host"
+}
+
+artifacts {
+    host hostJar
+    target targetJar
+}
diff --git a/src/org/junit/experimental/theories/internal/package.html b/src/org/junit/experimental/theories/internal/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/experimental/theories/internal/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/builders/package.html b/src/org/junit/internal/builders/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/builders/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/matchers/package.html b/src/org/junit/internal/matchers/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/matchers/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/package.html b/src/org/junit/internal/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/requests/package-info.java b/src/org/junit/internal/requests/package-info.java
index 66d2928..493f21a 100644
--- a/src/org/junit/internal/requests/package-info.java
+++ b/src/org/junit/internal/requests/package-info.java
@@ -2,5 +2,6 @@
  * Provides implementations of {@link org.junit.runner.Request}.
  *
  * @since 4.0
+ * @hide
  */
-package org.junit.internal.requests;
\ No newline at end of file
+package org.junit.internal.requests;
diff --git a/src/org/junit/internal/requests/package.html b/src/org/junit/internal/requests/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/requests/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/runners/JUnit38ClassRunner.java b/src/org/junit/internal/runners/JUnit38ClassRunner.java
index 11c7a53..0028d0c 100644
--- a/src/org/junit/internal/runners/JUnit38ClassRunner.java
+++ b/src/org/junit/internal/runners/JUnit38ClassRunner.java
@@ -7,7 +7,6 @@
 import junit.framework.TestListener;
 import junit.framework.TestResult;
 import junit.framework.TestSuite;
-
 import org.junit.runner.Describable;
 import org.junit.runner.Description;
 import org.junit.runner.Runner;
@@ -19,10 +18,6 @@
 import org.junit.runner.notification.Failure;
 import org.junit.runner.notification.RunNotifier;
 
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
 public class JUnit38ClassRunner extends Runner implements Filterable, Sortable {
 	private final class OldTestClassAdaptingListener implements
 			TestListener {
@@ -71,7 +66,7 @@
 	}
 
 	private Test fTest;
-
+	
 	public JUnit38ClassRunner(Class<?> klass) {
 		this(new TestSuite(klass.asSubclass(TestCase.class)));
 	}
@@ -91,7 +86,7 @@
 	public TestListener createAdaptingListener(final RunNotifier notifier) {
 		return new OldTestClassAdaptingListener(notifier);
 	}
-
+	
 	@Override
 	public Description getDescription() {
 		return makeDescription(getTest());
@@ -100,9 +95,7 @@
 	private static Description makeDescription(Test test) {
 		if (test instanceof TestCase) {
 			TestCase tc= (TestCase) test;
-			// android-changed - add getAnnotations(test) call
-			return Description.createTestDescription(tc.getClass(), tc.getName(),
-					getAnnotations(tc));
+			return Description.createTestDescription(tc.getClass(), tc.getName());
 		} else if (test instanceof TestSuite) {
 			TestSuite ts= (TestSuite) test;
 			String name= ts.getName() == null ? createSuiteDescription(ts) : ts.getName();
@@ -125,25 +118,6 @@
 		}
 	}
 
-	// android-changed added to support annotation filtering
-	/**
-	 * Get the annotations associated with given TestCase.
-	 * @param test
-	 * @return
-	 */
-	private static Annotation[] getAnnotations(TestCase test) {
-		try {
-			Method m = test.getClass().getMethod(test.getName());
-			return m.getDeclaredAnnotations();
-		} catch (SecurityException e) {
-			e.printStackTrace();
-		} catch (NoSuchMethodException e) {
-			e.printStackTrace();
-		}
-		return new Annotation[0];
-	}
-	// android-changed end
-
 	private static String createSuiteDescription(TestSuite ts) {
 		int count= ts.countTestCases();
 		String example = count == 0 ? "" : String.format(" [example: %s]", ts.testAt(0));
@@ -156,7 +130,7 @@
 			adapter.filter(filter);
 		} else if (getTest() instanceof TestSuite) {
 			TestSuite suite= (TestSuite) getTest();
-			TestSuite filtered= createCopyOfSuite(suite);
+			TestSuite filtered= new TestSuite(suite.getName());
 			int n= suite.testCount();
 			for (int i= 0; i < n; i++) {
 				Test test= suite.testAt(i);
@@ -164,11 +138,6 @@
 					filtered.addTest(test);
 			}
 			setTest(filtered);
-			// android-changed: handle empty suite
-			if (filtered.testCount() == 0) {
-				throw new NoTestsRemainException();
-			}
-			// android-changed end
 		}
 	}
 
@@ -183,16 +152,7 @@
 		fTest = test;
 	}
 
-	// android-changed changed visibility to protected
-	protected Test getTest() {
+	private Test getTest() {
 		return fTest;
 	}
-
-	// android-changed added
-	/**
-	 * Creates a shallow copy of given {@link TestSuite}.
-	 */
-	protected TestSuite createCopyOfSuite(TestSuite suite) {
-		return new TestSuite(suite.getName());
-	}
 }
diff --git a/src/org/junit/internal/runners/model/package.html b/src/org/junit/internal/runners/model/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/runners/model/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/runners/package-info.java b/src/org/junit/internal/runners/package-info.java
index 5ab7e7b..8ee0e61 100644
--- a/src/org/junit/internal/runners/package-info.java
+++ b/src/org/junit/internal/runners/package-info.java
@@ -2,5 +2,6 @@
  * Provides implementations of {@link org.junit.runner.Runner}
  *
  * @since 4.0
+ * @hide
  */
-package org.junit.internal.runners;
\ No newline at end of file
+package org.junit.internal.runners;
diff --git a/src/org/junit/internal/runners/package.html b/src/org/junit/internal/runners/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/runners/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/runners/rules/package.html b/src/org/junit/internal/runners/rules/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/runners/rules/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>
diff --git a/src/org/junit/internal/runners/statements/package.html b/src/org/junit/internal/runners/statements/package.html
new file mode 100644
index 0000000..1c9bf9d
--- /dev/null
+++ b/src/org/junit/internal/runners/statements/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    {@hide}
+</body>
+</html>