Comments (7)
Do you know if this is only from the gradle plugin or the intellij plugin? Right now my structure looks right but its purely generated in intellij
from sqldelight.
I'm talking about the folder in your source tree with the .sq
files, src/main/sqlite/
, not the generated source files. I get the same for the generated dir in IDEA as well since it gets marked as a generated source folder.
from sqldelight.
gotchya 👍
from sqldelight.
Looks like the will require a sqldelight facet type and all the stuff around that. It's probably the right thing to do but later.
from sqldelight.
so in vanilla intellij the solution is
val contentEntry = ModuleRootManager.getInstance(module).getModifiableModel().addContentEntry("src");
contentEntry.addSourceFolder("/path-to-module/src/main/sqldelight")
and this works fine.
Unfortunately in the android plugin they drop all the existing ContentEntries and hardcode their own, which are essentially generatedJava, generatedRes, java, and res directories with some others. So if you call the above code before the wipe it looks proper for a fraction of a second before the android plugin code runs and wipes it. If you call it after the wipe the source folder (sqldelight) is blue but the packages dont collapse. Not sure whats going on there.
All this is to say I'm going to take the ridiculously easy route and just add the sqldelight directory as a source directory from gradle instead of using the IDE. IDE is the right way to go but Android Studio is making it difficult/impossible.
from sqldelight.
@AlecStrong I've tried to make this work, but as you mentioned it's unavoidable that the android plugin will rewrite all content entries after a gradle sync.. Even if you mark a dir manually as a sources root, it still will be overwritten. I tried to look for workarounds (like listening for gradle sync to finish?) but no luck. Do you have an idea/refs on how to do it properly with facets?
from sqldelight.
yea there isn't a whole lot of information regarding facets: https://www.jetbrains.org/intellij/sdk/docs/reference_guide/project_model/facet.html
it's a lot to look through, and I can't find anything specifically about directory UI so it might also be a dead end which would suck. It's likely that adding it as a kotlin source set in gradle is the only way to get the working. It kinda sucks because then you could also put kotlin files there and they would be compiled, but it's probably worth it because right now the directory structure kinda sucks
there might be other intellij platform APIs to facilitate this but I haven't found them. It might be worth asking in the intellij platform slack to see if one of the JB team has a good idea for it
from sqldelight.
Related Issues (20)
- Testing for migrations to kmp
- COALESCE not inferring `AS custom-type` inside of `UPDATE` HOT 1
- JdbcDriver does not cache PreparedStatement HOT 1
- Postgres Driver Fails Sqlite Driver HOT 1
- linkDebugFrameworkIosArm64 fails with "Undefined symbols for architecture arm64" HOT 1
- java.lang.NullPointerException in MutatorMixin.kt:19
- java.lang.IllegalArgumentException in SqlDelightFile.kt:77
- json_each results cannot be named HOT 1
- java.lang.NullPointerException in ConnectionOptions.kt:57
- JVM/Postgres doesn't create tables?!
- `v1__to__v2.sqm` is parsed as `v12` instead of `v1`
- Migration docs seem wrong regarding migration file naming/versioning. HOT 4
- java.lang.UnsupportedOperationException in SqlDelightFileIndexImpl.kt:13
- Compilation fails on Mac M1 for target linux_arm64
- org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException in SqlDelightGotoDeclarationHandler.kt:124
- Connect to GCloud BigQuery
- java.lang.RuntimeException in SqlDelightReferenceContributor.kt:65
- org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException in SqlDelightGotoDeclarationHandler.kt:124
- pagin3-extension
- NUMERIC column doesn't resolve to BigDecimal using SUM or Binary Expression HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqldelight.