Open maksym-moroz opened 8 months ago
FYI, this is the kind of API I expect to add this plugin to my codebase : https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block
Here is the way I was able to add it in my project ( Haven't tested it if this works, but I was able to do gradle sync successfully )
settings.gradle.kts
pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
##### ADDED THIS SECTION #####
resolutionStrategy{
eachPlugin{
when(requested.id.id){
"shot" -> {
useModule("com.karumi:shot:${requested.version}")
}
}
}
}
}
libs.versions.toml
[versions]
shot="6.0.0"
## make sure id is "shot", I set it "com.karumi.shot" first time, but id from resolved repo ( i.e "shot" ) did not match with the "com.karumi.shot"
[plugins]
shot = { id="shot", version.ref="shot" }
Project level build.gradle.kts
plugins {
## not sure why I have done this, but assumed from other integrations ( my 1st week in native android development )
alias(libs.plugins.shot) apply false
}
app/module level build.gradle.kts
plugins {
alias(libs.plugins.shot)
}
Expected behaviour
Shot is the last plugin on our project that is not providing a way to use a new plugins block and
alias
. It would be nice if it was fixedActual behaviour
Right now the only way I found is via classpath. Surely there is a lengthy workaround to overcome this by copying everything manually but I feel like Kotlin DSL is the staple for Gradle and Shot snould provide this out of the box
Steps to reproduce
Try to add Shot
Version of the library
Any