https://kotlinlang.org logo
Title
d

Davide Giuseppe Farella

02/21/2019, 2:46 AM
Published successfully 🙂 Just wondering if I could apply the
bintray-plugin
in my
buildSrc
so I don’t need to pass a lambda to the function. I.e.:
// mymodule.gradle.kts
...
publish( "artifactId" ) {
    bintray {
        .. copy/paste code using extra's set in buildSrc function
    }
}
g

gildor

02/21/2019, 2:55 AM
You can do this if create a custom plugin in buildSrc and apply it in your project
d

Davide Giuseppe Farella

02/21/2019, 3:09 AM
No, I would just like to move that
bintray
block inside my
publish
function, but actually I can't since
bintray
is not resolved in buildSrc, since it's doest have the bintray plugin. I just don't know how to apply it 😁
g

gildor

02/21/2019, 3:50 AM
but actually I can’t since
bintray
is not resolved in buildSrc
Yes, because in buildSrc you don’t have static accessors. But you can do this without static accessors, just add bintray plugin as dependency (not plugin!) to your buildSrc
d

Davide Giuseppe Farella

02/21/2019, 3:52 AM
Ok thanks, I messed around with Maven and Bintray plugins within repos, deps, classpath and plugins inside the buildSrc 😋 I'll let you know in a couple of hours, thanks
g

gildor

02/21/2019, 6:21 AM
Yes, I told you “in buildSrc you don’t have static accessors”
you have to use
configure<BintrayExtension> { }
instead
d

Davide Giuseppe Farella

02/21/2019, 6:22 AM
Oh, ok 😄 sorry, didn’t get that 😄
That worked :gradle:
g

gildor

02/21/2019, 6:26 AM
👍