Slackbot
05/11/2023, 8:23 PMVampire
05/11/2023, 9:21 PMfile
in your code is actually this@allPublishableArtifacts._file
, so it has a reference to_ this@allPublishableArtifacts
which then cascades.
Store file
to a local variable outside the doLast
and I think it should be compatible.Vampire
05/11/2023, 9:21 PMapi
or config
, but you didn't specify what those are.Vampire
05/11/2023, 9:22 PMthis
?Vampire
05/11/2023, 9:23 PMproject.plugins
should not be used, according to its JavaDoc, but instead project.pluginManger.withPlugin("maven-publish") { ... }
. Especially withType
does not make too much sense as a plugin cannot be applied multiple times.Tomáš Procházka
05/11/2023, 9:24 PMdoLast
decreased amount of errors to 6.Tomáš Procházka
05/11/2023, 9:27 PMproject.pluginManager.withPlugin("maven-publish")
I just don't like the string constant instead of class name, but it is probably safer.Tomáš Procházka
05/11/2023, 9:30 PMBtw. why do you get the publication by name, when you alread have it inHard to say, it is 2 years old code 🙂 I probably wanted to make it clear, because there is too much this, I like more when there is lambda parameter instead of this. But yes I can use proper?this
this@all
Vampire
05/11/2023, 9:31 PMI just don't like the string constant instead of class name, but it is probably safer.Yeah, well, whatever works for you. Just saying it is not the recommended way. 🙂
Vampire
05/11/2023, 9:33 PMthis@all
, or you can do all publication@*{
and then* this@publication
, or you can do val publication = this
right after the opening brace and then use publication
later.Tomáš Procházka
05/11/2023, 9:34 PMTomáš Procházka
05/11/2023, 9:34 PMproject.providers
Vampire
05/11/2023, 9:36 PMalso { publication ->
}
or
let { publication ->
}
Vampire
05/11/2023, 9:36 PMconfig
has reference to project
and as you have config
in doLast
, you have your last break point. 🙂Tomáš Procházka
05/11/2023, 9:40 PM@get:Inject
abstract val providers: ProviderFactory
Vampire
05/11/2023, 9:49 PMTomáš Procházka
05/11/2023, 9:49 PMTomáš Procházka
05/11/2023, 9:50 PMTomáš Procházka
05/11/2023, 9:50 PMapi
and config
are fields of enclosing classTomáš Procházka
05/11/2023, 10:00 PMTomáš Procházka
05/11/2023, 10:00 PMTomáš Procházka
05/11/2023, 10:00 PMVampire
05/11/2023, 10:13 PMTomáš Procházka
05/11/2023, 10:27 PMproject.providers
is completely fine. I can keep it there and it still works.