Update documentation for Kotlin DSL
Closed this issue · 4 comments
ivakub commented
Hi!
This code in build.gradle.kts doesn't work:
plugins {
kotlin("jvm") version "1.7.21"
}
buildscript {
repositories {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath("com.android.gradle.replicator:project-replicator:0.2")
}
}
}
allprojects {
apply(plugin = "com.android.gradle.replicator.ProjectReplicatorPlugin") // Plugin with id 'com.android.gradle.replicator.ProjectReplicatorPlugin' not found.
}
What should I do to make it work?
ducrohet commented
The plugin is not published anywhere. you need to build it and publish it locally first.
See USAGE.md
for instructions
ducrohet commented
oh the issue I think is that the plugin
entry in the map provided to apply
should be Class
object not a String
. By passing a string Gradle expects the plugin id but you pass there is the plugin class.
I think
apply(plugin = com.android.gradle.replicator.ProjectReplicatorPlugin.class::java)
should work
ivakub commented
apply(plugin = "com.android.gradle.project.replicator")
works