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

Android: Remove Invoke Dynamic Call #631

Open
wants to merge 1 commit into
base: GROOVY_2_4_X
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gradle/assemble.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ allprojects {
if (isRootProject) {
zipfileset(src: rootProject.configurations.runtime.files.find { it.name.startsWith('openbeans') }, excludes: 'META-INF/*')
}
zap pattern: 'org.codehaus.groovy.vmplugin.v7.IndyInterface'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normally the Groovy version, that does not use indy, means indy is not used for Groovy itself, but the user can still use it. You pullrequest will mean that this is no longer possible. You have to at least also add the Java7 class, or else there will be class loading trouble. And the instantiation of that class would have to change. A bigger problem are the classes from org.codehaus.groovy.classgen.asm.indy, which do reference this class as well. Without further steps the groovy runtime and the compiler would get into trouble on a Java7 JVM or higher.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about having two android jars one without classes that use invoke dynamic and one with them still?

It looks like Android will be supporting it on ap's 26+. The issue is that Google added a check for classes using the invoke-polymorphic. Little more info here. https://issuetracker.google.com/issues/37567710

I am able to use proguard to remove the classes that cause the failure, but it increases build times greatly.

rule pattern: 'com.googlecode.openbeans.**', result: 'groovyjarjaropenbeans.@1'
rule pattern: 'org.apache.harmony.beans.**', result: 'groovyjarjarharmonybeans.@1'
rule pattern: 'java.beans.**', result: 'groovyjarjaropenbeans.@1'
Expand Down