-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
Check jcenter repository present in Gradle plugin #2550
Check jcenter repository present in Gradle plugin #2550
Conversation
Whenever the plugin is applied to a project that doesn't have jcenter() configured, the user would get a cryptic error message from Gradle (see issue detekt#2549). This simple change makes sure the plugin will provide users with clear instructions on how to fix their build so they don't get stumped when things don't work.
Also update repo URL to /pinterest/ktlint through out docs
This is necessary because we need to make sure it's there _somehow_, and it may be added by other plugins, or blocks evaluated after this plugin is applied.
Codecov Report
@@ Coverage Diff @@
## master #2550 +/- ##
============================================
+ Coverage 25.20% 26.89% +1.68%
+ Complexity 392 390 -2
============================================
Files 376 377 +1
Lines 7355 6671 -684
Branches 1206 1207 +1
============================================
- Hits 1854 1794 -60
+ Misses 5370 4746 -624
Partials 131 131
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the docs as well as investigating and fixing the jcenter issue with a better error description! Lgtm!
...kt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/GradleProjectChecks.kt
Outdated
Show resolved
Hide resolved
...kt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/GradleProjectChecks.kt
Outdated
Show resolved
Hide resolved
Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>
Is there any way to disable this? Currently using Nexus with a proxy jcenter repository. |
No, but it's just a log message. It doesn't stop the build in and by itself. |
🤔 I know nearly nothing about gradle plugins but... Could we launch this message only if it fails? As a hint about what could be happening? |
To be able to do that you'd have to check if the dependency is available on the classpath of the modules after the project is synced... possibly doable but a bit beyond my Gradle knowledge :) |
We use a maven proxy so this disallows us from upgrading. I'll file a new issue. |
Again, the plugin will work just fine, it's just emitting a log entry that you can ignore. |
I understand, but in our app with over 100 modules its printed to the console over 100 times as an "error". Let's keep the discussion going on this issue: #2571 (comment) |
This PR fixes #2549 by adding a log when the user doesn't have
jcenter()
configured in their project, by emitting an error with a clear warning and resolution instructions.I have run all the tests in the project and smoke tested the plugin locally.