j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Better integrated OrmLiteConfigUtil #18

Closed green-coder closed 10 years ago

green-coder commented 10 years ago

The way the class OrmLiteConfigUtil is working is quite hacky, it requires both the source code and the class files.

There are better alternatives nowadays:

The later solution is pretty useful for the Android : it doesn't require to compile the files first and can be easily integrated into a Gradle build (i.e. this can be implemented as a task executed before the app's resources are processed by the Android plugin, far before the compilation of the source code takes place).

I am willing to implement the second solution as a contribution to the project. Are you going to integrate it to the project?

green-coder commented 10 years ago

I started to implement the Gradle plugin, but when it comes to the implementation of the task, there are issues: Most of the code of ORMlite is assuming that we can provide a Class object, which QDox doesn't and cannot provide. In order tofinish the implementation, I would need to duplicate/rewrite a lot of the code, and there would be no guaranty that the plugin would continue to work for the later versions of ORMlite if the config file format and the classes which read it are modified.

As I saw in other issues, the main (and only) maintainer of the project doesn't have a lot of time to spend on ORMlite anymore, and without his support to maintain this plugin, my interest to develop it is lowered.

That being said, I decided not to finish the plugin's implementation, I will move along and use the current hacky way to generate the config file instead. If anyone wants to continue the Gradle plugin, please contact me and I will provide the sources I already wrote.

j256 commented 9 years ago

Sorry that I never responded to this. I don't have a lot of experience with either solution. One thing we are considering is to add a feature that writes the config.txt file at startup to cache the annotation information for the life of the application on the device.