Use a version of json-simple that does not pull in junit and hamcrest. We ended up packaging junit and hamcrest in our jar for no reason. The dependency is coming from json-simple. Going to version 1.1 instead of 1.1.1 removes the dependency. Additionally, always use org.junit and not junit.framework. R=herhut@google.com Bug: Change-Id: I4fdc214d0cbf73d50af94acb1116e4688019e52b
diff --git a/build.gradle b/build.gradle index 78e7e94..63513ce 100644 --- a/build.gradle +++ b/build.gradle
@@ -114,7 +114,7 @@ dependencies { compile 'net.sf.jopt-simple:jopt-simple:4.6' - compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'com.googlecode.json-simple:json-simple:1.1' compile group: 'com.google.guava', name: 'guava', version: '19.0' compile group: 'it.unimi.dsi', name: 'fastutil', version: '7.2.0' compile group: 'org.apache.commons', name: 'commons-compress', version: '1.12' @@ -333,11 +333,8 @@ relocate 'joptsimple', 'com.android.tools.r8.joptsimple' relocate 'org.apache.commons', 'com.android.tools.r8.org.apache.commons' relocate 'org.objectweb.asm', 'com.android.tools.r8.org.objectweb.asm' - relocate 'org.junit', 'com.android.tools.r8.org.junit' - relocate 'org.hamcrest', 'com.android.tools.r8.org.hamcrest' relocate 'org.json.simple', 'com.android.tools.r8.org.json.simple' relocate 'it.unimi.dsi.fastutil', 'com.android.tools.r8.it.unimi.dsi.fastutil' - relocate 'junit', 'com.android.tools.r8.junit' // Also include dependencies configurations = [project.configurations.compile] } @@ -361,11 +358,8 @@ relocate 'joptsimple', 'com.android.tools.r8.joptsimple' relocate 'org.apache.commons', 'com.android.tools.r8.org.apache.commons' relocate 'org.objectweb.asm', 'com.android.tools.r8.org.objectweb.asm' - relocate 'org.junit', 'com.android.tools.r8.org.junit' - relocate 'org.hamcrest', 'com.android.tools.r8.org.hamcrest' relocate 'org.json.simple', 'com.android.tools.r8.org.json.simple' relocate 'it.unimi.dsi.fastutil', 'com.android.tools.r8.it.unimi.dsi.fastutil' - relocate 'junit', 'com.android.tools.r8.junit' // Also include dependencies configurations = [project.configurations.compile] }
diff --git a/src/test/java/com/android/tools/r8/internal/R8GMSCoreLookupTest.java b/src/test/java/com/android/tools/r8/internal/R8GMSCoreLookupTest.java index f88ea49..74e4e9b 100644 --- a/src/test/java/com/android/tools/r8/internal/R8GMSCoreLookupTest.java +++ b/src/test/java/com/android/tools/r8/internal/R8GMSCoreLookupTest.java
@@ -3,9 +3,9 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.internal; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import com.android.tools.r8.dex.ApplicationReader; import com.android.tools.r8.graph.AppInfoWithSubtyping;
diff --git a/src/test/java/com/android/tools/r8/internal/R8GMSCoreTreeShakeJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/R8GMSCoreTreeShakeJarVerificationTest.java index efa812a..8c72ddd 100644 --- a/src/test/java/com/android/tools/r8/internal/R8GMSCoreTreeShakeJarVerificationTest.java +++ b/src/test/java/com/android/tools/r8/internal/R8GMSCoreTreeShakeJarVerificationTest.java
@@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.internal; -import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertTrue; import com.android.tools.r8.CompilationException; import com.android.tools.r8.CompilationMode;
diff --git a/src/test/java/com/android/tools/r8/ir/regalloc/IdenticalAfterRegisterAllocationTest.java b/src/test/java/com/android/tools/r8/ir/regalloc/IdenticalAfterRegisterAllocationTest.java index 08e90c0..6eebf6b 100644 --- a/src/test/java/com/android/tools/r8/ir/regalloc/IdenticalAfterRegisterAllocationTest.java +++ b/src/test/java/com/android/tools/r8/ir/regalloc/IdenticalAfterRegisterAllocationTest.java
@@ -3,8 +3,8 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.ir.regalloc; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import com.android.tools.r8.ir.code.Add; import com.android.tools.r8.ir.code.ConstNumber;
diff --git a/src/test/java/com/android/tools/r8/jasmin/InvalidClassNames.java b/src/test/java/com/android/tools/r8/jasmin/InvalidClassNames.java index 671698b..813ea1b 100644 --- a/src/test/java/com/android/tools/r8/jasmin/InvalidClassNames.java +++ b/src/test/java/com/android/tools/r8/jasmin/InvalidClassNames.java
@@ -3,9 +3,9 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.jasmin; -import static junit.framework.Assert.assertNull; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.fail; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import com.android.tools.r8.ToolHelper; import com.android.tools.r8.errors.CompilationError;
diff --git a/src/test/java/com/android/tools/r8/jasmin/InvalidFieldNames.java b/src/test/java/com/android/tools/r8/jasmin/InvalidFieldNames.java index 87d350c..4710e69 100644 --- a/src/test/java/com/android/tools/r8/jasmin/InvalidFieldNames.java +++ b/src/test/java/com/android/tools/r8/jasmin/InvalidFieldNames.java
@@ -3,9 +3,9 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.jasmin; -import static junit.framework.Assert.assertNull; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.fail; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import com.android.tools.r8.errors.CompilationError; import java.util.Arrays;
diff --git a/src/test/java/com/android/tools/r8/jasmin/InvalidMethodNames.java b/src/test/java/com/android/tools/r8/jasmin/InvalidMethodNames.java index e1ace71..cbf40a2 100644 --- a/src/test/java/com/android/tools/r8/jasmin/InvalidMethodNames.java +++ b/src/test/java/com/android/tools/r8/jasmin/InvalidMethodNames.java
@@ -3,11 +3,10 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.jasmin; -import static junit.framework.Assert.assertNull; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.fail; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; -import com.android.tools.r8.CompilationException; import com.android.tools.r8.errors.CompilationError; import com.google.common.collect.ImmutableList; import java.util.Arrays;
diff --git a/src/test/java/com/android/tools/r8/shaking/R8Shaking2LookupTest.java b/src/test/java/com/android/tools/r8/shaking/R8Shaking2LookupTest.java index be28b38..0ab229f 100644 --- a/src/test/java/com/android/tools/r8/shaking/R8Shaking2LookupTest.java +++ b/src/test/java/com/android/tools/r8/shaking/R8Shaking2LookupTest.java
@@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.shaking; -import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse;
diff --git a/src/test/java/com/android/tools/r8/utils/R8InliningTest.java b/src/test/java/com/android/tools/r8/utils/R8InliningTest.java index 7f3c3e1..7af5708 100644 --- a/src/test/java/com/android/tools/r8/utils/R8InliningTest.java +++ b/src/test/java/com/android/tools/r8/utils/R8InliningTest.java
@@ -3,8 +3,8 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.utils; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import com.android.tools.r8.CompilationException; import com.android.tools.r8.R8Command;