objectbox / objectbox/objectbox-java
Gradle option to use model file instead of creating/modifying one
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 4.6k
- Forks
- 311
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Currently, every time someone builds a Gradle project, the plugin will look for the entities and recreate the model JSON file if needed.
My suggestion is to add an option to only read the model file without checking and changing it.
The reason for such an option is to allow sharing the same model file and database in multiple languages.
To be more specific, I have a Flutter app that uses objectbox-dart, that app also has Android widgets written in Kotlin, so the idea is that I want to load an objectbox database in read-only mode inside my widget to get information previously added using objectbox-dart in Flutter.
I'm able to do that if I add this to my build.gradle file:
javaCompileOptions {
annotationProcessorOptions {
arguments.put("objectbox.modelPath", "$rootDir/../lib/objectbox-model.json".toString())
}
}
And that works, the issue is that from the Flutter side, I have multiple entities, but from the Kotlin side, I'm only interested in one, so if I build my grade project, my JSON model will be replaced with only the entity shared between both languages, to make the Flutter app work again, I need to always forcefully regenerate the model so it overrides what the gradle plugin changed. Hence why I want to prevent gradle build from changing that file.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par examiner la gestion par le plugin Gradle de l'option du processeur d'annotations objectbox.modelPath et la configuration build.gradle présentée dans l'issue. Suivez l'endroit où le JSON du modèle est vérifié et réécrit, puis définissez une option qui lit le modèle partagé existant sans le modifier ; le travail est considéré comme terminé lorsque Kotlin peut compiler avec le modèle Flutter tout en préservant toutes les entités Flutter.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- flutter, java, kotlin
- Domaine
- build-system, databases, mobile-dev
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100