gradle / kotlin-dsl-samples

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

Can't use variables in plugins block when package is set in buildSrc #1374

Closed lkokot closed 5 years ago

lkokot commented 5 years ago

I have Versions.kt file (buildSrc) in wchich I specify versions of libraries and plugins. I can't use them in plugins block if package is set. Please check plugins block in the build.gradle.kts file in root of the project.

Expected Behavior

I would like example from "Current Behavior.1" to work :)

Current Behavior

  1. Does not work code from root build.gradle.kts file with package set in Versions.kt id("org.springframework.boot") version Versions.springBoot

  2. Works code from root build.gradle.kts file without package set in Versions.kt id("org.springframework.boot") version Versions.springBoot

Context

I would like to have one constant way to set versions of all plugins and dependencies across entire project. This is important especially when you have a lot of modules.

Steps to Reproduce (for bugs)

demoApp.zip

Your Environment

eskatos commented 5 years ago

Closing as a duplicate of https://github.com/gradle/kotlin-dsl/issues/939