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

In a multi module Gradle project, ignore root project by default #32

Closed
chao2zhang opened this issue Dec 25, 2020 · 5 comments
Closed

Comments

@chao2zhang
Copy link
Contributor

Observed Behavior

In a multi-module Gradle project, after running apiDump, the file api/<projectName>.api will appear with a blank line.

Current workaround

I need to specifically ignore the root projects to avoid the creation of this file. This looks quite unnecessary:

For example,

apiValidation {
    ignoredProjects.addAll(subprojects.filter { it.name != "detekt-api"}.map { it.name } + rootProject.name)
}

Environment

The project uses a buildSrc and all scripts are in kts.

@cortinico
Copy link
Contributor

In a multi-module Gradle project, after running apiDump, the file api/<projectName>.api will appear with a blank line.

I applied this plugin in several multi-module projects and I never had this behavior (e.g. ChuckerTeam/chucker#509). Could it be related to a problem on Detekt's top level Gradle module?

@chao2zhang
Copy link
Contributor Author

Good point. Yes I definitely found that there is a top-level apiDump task for Detekt, but not for chucker

~/detekt(api*) » ./gradlew tasks --all | grep apiDump
apiDump - Syncs API from build dir to api dir for detekt
custom-checks:apiDump - Syncs API from build dir to api dir for custom-checks
detekt-api:apiDump - Syncs API from build dir to api dir for detekt-api
detekt-cli:apiDump - Syncs API from build dir to api dir for detekt-cli
detekt-core:apiDump - Syncs API from build dir to api dir for detekt-core
detekt-formatting:apiDump - Syncs API from build dir to api dir for detekt-formatting
detekt-generator:apiDump - Syncs API from build dir to api dir for detekt-generator
detekt-gradle-plugin:apiDump - Syncs API from build dir to api dir for detekt-gradle-plugin
detekt-metrics:apiDump - Syncs API from build dir to api dir for detekt-metrics
detekt-parser:apiDump - Syncs API from build dir to api dir for detekt-parser
detekt-psi-utils:apiDump - Syncs API from build dir to api dir for detekt-psi-utils
detekt-report-html:apiDump - Syncs API from build dir to api dir for detekt-report-html
detekt-report-sarif:apiDump - Syncs API from build dir to api dir for detekt-report-sarif
detekt-report-txt:apiDump - Syncs API from build dir to api dir for detekt-report-txt
detekt-report-xml:apiDump - Syncs API from build dir to api dir for detekt-report-xml
detekt-rules:apiDump - Syncs API from build dir to api dir for detekt-rules
detekt-rules-complexity:apiDump - Syncs API from build dir to api dir for detekt-rules-complexity
detekt-rules-coroutines:apiDump - Syncs API from build dir to api dir for detekt-rules-coroutines
detekt-rules-documentation:apiDump - Syncs API from build dir to api dir for detekt-rules-documentation
detekt-rules-empty:apiDump - Syncs API from build dir to api dir for detekt-rules-empty
detekt-rules-errorprone:apiDump - Syncs API from build dir to api dir for detekt-rules-errorprone
detekt-rules-exceptions:apiDump - Syncs API from build dir to api dir for detekt-rules-exceptions
detekt-rules-naming:apiDump - Syncs API from build dir to api dir for detekt-rules-naming
detekt-rules-performance:apiDump - Syncs API from build dir to api dir for detekt-rules-performance
detekt-rules-style:apiDump - Syncs API from build dir to api dir for detekt-rules-style
detekt-sample-extensions:apiDump - Syncs API from build dir to api dir for detekt-sample-extensions
detekt-test:apiDump - Syncs API from build dir to api dir for detekt-test
detekt-test-utils:apiDump - Syncs API from build dir to api dir for detekt-test-utils
detekt-tooling:apiDump - Syncs API from build dir to api dir for detekt-tooling
~/chucker(develop) » ./gradlew tasks --all | grep apiDump 
library:apiDump - Syncs API from build dir to api dir for library
library-no-op:apiDump - Syncs API from build dir to api dir for library-no-op

@chao2zhang
Copy link
Contributor Author

I did some further investigation and it is indeed that we have applied kotlin.jvm at the root project, but at the same time, I was wondering if there is no signature generated, should we even write the API file?

@cortinico
Copy link
Contributor

So seems like we can close this @chao2zhang ?

@chao2zhang
Copy link
Contributor Author

Good point.

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

No branches or pull requests

2 participants