Closed sergv closed 11 years ago
Oh wow, Sergey, that's a lot of work!
I'll start reviewing and integrating this tomorrow. Thank you so far!
OK, I am almost done merging. I don't do Github's PR merge because there are a few minor things in commits that I want to refactor.
Anyway, here are a few questions to you based on this PR.
:omit-sources
flag, do I even have this feature?:)I've pushed the changes in the following commits: 4f4b08f 8c5533d 2e5a952 c537d7f 1b317d3 f7d7608 3929ad3 . Please take a look and say if I have broken something with my changes.
Also I've tried to build my android projects with latest master version and it works well, but I've noticed that create-obfuscated-dex command is not visible to the user any more and that :proguard-conf was renamed into :proguard-conf-path but wasn't changed in sample project.clj. I gathered solutions into this patch https://github.com/sergv/lein-droid/commit/2afb964d57d53dbf67b60a08e0b0d6abacf64135 but maybe it should be another PR?
Oh, I totally missed those ones. Thanks again!
Sergey,
If you still read this thread, I'd like to let you know that I revert auxiliary dex options
commit because there is already identical functionality. You can add :dex-opts
parameter to your :android
map which is a vector of strings.
Yeah, they're not too beautiful and the reason I added them was to enable ability to pass some options to dx after "--dex", in particular I tried to pass "--num-threads=2". Not as I try it out there is no need to keep "--dex" option before "--num-threads=2" so I think it's good idea to remove these auxiliary dex options.
This is broad range of commits accumulated that might be useful to someone except myself.
Password commits are plainly convenient if you use non-debug key all the time, which may or may not be a good idea in itself, yet it saves some app uninstalls when keys are switched.
Next I've tried to figure out if there's a lot of reflection warnings in lein-droid plugin which may be responsible for somewhat slow build experience. I should confess that I've done no profiling and have no evidence of build process becoming faster. Moreover, a lot of reflection warnings seems to be located in libraries which I didn't touch. But still, brief experience with clojure on android suggests that reflection is not the fastest way of doing things around and it feels like leiningen could be more responsive as a build system.
I realize that subjective slowness is a bad criteria for making decisions and that premature optimization is bad, but consider this: build system naturally deals with files and paths on the filesystem, in some circumstances processing lots of files. In clojure files and paths usually mean java.io.File and String objects. If reflection is going to be used for every File object encountered during build process then it can be quickly improved without much effort.
Next I've added "droid create-obfuscated-dex" command that uses proguard to create optimized jar that dx will operate upon.
Native library packaging and proguard support are not primarily for clojure projects, they're used by android projects in general ando so they're made with making lein-droid better general-purprose android build system in mind.
I'm a bit unsure about commit fixing inference of application name for run command. It didn't infer correct name for java application with manifest like this http://pastebin.com/Fs4E6VDc so I've tried to fix the matter. Please review my fix and throw it away if it does not fit.
Lastly, some means of passing options to dx executable we added along with sample descriptions of most of lein droid's configuration options.