You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: the comments below make this WAY too complicated. Solved in blowdryer 1.7.0, docs here.
The biggest unsolved problem for blowdryer is that it can't currently help with setting the versions of third-party plugins. Starting with Gradle 6.0, there is a great way to centralize these:
// settings.gradlepluginManagement {
plugins {
id 'com.diffplug.blowdryer' version '1.0.0'
id 'com.diffplug.blowdryerSetup' version '1.0.0'
id 'foo' version 'bar'...
}
}
plugins {
id 'com.diffplug.blowdryerSetup'// no version necessary
id 'foo' apply false// to use in script plugins, it needs to be declared here...
}
// any build.gradleplugins {
id 'com.diffplug.blowdryer'// no version necessary
}
// or
apply plugin: 'foo'// guaranteed to be present if settings.gradle had `plugins{} apply false`
Easiest thing
The easiest thing would be to have a special plugin-versions.properties file:
com.diffplug.blowdryerSetup toSettings=1.0.0 # 'toSettings' is code forcom.diffplug.blowdryer=1.0.0 # apply to the settings.gradle filefoo=bar # all other plugins will have `apply false`
This could then be applied to the project with blowdryerPluginVersions[Check|Apply], with blowdryerPluginVersionsCheck hooked into check. Within the settings.gradle, the tasks would parse for pluginManagement { plugins { and wipe out everything there, and the same for plugins { below that.
Problem with easiest (A) - fighting over versions
It has to be easy for the user to sync with and override blowdryer. There are three cases:
case
code
blowdryer wants it, I don't
// exclude com.diffplug.foo
I want it, blowdryer doesn't
id 'com.diffplug.foo' version '3.7.0' // extra
I want a different version
id 'com.diffplug.foo' version '3.7.0' // override 3.5.0
All together:
pluginManagement {
plugins {
// exclude com.diffplug.spotless-changelog
id 'com.diffplug.spotless' version '3.27.0'// override 3.25.0
id 'com.diffplug.image-grinder' version '2.1.0'// extra...
Problem with easiest (B) - local would be better
It might be better if each script plugin, rather than doing apply plugin: 'com.diffplug.foo', could instead do 干.applyPlugin('com.diffplug.foo', '1.0.0'), and blowdryer could aggregate these recursively throughout the project into the plugin versions that it requests. That way you're only declaring the plugins you need, and it also makes makes things more modular in general.
However, this can't bootstrap itself - until the plugins have been set, the buildscript will fail, so we won't be able to find out what versions we need. In order to make this work, we would need to first implement #6. If we could read a build.gradle just to the level of "it calls out to these scripts, which call to these scripts", then we could read those for 干.applyPlugin('com.diffplug.foo', '1.0.0'), and bubble all of that back up to the root.
Minimum viable PR
Would be the easiest possible thing, along with an implementation of the "fighting over versions" system. It would be enabled in blowdryerSetup { setPluginVersions() }. In the future, we would still have the option to implement blowdryerSetup { setPluginVersionsLocally() }. It would be fine to jump straight to setPluginVersionsLocally() if #6 has already been implemented and merged. It's also fine if only Groovy or only Kotlin is implemented. Once one is implemented, someone else can finish the other.
The text was updated successfully, but these errors were encountered:
EDIT: the comments below make this WAY too complicated. Solved in blowdryer
1.7.0
, docs here.The biggest unsolved problem for blowdryer is that it can't currently help with setting the versions of third-party plugins. Starting with Gradle 6.0, there is a great way to centralize these:
Easiest thing
The easiest thing would be to have a special
plugin-versions.properties
file:This could then be applied to the project with
blowdryerPluginVersions[Check|Apply]
, withblowdryerPluginVersionsCheck
hooked intocheck
. Within thesettings.gradle
, the tasks would parse forpluginManagement { plugins {
and wipe out everything there, and the same forplugins {
below that.Problem with easiest (A) - fighting over versions
It has to be easy for the user to sync with and override blowdryer. There are three cases:
// exclude com.diffplug.foo
id 'com.diffplug.foo' version '3.7.0' // extra
id 'com.diffplug.foo' version '3.7.0' // override 3.5.0
All together:
Problem with easiest (B) - local would be better
It might be better if each script plugin, rather than doing
apply plugin: 'com.diffplug.foo'
, could instead do干.applyPlugin('com.diffplug.foo', '1.0.0')
, and blowdryer could aggregate these recursively throughout the project into the plugin versions that it requests. That way you're only declaring the plugins you need, and it also makes makes things more modular in general.However, this can't bootstrap itself - until the plugins have been set, the buildscript will fail, so we won't be able to find out what versions we need. In order to make this work, we would need to first implement #6. If we could read a
build.gradle
just to the level of "it calls out to these scripts, which call to these scripts", then we could read those for干.applyPlugin('com.diffplug.foo', '1.0.0')
, and bubble all of that back up to the root.Minimum viable PR
Would be the easiest possible thing, along with an implementation of the "fighting over versions" system. It would be enabled in
blowdryerSetup { setPluginVersions() }
. In the future, we would still have the option to implementblowdryerSetup { setPluginVersionsLocally() }
. It would be fine to jump straight tosetPluginVersionsLocally()
if #6 has already been implemented and merged. It's also fine if only Groovy or only Kotlin is implemented. Once one is implemented, someone else can finish the other.The text was updated successfully, but these errors were encountered: