Skip to content

Instantly share code, notes, and snippets.

@ossan-pg
Last active August 29, 2015 14:07
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ossan-pg/597d21f42ef06c89a147 to your computer and use it in GitHub Desktop.
Gradle で JaCoCo と JMockit をいい感じに共存させる
// 必要そうな部分のみ抜粋
// とりあえず 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