frankiesardo / auto-parcel

Android Parcelable models made easy
Eclipse Public License 1.0
1.37k stars 83 forks source link

Allow autoparcel.vm resource instead of templateStr variable #27

Closed yongjhih closed 9 years ago

frankiesardo commented 9 years ago

Could you just move the autoparcel.vm under resources instead of adding the src folder in the build.gradle file?

yongjhih commented 9 years ago

auto.parcel.processor.AutoParcelTemplateVars.class.getResourceAsStream(resource); - It's going to load corresponding package path of $resources.srcDirs/auto/parcel/processo/$resource.

It's easier way by adding java folder into resources.srcDirs.

I don't sure how to move vm to resources without modify loader code snippet or move autoparcel.vm to resources/auto/parcel/processor/autoparcel.vm. I'm outdoor now, i'll check that later.

yongjhih commented 9 years ago

Here is another way by moving autoparcel.vm to corresponding resources path of src/main/resources/auto/parcel/processor/autoparcel.vm:

https://github.com/yongjhih/auto-parcel/tree/auto-parcel_vm2

auto.parcel.processor.AutoParcelTemplateVars.class.getResourceAsStream(resource); - It's going to load corresponding package path of $resources.srcDirs/auto/parcel/processo/$resource.

In this case, we have only one of resources. So I perfer adding src/main/java to $resources.srcDirs avoid maintain both package path of $java.srcDirs and $resources.srcDirs in the same.

frankiesardo commented 9 years ago

I'd rather not mix the concept of source code and static resources, so I'm happy to merge the second PR

yongjhih commented 9 years ago

It's not bad. I'll force-update this PR for regular structure.