Slowly working on migrating an existing project from 0.9.0 over to 1.1.3. The existing project has a :data module which is where the core database logic resides along with the SupportSQLiteOpenHelper.Callback implementation. However there are other :[feature]:data modules that have their own *.sq files but are ultimately depended on by :data.
I have been struggling to get things working on my end even after trying the sqldelight Gradle DSL that comes with the plugin. I keep running into:
Cannot depend on a module with no sqldelight plugin
Despite all the modules apply-ing the sqldelight plugin. To try to get a better of sense of things, I decided to create a small Android project where :coredata depends on :featuredata. I got things compiling and the Schema within :coredata appears to include the Schema from :featuredata but my solution looks different than the test example in https://github.com/square/sqldelight/pull/1229/files#diff-016af6af13f80cb56a309f2cb830e588R9.
I was running into:
Detected a schema that already has the package name com.example in project project ':featuredata'
I wound up having to go with the following:
// From :coredata
sqldelight {
Database {
dependency libs.featureData
}
}
// From :featuredata
sqldelight {
Database {
packageName = "com.example"
schemaOutputDirectory = file('src/main/sqldelight/databases')
}
}
I still have to try and see if I can get multi-module support working on my original project.
Overall, it would be great to have some more detailed documentation on how to support multi-module projects.
Questions I have are:
CoreDatabase which depends on FeatureDatabase?dependency is specified, should all other properties be omitted and only specified in the dependency module directly, as shown in my snippet above?Thank you! 馃檪
Thank you for the reply! I wound up figuring out the details on my own via trial and error. I still think it would be beneficial to include some of these details in the documentation. It might help others who are supporting multi-module get up to speed quicker.
Re:
I keep running into:
Cannot depend on a module with no sqldelight plugin
That turned out to be https://github.com/square/sqldelight/issues/1317.
Most helpful comment