SqlDelight Plugin not detected if more than one plugin defined in Gradle dependency classpath
See original GitHub issueWhen trying to set up multi-module support where ModuleA
depends on ModuleB
, if ModuleA
also happens to apply another Gradle Plugin, such as the Protobuf Gradle Plugin, then the Gradle configuration will complain that ModelA
:
Cannot depend on a module with no sqldelight plugin.
Example:
ModuleA's
build.gradle snippet:
buildscript {
dependencies {
classpath libs.protobufGradlePlugin <-- Causes Gradle configuration to fail
classpath libs.sqldelight.gradlePlugin
}
}
apply from: configs.kotlin.androidLibrary
apply plugin: 'com.squareup.sqldelight'
sqldelight {
Database {
packageName = "com.example.coredata.data"
dependency libs.featureData
}
}
ModuleB's
build.gradle snippet:
buildscript {
dependencies {
classpath libs.sqldelight.gradlePlugin
}
}
apply from: configs.kotlin.androidLibrary
apply plugin: 'com.squareup.sqldelight'
sqldelight {
Database {
packageName = "com.example.featuredata.data"
}
}
If I comment out classpath libs.protobufGradlePlugin
, the Gradle configuration succeeds.
I have attached a repro Android project. If you go to coredata/build.gradle
, you can uncomment the classpath
definition that has been commented out in order to repro the issue. Thank you!
Repro: SqlDelightMultiModule.zip
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Could not resolve com.squareup.sqldelight:runtime:1.1.3
I was solved this problem. First: Apply sqldelight plugin right to all project: apply plugin: 'com.squareup.sqldelight' sqldelight ...
Read more >Build Sometimes Fails if Kotlin Plugin Classpath Dependency ...
He found that if he moved the kotlin-gradle-plugin to the bottom of the dependencies block it works, and moving it back to the...
Read more >SQLDelight: Getting Started - Tony Owen - Medium
I wanted to try out SQLDelight, a library (and IntelliJ plugin) that generates Java models based ... classpath 'com.squareup.sqldelight:gradle-plugin:0.5.1'
Read more >How `buildscript` relates to `pluginManagement` - Help/Discuss
hi I'm looking for help in understanding how buildscript relates to pluginManagement in terms of declaring plugins and their versions.
Read more >Getting started on Kotlin JS with SQLDelight
buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.squareup.sqldelight:gradle-plugin:1.5.3' } } apply plugin: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thats super weird. Thanks for the repro project, will take a look at this
the issue here is having all the separate buildscript classpaths, that’s confusing some part of gradle. If I consolidate the classpath into the root
build.gradle
its fine: