Last active
August 29, 2015 14:10
-
-
Save eccyan/52377e8fd57fd34840f0 to your computer and use it in GitHub Desktop.
λ... < ユニットテストのテストコード上で Retrolambda が使えない ref: http://qiita.com/eccyan/items/400a60da44d1d603380b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks.withType(Test) { | |
project.tasks | |
.findAll { task -> (task.name ==~ /compileTest.*Java/) } | |
.each { task -> | |
task.doFirst { | |
def buildPath = "$project.buildDir/retrolambda" | |
def jarPath = "$buildPath/$project.android.compileSdkVersion" | |
def javac = "${project.retrolambda.tryGetJdk()}/bin/javac" | |
sourceCompatibility = JavaVersion.VERSION_1_8 | |
targetCompatibility = JavaVersion.VERSION_1_8 | |
options.fork = true | |
options.compilerArgs += ["-bootclasspath", "$jarPath/android.jar"] | |
options.forkOptions.executable = javac | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test.java:61: error: illegal start of expression | |
.filter(state -> state != State.UNINITIALIZED) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An exception has occurred in the compiler (1.8.0_25). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. | |
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23:14:30.815 [DEBUG] [org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler] Compiler arguments: -d /app/build/test-classes/debug -g -encoding UTF-8 -bootclasspath /Applications/android-sdk/platforms/android-21/android.jar -classpath | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test > initializationError FAILED | |
java.lang.UnsupportedClassVersionError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment