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

[WIP] Read android sources #291

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

wbonnefond
Copy link

This is a very rough WIP of attempting to read sources from Android modules.

@@ -74,15 +76,15 @@ java {
}

tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
options.release.set(11)
Copy link
Author

Choose a reason for hiding this comment

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

So we can add AGP and get sourcesets defined by the plugin. AGP can't compile against java 8. Would need to rework this to probably use reflection for android projects if we don't want to bump version/include AGP.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed let's not bump the required version, as that affects all our users, and there's a lot of code using Java 8 that still needs to be converted. For that same reason we still support Gradle 4.10, as much as we're aware of benefits to future versions.


val variants = subproject.extensions.findByType(BaseExtension::class.java)?.variants ?: return Stream.empty<SourceFile>() to 0

val sources = variants.map { variant ->
Copy link
Author

Choose a reason for hiding this comment

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

Each gradle module can have multiple variants, and each variant can have multiple sourcesets. variant.sourceSets is not a list of org.gradle.api.tasks.SourceSet's, so the existing parsing code can't be shared. It is a list of SourceProvider's

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

Successfully merging this pull request may close these issues.

Support Android sourcesets as defined by the Android Gradle Plugin
2 participants