-
Notifications
You must be signed in to change notification settings - Fork 201
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
Please also check buildSrc #284
Comments
Ah, louis showed the way to go without having to change the plugin class implementation or interface: task buildSrcDependencyUpdates(type: GradleBuild) {
def dependencyUpdatesInitScript = file("$temporaryDir/dependencyUpdates-init.gradle")
dir 'buildSrc'
tasks = ['dependencyUpdates']
startParameter.addInitScript dependencyUpdatesInitScript
doFirst {
dependencyUpdatesInitScript.text = '''
import com.github.benmanes.gradle.versions.VersionsPlugin
initscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
}
}
rootProject {
apply plugin: VersionsPlugin
}
'''.stripIndent().trim()
}
}
dependencyUpdates.dependsOn buildSrcDependencyUpdates My other points about |
This issue blocks projects from applying good practices of sharing build logic between subprojects (i.e., convention plugins). Gradle currently suggests to stop putting all your plugins into the root build.gradle and instead create your own plugins in buildSrc/ that apply what is needed. This means that an officially recommended good practice is a blind spot of this plugin. If you have your build structured as in Applying an external plugin in precompiled script plugin then gradle-versions-plugin won't check SpotBugs at all. |
I also ran into this problem. So I extract dependencies from https://github.com/linqu-tech/webpb/pull/24/files Just provide an idea. |
…rsion catalog into buildSrc
+1 for this issue... for yet another simple workaround, see VirtusLab/git-machete-intellij-plugin#1013 (basically, treat |
…rsion catalog into buildSrc
…rsion catalog into buildSrc
…rsion catalog into buildSrc
…rsion catalog into buildSrc
…rsion catalog into buildSrc
+1, it would be very handy 🙏 |
You also need to set
|
The buildSrc project is an integral part of a build and it would be nice if your version checks could also be done there automatically.
As a manual workaround I thought about something along the lines of this you could use to get inspired:
Unfortunately it does not work.
I guess the problem is because the project script classpath cannot be modified at the point the closure is applied (reported at gradle/gradle#8173 as the error is not really meaningful).
So I'd say the best chance to nicely support this is, if you either add a second plugin class that implements
Plugin<Gradle>
, or changing the existing plugin class to implementPlugin<PluginAware>
which would cover both (andSettings
actually).Then I think you could do something along the lines of
Of course it needs some more love, like
resolutionStrategy
buildSrc
sub-result with an own section in the default reportsAs a manual work-around I have now applied and configured the plugin manually on the
buildSrc
build and addedto the parent build, so I just now get two reports, but having this nicely integrated and automatic would be much nicer of course.
The text was updated successfully, but these errors were encountered: