aboutsummaryrefslogtreecommitdiff
path: root/buildSrc
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@google.com>2017-05-24 17:12:19 -0700
committerMichael Hoisie <hoisie@google.com>2017-05-24 17:12:19 -0700
commit00044246bb048848ff8badef84c35290a52dd1af (patch)
tree60b2c891f21aa4461d7851ce225a2208ae0f98ab /buildSrc
parent9180d7df8d0ba0ba418ac69c67e142148a27f553 (diff)
downloadrobolectric-shadows-00044246bb048848ff8badef84c35290a52dd1af.tar.gz
Update RoboJavaModulePlugin to use Java 8
Previously, RoboJavaModulePlugin declared VERSION_1_7 for both sourceCompatibility and targetCompatibility. Now that Robolectric only supports Java 8, the source and target compatibility can be updated to 8. This allows Robolectric to use Java 8 features such as lambda expressions and method references. The main changes involved uses of AssertJ's generic assertThat method. Java 8 has improved type inference, so the compiler complained about assertions where it could not infer the type.
Diffstat (limited to 'buildSrc')
-rw-r--r--buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy b/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy
index 246180efe..36a0d1bc6 100644
--- a/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy
@@ -10,12 +10,12 @@ class RoboJavaModulePlugin implements Plugin<Project> {
Closure doApply = {
apply plugin: "java"
- sourceCompatibility = JavaVersion.VERSION_1_7
- targetCompatibility = JavaVersion.VERSION_1_7
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
tasks.withType(JavaCompile) { task ->
- sourceCompatibility = JavaVersion.VERSION_1_7
- targetCompatibility = JavaVersion.VERSION_1_7
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
// Show all warnings except boot classpath
configure(options) {