I have a big project with hundreds of sub modules. Not all of these sub projects are java sub projects. Jacoco plugin is configured only for java sub projects. All java sub projects have dependency on a 'java-platform' sub project in order to fix dependencies version. The 'java-platform' sub project is not a java sub project and it causes an issue for using includeProjectDependencies. Because the platform sub project does not have any source dir.
My project structure looks like following:
if (config.coverage.jacoco.includeProjectDependencies) {
project.configurations.findByName(testTask.name + 'Implementation').allDependencies.each { d ->
if (d instanceof ProjectDependency) projects << d.dependencyProject
}
project.configurations.findByName(testTask.name + 'RuntimeOnly').allDependencies.each { d ->
if (d instanceof ProjectDependency) projects << d.dependencyProject
}
}
t.additionalSourceDirs.from project.files(resolveSourceDirs(config, projects))
t.additionalClassDirs.from project.files(resolveClassDirs(config, projects))
t.sourceDirectories.from project.files(resolveSourceDirs(config, projects))
t.classDirectories.from project.files(resolveClassDirs(config, projects))
The simple checking logic in this place can cause issue in resolveSourceDirs. Either we have to extend logic in this place or to include logic in resolveSourceDirs (and resolveClassDirs) in order to get rid of different ProjectDependency and only use "java" ProjectDependency
I have a big project with hundreds of sub modules. Not all of these sub projects are java sub projects. Jacoco plugin is configured only for java sub projects. All java sub projects have dependency on a 'java-platform' sub project in order to fix dependencies version. The 'java-platform' sub project is not a java sub project and it causes an issue for using includeProjectDependencies. Because the platform sub project does not have any source dir. My project structure looks like following:
rootProject
Including project dependencies logic does check only "ProjectDependency" and not check about characters of "java" project (see https://docs.gradle.org/current/userguide/java_plugin.html).
The simple checking logic in this place can cause issue in resolveSourceDirs. Either we have to extend logic in this place or to include logic in resolveSourceDirs (and resolveClassDirs) in order to get rid of different ProjectDependency and only use "java" ProjectDependency