Now that gradle experimental is getting more useful, I am trying to get 
crashlytics to work with it locally.  Despite them not having support for 
it, there's a way to do it, however, it involves changing the UUID in the 
strings.xml per each build.

First, I tried to use
components.android {
  binaries.afterEach { binary ->
  String outDir = "<pathToGeneratedOutdir>"
  if(file(outDir).exists()) {
    copy {
      from(outDir) {
        filter {
          line -> line.replaceAll("CRASHLYTICSUUID", 
UUID.randomUUID().toString())
        }
      into "<pathToGeneratedOutdir>"
      include "values.xml"
  }
}

However, the above code works only "sometimes"  When the debug build goes 
through it works, then even if it's set to only build debug, it'll build 
release and wipe out the debug for unknown reasons.

I found resValue and thought that might solve all of my problems, but from 
SO the only answer I found that uses resValue on experimental says it no 
longer works past 0.4.0.  So what's the preferred method of writing a 
dynamic string to the string resources at compile time?  (I read about 
registerResGeneratingTask however am unsure about how one would utilize 
that).

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to