efemoney
03/25/2019, 2:46 PMinline fun PluginDependenciesSpec.android(type: String = "application") = id("com.android.$type")
to be used in the plugins
block like
plugins {
android() // OR
android("library")
}
h0tk3y
03/25/2019, 3:03 PMplugins { ... }
blocks are somewhat special, as they are resolved and executed before any other build script parts or plugins, are loaded. Even the buildSrc
declarations are not available in the plugins { ... }
blocks. I believe that's why.efemoney
03/25/2019, 3:08 PMkotlin("jvm")
and other bundled plugin extensions (eg build-scan
) worked and it turns out its because they are in package org.gradle.kotlin.dsl
.
Iirc the docs say that the package is imported by default in build scripts. Perfect š.
If you place extensions in that package they should work and I think I am fine with that.tapchicoma
03/25/2019, 6:07 PMEven theI am using versions object defined indeclarations are not available in thebuildSrc
blocksplugins { ... }
buildSrc
š¤efemoney
03/25/2019, 6:12 PMorg.gradle.kotlin.dsl
? š¤tapchicoma
03/25/2019, 6:13 PMobject Versions {
val somePlugin = "1.0.0"
}
in buildSrc
and using it in plugins block:
plugins {
id("some.plugin.id") version Versions.somePlugin
}
buildSrc
and use it in plugins { .. }
block.efemoney
03/25/2019, 6:17 PM