https://kotlinlang.org logo
Title
c

Czar

12/07/2017, 11:44 AM
project(":child:grandchild") {
	plugins {
		id("war")
		id("org.springframework.boot")
	}
	dependencies {
		providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
		//...
	}
	//...
}
gives me unresolved reference:
providedRuntime
Any ideas?
💁 1
If I do this
"providedRuntime"("org.springframework.boot:spring-boot-starter-tomcat")
gradle says
Configuration with name 'providedRuntime' not found.
Why? I did apply the plugins
e

eskatos

12/07/2017, 2:27 PM
🤔 looks like a bug The
plugins {}
block is only supported for the current project, not when doing config injection with
[all|sub]projects {}
or
project(":path") {}
The bug here is that you couldn’t notice, it should have failed telling you this is not possible.
To apply plugins to subprojects, use
project(":path") { apply { plugin("some-id") } }
Could you report an issue to
gradle/kotlin-dsl
about not failing when the
plugins {}
block is used in a project configuration block?
c

Czar

12/07/2017, 2:39 PM
Yup, I confirm that with
apply{ plugin("") }
and
"providedRuntime"()
it works
@eskatos https://github.com/gradle/kotlin-dsl/issues/625 Sorry for the cumbersome name, I do quite often fail in that regard 🙂
By the way is there a trick to make kotlin generate
providedRuntime
accessor here? So that I can omit the quotes?
e

eskatos

12/07/2017, 2:47 PM
That’s totally fine! Thanks a lot
Nope, no way yet, but we are considering how to achieve this
c

Czar

12/07/2017, 2:48 PM
Ok, not a huge problem, just a nice-to-have 🙂 Thank you!