Closed AdamClements closed 10 years ago
Indeed. I modified the templates. You should add :clean-targets ["target" "gen"]
to your project.
Is there any reason this couldn't be done the other way around, moving gen into target/
All the other lein commands I've ever used generate everything in target, so as not to pollute the top level folder and keep your .gitignores simple.
Well... Because default Android structure looks so. So for no other reason than trying to look as much as a conventional Android project.
I think the leiningen way of doing things is much better in this regard, keep your source tree clean.
I've never liked the way android barfs files all over the place by default and it's caused me several headaches in large commercial android projects.
Maybe. Still I can't find any incentive to change this except for saving a line in gitignore (perhaps, I should add gen/
to template gitignore, that's reasonable). And I envision a Clojure/Android project as Android first, and then eventually Clojure (or Leiningen for that sake).
Besides, :gen-path
is a legit option to change in project's :android
map, so it's up to developer in the end.
I tried changing that option, I don't think it works, I can try again though.
Leiningen is the build tool here, I think it should stick to leiningen conventions. Plus, android build system is all over the place and is not something you should be looking to copy (I say this as someone who has written the build system for a large complex android app with many build configurations, using ant/scons and gradle)
It should work. gen/
is never hardcoded, it is the default value for :android/:gen-path
. If you put something there, you should see it changing in lein droid foo
. If it doesn't, write me back.
I'm not trying to undermine or neglect your experience here, Adam. I just don't see sense in changing something that: a) works; b) is a minor point; c) has a possibility to be changed on per-project level.
Also, I mimic ABS in directory structure not because it is good, but because it is well-recognized. All Android books/tutorials stick to it, so that's another plus.
I know you're not :)
Changing it shouldn't be an issue - it's an implementation detail of the compilation phase. If anybody has it set to anything other than the default, then it will still be set and won't change anything. It shouldn't break backwards compatibility, nobody should touch anything in this folder anyway.
I'm all for mimicing the android structure for user-created files, but for autogenerated content, it should definitely go in the target directory out of the way.
Doesn't matter too much though, so I guess I'm willing to drop it if you're dead set against.
Is there any reason the gen folder is not in the target directory? In its current position, a lein clean doesn't clear it, which is an issue.