BuildRpm task with kotlin dsl

89 Views Asked by At

I am migrating my groovy syntac to kotlin dsl and struggling while building the buildRpm() task provided by nebula plugin.

Currntly I have in my builod.gradle.kts

plugins {

  id("nebula.ospackage") version "8.3.0"

}
apply(plugin = "nebula.rpm")

I am creating my task with the following:

val buildRpm by creating(Rpm::class) {
  println("building")
}

and when running ./gradlew buildRpm I get Unresolved reference: Rpm

How can I create Rpm with kotlin dsl then ?

1

There are 1 best solutions below

5
GreenSaguaro On

Here is how you want to set up your Gradle:

plugins {
  id("nebula.ospackage") version "8.3.0"
}

You don't need apply here as that is already done when you declare your plugin usage as above above.

And the task:

val buildRpm by tasks.creating(Rpm::class) {

}

And make sure to import the Rpm task at the top of the file.