-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate project to Gradle 6 - acessing the buildSrc project and its dependencies #109
Comments
I am happy this project is helpful for you :-) I am aware of Some research is required to address that |
Yes i would agree with you a bit of research is needed, from the docs i see the approach is just having them used as normal Strings, what's your take on this? |
Ideally I would want to keep old way, but if not possible we will have to use strings 🙄 |
Hey @igorwojda, I had stocked in the same question, then I resolved the issue with the Settings properties. Here is my solution:
pluginManagement {
repositories {
gradlePluginPortal()
google()
jcenter()
}
plugins {
val kotlinVersion: String by settings
val androidVersion: String by settings
val kotlinJVMId: String by settings
val kotlinAndroid: String by settings
val kotlinAndroidExt: String by settings
val kotlinKapt: String by settings
val androidAppId: String by settings
val androidLibraryId: String by settings
id(kotlinJVMId) version kotlinVersion
id(kotlinAndroid) version kotlinVersion
id(kotlinAndroidExt) version kotlinVersion
id(kotlinKapt) version kotlinVersion
id(androidAppId) version androidVersion
id(androidLibraryId) version androidVersion
}
resolutionStrategy {
val androidAppId: String by settings
val androidLibraryId: String by settings
val androidGradle: String by settings
eachPlugin {
when (requested.id.id) {
androidAppId, androidLibraryId -> useModule(androidGradle)
}
}
}
} It is not the best way but that should be something for now, we should keep the old solution if possible. |
One other way to fix this issue is to use composite builds in which files can be accessed from |
Hello after a long break. So finally I had time to update Gradle - it is updated to Gradle 7 #129. I think @ininmm solution is the best one - I know it's not perfect, but Gradle quite problematic when it comes to version sharing. I have created issue in Gradle project gradle/gradle#16077, so hopefully this will be adressed soon with I will close this issue for now, but feel free to drop a comment if you find a proper solution. |
Hi @igorwojda thanks for this project, its super awesome and have used your approach a couple of times on my projects while setting up modules and more so i particularly like your Kotlin Gradle DSL Setup, couldn't find any other complete sample.
However i think you should check on accessing the buildSrc project and its dependencies in settings scripts as it has been deprecated in Gradle v 6.0.
Am currently looking on a work around for the same. In case i find a workaround before you update, will definitely create a PR for this :]
The text was updated successfully, but these errors were encountered: