Instagram / ig-json-parser

Fast JSON parser for java projects
https://instagram-engineering.com/fast-auto-generated-streaming-json-parsing-for-android-ab8e7be21033
MIT License
1.32k stars 125 forks source link

Generated source location #9

Closed jacobtabak closed 10 years ago

jacobtabak commented 10 years ago

Making a separate issue from this because it shouldn't be in the documentation issue...

Right now the generated source is in demo/igmodel/gen-src/main/java/com/instagram..., it should probably go in demo/build/generated/source/ig-gson/[variant]/com/instagram...

The current generated source is not flagged by the IDE as generated, so you can edit it and obviously it will be overwritten on next build. If you place the code in build/generated, you get a nice warning like this:

warning

ttung commented 10 years ago

When I put the generated sources in demo/igmodel/build/... Android Studio doesn't see it.

jacobtabak commented 10 years ago

/build should be a sibling of /demo, not a child... here's an example of generated code from another annotation processor... (AndroidAnnotations)

example

ttung commented 10 years ago

No that's incorrect. The subproject's build directory should be inside the subproject's directory.

On Sep 16, 2014, at 12:11 PM, "Jacob Tabak" notifications@github.com<mailto:notifications@github.com> wrote:

/build should be a sibling of /demo, not a child... here's an example of generated code from another annotation processor... (AndroidAnnotations)

[example]https://camo.githubusercontent.com/bf0592f141297ece0a452b8de64d221d13d38d8f/687474703a2f2f692e696d6775722e636f6d2f6d45596648344a2e706e67

— Reply to this email directly or view it on GitHubhttps://github.com/Instagram/ig-json-parser/issues/9#issuecomment-55797332.

jacobtabak commented 10 years ago

Ah yes you're right. And yes, the /build directory under igmodel seems to be invisible to Android Studio. Is that where you had the generated sources before?

ttung commented 10 years ago

Yup

On Sep 16, 2014, at 12:24 PM, "Jacob Tabak" notifications@github.com<mailto:notifications@github.com> wrote:

Ah yes you're right. And yes, the /build directory under igmodel seems to be invisible to Android Studio. Is that where you had the generated sources before?

— Reply to this email directly or view it on GitHubhttps://github.com/Instagram/ig-json-parser/issues/9#issuecomment-55799210.

jacobtabak commented 10 years ago

I have never seen modules containing submodules in AS... maybe that is the issue

On Tue, Sep 16, 2014 at 2:34 PM, ttung notifications@github.com wrote:

Yup

On Sep 16, 2014, at 12:24 PM, "Jacob Tabak" <notifications@github.com mailto:notifications@github.com> wrote:

Ah yes you're right. And yes, the /build directory under igmodel seems to be invisible to Android Studio. Is that where you had the generated sources before?

— Reply to this email directly or view it on GitHub< https://github.com/Instagram/ig-json-parser/issues/9#issuecomment-55799210>.

— Reply to this email directly or view it on GitHub https://github.com/Instagram/ig-json-parser/issues/9#issuecomment-55800832 .