Hi all, I have defined additional sourceset in sub...
# community-support
a
Hi all, I have defined additional sourceset in subproject like the following code
Copy code
sourceSets {
    testannotations {
        java {
            srcDirs = ['src/testannotations/java']
        }
    }
}
and I want to use it in my root project as a variable
Copy code
def javadocDirs = [
    project(':checker').sourceSets.testannotations.allJava,
]
I got the following error
Copy code
* What went wrong:
A problem occurred evaluating root project 'checker-framework'.
> Could not get unknown property 'testannotations' for SourceSet container of type org.gradle.api.internal.tasks.DefaultSourceSetContainer.
Any idea to fix it?
v
You should never reach into other projects models like that. That is even worse than cross-project configuration. See https://docs.gradle.org/current/userguide/cross_project_publications.html for how to share something from one project to another properly