2015-07-13 25 views

cevap

5

Bu çözüm oluşturulan mapping.txt dosyasını {targetDir}/mapping/target {targetDir} hedef APK dir olarak kopyalayacaktır. (Bu çözüm aynı zamanda txt dosya bir tarih ekleyecektir.)

Edit uygulama modülünün build.gradle, güncellemek android görevi:

android { 

    ... // your usual stuff 

    applicationVariants.all { variant -> 
     variant.outputs.each { output -> 
      if (variant.getBuildType().isMinifyEnabled()) { 
       variant.assemble.doLast{ 
        copy { 
         from variant.mappingFile 
         into output.outputFile.parent + "/mapping" 
         rename { String fileName -> 
          "mapping-${variant.name}-${new Date().format('yyyy_MM_dd')}.txt" 
         } 
        } 
       } 
      } 
     } 
    } 
}