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 #2030 : DOCS Added reference to requirements to Java 8 support in Android #2031

Conversation

JuanMorenoDeveloper
Copy link

@JuanMorenoDeveloper JuanMorenoDeveloper commented Aug 30, 2020

Hi Guys

This is my first contribution here, let me know if this can be improved in some way.

check list

  • Read the contributing guide
  • PR should be motivated, i.e. what does it fix, why, and if relevant how
  • If possible / relevant include an example in the description, that could help all readers
    including project members to get a better picture of the change
  • Avoid other runtime dependencies
  • Meaningful commit history ; intention is important please rebase your commit history so that each
    commit is meaningful and help the people that will explore a change in 2 years
  • The pull request follows coding style
  • Mention Fixes #<issue number> in the description if relevant
  • At least one commit should mention Fixes #<issue number> if relevant

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2020

Codecov Report

Merging #2031 into release/3.x will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/3.x    #2031      +/-   ##
=================================================
+ Coverage          84.88%   84.91%   +0.02%     
  Complexity          2703     2703              
=================================================
  Files                325      325              
  Lines               8198     8198              
  Branches             979      979              
=================================================
+ Hits                6959     6961       +2     
  Misses               968      968              
+ Partials             271      269       -2     
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/mockito/Mockito.java 91.02% <ø> (ø) 55.00 <0.00> (ø)
...to/internal/util/concurrent/WeakConcurrentMap.java 41.48% <0.00%> (+2.12%) 11.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8b1565...ec000cf. Read the comment docs.

@raphw
Copy link
Member

raphw commented Aug 30, 2020

We kind of resolved this but got stuck on the Objenesis version. I think the best way to address this is the fixation of the Objenesis version for the mockito-android bundle as suggested elsewhere.

@JuanMorenoDeveloper
Copy link
Author

JuanMorenoDeveloper commented Aug 30, 2020

Great @raphw. Do you refer to set objenesis version to 2.6 in the android module?

@raphw
Copy link
Member

raphw commented Aug 30, 2020

Yes, I think that's the way to go. Setting these requirements gives the wrong impression since it can be so easily avoided.

@JuanMorenoDeveloper
Copy link
Author

Ok, well, I think that with something like this it could be fixed:
In dependencies.gradle:
libraries.objenesisCompatibleAndroid = '2.6'
In android.gradle:

dependencies {
    compile project.rootProject
    compile libraries.bytebuddyandroid
    compile("org.objenesis:objenesis") {
        version {
            strictly libraries.objenesisCompatibleAndroid
        }
        because("MethodHandle class dependency breaks on Android with minSdkVersion<26")
    }
}

Also the output of ./gradlew -q dependencies for the android module show this:

compileClasspath - Compile classpath for source set 'main'.
+--- project :
|    +--- net.bytebuddy:byte-buddy:1.10.13
|    +--- net.bytebuddy:byte-buddy-agent:1.10.13
|    \--- org.objenesis:objenesis:3.1 -> 2.6
+--- net.bytebuddy:byte-buddy-android:1.10.13
|    +--- net.bytebuddy:byte-buddy:1.10.13
|    \--- com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3
\--- org.objenesis:objenesis:{strictly 2.6} -> 2.6

If you are ok with this, I can send it on a new PR.

@TimvdLippe
Copy link
Contributor

@earth001 Thanks for your investigation! We have a PR open already (#2024) could you take a look at that? Also ping @raphw for reviewing that one, it is fine by me to be merged.

@JuanMorenoDeveloper
Copy link
Author

@TimvdLippe Thanks for pointing me that! also that PR looks more complete. So, I think this PR is not needed.

If you like I can add a small reference to Java 8 requirements for Android in the previous paragraph, something like:

... on Android due to limitations in the Android VM (See Java 8 support).

If you think is not necessary I can close the PR instead.

@JuanMorenoDeveloper
Copy link
Author

Hi guys, I see the PR #2024 was already merged. What do you think about this one?
In my point of view, It would be helpful to add a reference to the limitations of Java Android VM.

@TimvdLippe
Copy link
Contributor

It is a well-known limitation of the Android VMs, so I don't think it is necessary. The build system should prevent users from building the project and they will see an explanatory message. I would therefore like to wait with adding additional documentation. If there is further confusion, we could add a clarifying message to our main documentation indeed.

@JuanMorenoDeveloper
Copy link
Author

Nice @TimvdLippe , so I close this one. Please let me know if there something I can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants