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

Warnings for other subprojects when building just one subproject #53

Open
C-Otto opened this issue Jul 21, 2020 · 4 comments
Open

Warnings for other subprojects when building just one subproject #53

C-Otto opened this issue Jul 21, 2020 · 4 comments
Assignees
Milestone

Comments

@C-Otto
Copy link
Contributor

C-Otto commented Jul 21, 2020

When building a single subproject ./gradlew aaa:build I get the following warning for each subproject, aside from the one I'm building. I expect to only receive warnings related to subproject aaa.

WARNING: Due to the absence of 'LifecycleBasePlugin' on project ':bbb' the task ':cpdCheck' could not be added to task graph. Therefore CPD will not be executed. To prevent this, manually add a task dependency of ':cpdCheck' to a 'check' task of a subproject.
1) Directly to project ':aaa':
    check.dependsOn(':cpdCheck')
2) Indirectly, e.g. via project ':bbb:
    project(':aaa') {
        plugins.withType(LifecycleBasePlugin) { // <- just required if 'java' plugin is applied within subproject
            check.dependsOn(cpdCheck)
        }
    }

I'm using Gradle 6.6 RC2. Some relevant parts of my build.gradle (in root project):

plugins {
    id 'de.aaschmid.cpd' version '3.1' apply false
}
evaluationDependsOnChildren()

configure(subprojects.findAll { it.name != 'xxx' }) {
    apply plugin: 'java'
    apply plugin: 'de.aaschmid.cpd'

    check.dependsOn(cpdCheck)

    cpdCheck {
        source = sourceSets.main.allJava // do not run for test code
    }
}
@aaschmid
Copy link
Owner

The error is logged in CpdPlugin here and the problem is that I check if the cpdCheck task is on the task graph for every project on which cpd plugin is applied ...

So I need to change this check. The question is how as I can always think of situations where this warning is either false positive or false negative :-(
E.g. if looking for project's check task graph, one could want it on build.

Maybe I will remove this entirely and make it more prominent in the documentation.

If anyone has some hints / points on it, I would be very grateful hearing them.

@aaschmid aaschmid self-assigned this Jul 27, 2020
@aaschmid aaschmid added this to the next version milestone Jul 27, 2020
@C-Otto
Copy link
Contributor Author

C-Otto commented Jul 28, 2020

In my understanding you want to log a helpful message to tell the user about a configuration issue (missing dependsOn?). If this is correct, I suggest to just drop this altogether. Instead, provide some documentation/examples, and maybe add a few examples that can be used to test the plugin.

@aaschmid aaschmid modified the milestones: v3.2, next version Mar 28, 2021
@C-Otto
Copy link
Contributor Author

C-Otto commented Apr 15, 2021

This is creating lots of output when running gradle in continuous mode, to the point that I had to disable the plugin.

@Lucas3oo
Copy link

+1 this bug is super annoying

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

No branches or pull requests

3 participants