https://kotlinlang.org logo
Title
m

mtl

04/22/2018, 7:17 PM
Hi all, so I am trying to use the Kotlin DSL, specifically I'm translating https://github.com/vert-x3/vertx-examples/blob/master/kotlin-examples/web/build.gradle to the Kotlin DSL, however it's not immediately apparent how would I pass arguments as in here https://github.com/vert-x3/vertx-examples/blob/master/kotlin-examples/web/build.gradle#L55 Any suggestions?
c

Czar

04/22/2018, 7:25 PM
val mainVerticleName = "io.vertx.example.MainVerticle"
val mainClassName by extra { "io.vertx.core.Launcher" }

tasks {
	"run"(JavaExec::class) {
		args = listOf(
			"run",
			mainVerticleName,
			"--launcher-class=$mainClassName",
			"--redeploy=src/**/*.*",
			"--on-redeploy=./gradlew classes"
		)
	}
}
👍 1
m

mtl

04/22/2018, 8:10 PM
@Czar Thanks a lot, straightforward enough.
👍 1
c

Czar

04/22/2018, 8:39 PM
kotlin-dsl documentation is close to non-existent, but if you trawl through issues you find bits of knowledge like this 🙂 https://github.com/gradle/kotlin-dsl/issues/34#issuecomment-272172389
👍 1
n

napperley

04/28/2018, 12:15 AM
@mtl Have a look at this Vert.x template (https://github.com/napperley/kotlin-templates/tree/master/vertx). The template even covers hot code reloading. 😒imple_smile:
👍 1
m

mtl

04/28/2018, 10:53 AM
That's awesome, thanks a lot @napperley