Gradle で JaCoCo と JMockit をいい感じに共存させる
This file contains 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
// 必要そうな部分のみ抜粋 | |
// とりあえず LinkageError 例外は飛んでこない | |
// JaCoCo | |
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion = "0.7.2.201409121644" | |
} | |
jacocoTestReport.doFirst{ | |
classDirectories = files('build/classes/main/myproject') | |
} | |
// JMockit | |
configurations { | |
testJMockit | |
} | |
dependencies { | |
testJMockit 'org.jmockit:jmockit:1.12' | |
testCompile configurations.testJMockit.dependencies | |
} | |
test { | |
jvmArgs "-javaagent:${configurations.testJMockit.asPath}" | |
} | |
/* | |
* 参考: | |
* | |
* JMockit+JaCoCo トラブルあれこれ | |
* http://knjname.hateblo.jp/entry/2014/09/01/042624 | |
* | |
* Cleanest way in Gradle to get the path to a jar file in the gradle dependency cache | |
* http://stackoverflow.com/questions/9577929/cleanest-way-in-gradle-to-get-the-path-to-a-jar-file-in-the-gradle-dependency-ca | |
* Sep 24 '13 at 12:26 Timurの回答 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment