clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

Add in code generation to generate BuildConfig.java #118

Closed AdamClements closed 9 years ago

AdamClements commented 9 years ago

Add in code generation to generate BuildConfig.java as per normal android tools. This gives the constant flag BuildConfig.DEBUG as true or false so that it can be checked from java and before clojure has loaded. It also has less overhead than looking up dynamic vars in clojure, so is perhaps more suitable for quick checks.

I have also added the feature than anything you add to :build-config as a map e.g. {"LOGGING_ENABLED" true, "THREADS" 4 "STATIC_STRING" "Testing"} will be added as compile time constants accessible from java which will get added to BuildConfig as public final static members BuildConfig/LOGGING_ENABLED etc. with the appropriate types, assuming that the pr-str representation of the value is the same as the java source representation (which is true for strings, booleans, longs, integers, etc).

alexander-yakushev commented 9 years ago

Looks good, thanks!