Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: fixes issue 1346#1347

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dkostyrev wants to merge1 commit intoautonomousapps:main
base:main
Choose a base branch
Loading
fromdkostyrev:android-classes-jar

Conversation

dkostyrev
Copy link

Fixes the issue#1346.

ClassReferenceParser andgetBinaryAPI extension functions now handlejar files as an input alongside with class files. There is a bit of duplication with regard to to reading jar files, maybe it would be better to hide two sources of class files insideAndroidClassesTask by unpacking jars into intermediate directory. I've also added a test that fails without aforementioned fixes, it is a bit verbose because of the actual implementation of the transform task.

Copy link
Owner

@autonomousappsautonomousapps left a comment
edited
Loading

Choose a reason for hiding this comment

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

This looks very reasonable. Thanks for the contribution! Left you a question.

Please note I think you'll have to rebase and fix some (hopefully minor) conflicts after I merge#1349.

@@ -64,6 +64,10 @@ internal fun Iterable<File>.filterToClassFiles(): List<File> {
return filter { it.extension == "class" && !it.name.endsWith("module-info.class") }
}

internal fun Iterable<File>.filterToJarFiles(): List<File> {
return filter { it.extension == "jar" && !it.name.endsWith("R.jar") }

Choose a reason for hiding this comment

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

why are we excludingR.jar?

Copy link
Author

@dkostyrevdkostyrevJan 12, 2025
edited
Loading

Choose a reason for hiding this comment

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

Initially I've excludedR.jar because of the transitive dependencies false positives. For example, if the project usesandroidx.appcompat:appcompat:1.1.0 as a dependency, the plugin would report following transitive dependencies, although none of them were really used:

These transitive dependencies should be declared directly:  implementation 'androidx.activity:activity:1.0.0'  implementation 'androidx.appcompat:appcompat-resources:1.1.0'  implementation 'androidx.core:core:1.1.0'  implementation 'androidx.customview:customview:1.0.0'  implementation 'androidx.drawerlayout:drawerlayout:1.0.0'  implementation 'androidx.fragment:fragment:1.1.0'  implementation 'androidx.loader:loader:1.0.0'  implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'  implementation 'androidx.vectordrawable:vectordrawable:1.1.0'  implementation 'androidx.viewpager:viewpager:1.0.0'

According tousage-dependencies.json this advice was given because ofandroidx.**.R classes in theR.jar:

Uses 11 classes, 5 of which are shown: androidx.core.R, androidx.core.R$attr, androidx.core.R$color, androidx.core.R$dimen, androidx.core.R$drawable

I've dug a bit deeper and find out that the plugin will add inner's class parent name to theExplodedClass.nonAnnotationClasses and vice versa (inner class names will be added to the parent classnonAnnotationClasses),I've added a fix similar to the exclusion of the class own name infixup functions.

Comment on lines -23 to +24
/**Will be empty for this task. */
/**May be empty. */

Choose a reason for hiding this comment

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

Thanks for updating the comment!

Do not ignore R.jar file.Filter parent class name for inner class and vice versa.
@dkostyrev
Copy link
Author

@autonomousapps Hi, could you take a look at this PR please?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@autonomousappsautonomousappsAwaiting requested review from autonomousapps

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@dkostyrev@autonomousapps

[8]ページ先頭

©2009-2025 Movatter.jp