Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2007 : Update objenesis dep to 3.2 #2249

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -84,7 +84,7 @@ dependencies {
compile libraries.bytebuddy, libraries.bytebuddyagent

compileOnly libraries.junit4, libraries.hamcrest, libraries.opentest4j
compile libraries.objenesis3
compile libraries.objenesis

testCompile libraries.asm

Expand Down
4 changes: 1 addition & 3 deletions gradle/dependencies.gradle
Expand Up @@ -26,9 +26,7 @@ libraries.errorproneTestApi = "com.google.errorprone:error_prone_test_helpers:${

libraries.autoservice = "com.google.auto.service:auto-service:1.0-rc7"

// objenesis 3.x fails on android instrumentation test compile. https://github.com/mockito/mockito/issues/2007
libraries.objenesis2 = 'org.objenesis:objenesis:2.6'
libraries.objenesis3 = 'org.objenesis:objenesis:3.1'
libraries.objenesis = 'org.objenesis:objenesis:3.2'

libraries.asm = 'org.ow2.asm:asm:7.0'

Expand Down
23 changes: 1 addition & 22 deletions subprojects/android/android.gradle
Expand Up @@ -3,29 +3,8 @@ description = "Mockito for Android"
apply from: "$rootDir/gradle/java-library.gradle"

dependencies {
compile(project.rootProject) {
exclude group: 'org.objenesis', module: 'objenesis'
}
compile project.rootProject
compile libraries.bytebuddyandroid
compile(libraries.objenesis2) {
version {
strictly '2.6'
}
because(
'\n' +
'MOCKITO DEPENDENCY PROBLEM:\n' +
'\n' +
'Mockito core uses Objenesis 3.x and Objenesis 3.x does not work with android api 25 and below.\n' +
'If you have mockito-core dependency with mockito-android, remove mockito-core.\n' +
'If you have mockito-kotlin, exclude mockito-core.\n' +
'implementation("com.nhaarman.mockitokotlin2:mockito-kotlin") {\n' +
' exclude group: "org.mockito", module: "mockito-core"\n' +
'}\n' +
'For more information please check; \n' +
' https://github.com/mockito/mockito/pull/2024\n' +
' https://github.com/mockito/mockito/pull/2007\n'
)
}
}

tasks.javadoc.enabled = false
2 changes: 1 addition & 1 deletion subprojects/osgi-test/osgi-test.gradle
Expand Up @@ -23,7 +23,7 @@ configurations {
dependencies {
testRuntimeBundles project.rootProject
testRuntimeBundles libraries.bytebuddy
testRuntimeBundles libraries.objenesis3
testRuntimeBundles libraries.objenesis
testRuntimeBundles tasks.testBundle.outputs.files
testRuntimeBundles tasks.otherBundle.outputs.files
}
Expand Down