gradle / kotlin-dsl-samples

Samples builds using the Gradle Kotlin DSL
https://gradle.org/kotlin/
Other
3.71k stars 434 forks source link

Is there a way to publish and import extension functions? #1253

Closed lamba92 closed 5 years ago

lamba92 commented 6 years ago

A plugin seems an overkill for that.

StefMa commented 6 years ago

Which extension functions do you mean?

On Wed, Nov 21, 2018, 2:29 PM Lamberto Basti <notifications@github.com wrote:

A plugin seems an overkill for that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gradle/kotlin-dsl/issues/1253, or mute the thread https://github.com/notifications/unsubscribe-auth/AJwYe6bW7PY9PFXMMfOMfJj3Yk-Mz26Tks5uxVUggaJpZM4YtHsu .

bamboo commented 6 years ago

@lamba92 a regular library of Kotlin functions would do, then you could import it in the usual way using the buildscript block of the root project.

JLLeitschuh commented 6 years ago

Are you looking for a DSL agnostic way of adding extension functions?

JLLeitschuh commented 6 years ago

Related: https://github.com/gradle/gradle/issues/7427

lamba92 commented 6 years ago

@lamba92 a regular library of Kotlin functions would do, then you could import it in the usual way using the buildscript block of the root project.

I think this should work. Can you show an example?

Are you looking for a DSL agnostic way of adding extension functions?

I'm talking about writing some commodity extension functions or just functions and reuse them later. Like here: https://github.com/Kotlin/kotlin-frontend-plugin/issues/31#issuecomment-430225448