This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MultiDexUtils { | |
private static final String EXTRACTED_NAME_EXT = ".classes"; | |
private static final String EXTRACTED_SUFFIX = ".zip"; | |
private static final String SECONDARY_FOLDER_NAME = "code_cache" + File.separator + | |
"secondary-dexes"; | |
private static final String PREFS_FILE = "multidex.version"; | |
private static final String KEY_DEX_NUMBER = "dex.number"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android.applicationVariants.all { variant -> | |
task "fix${variant.name.capitalize()}MainDexClassList" << { | |
logger.info "Fixing main dex keep file for $variant.name" | |
File keepFile = new File("$buildDir/intermediates/multi-dex/$variant.buildType.name/maindexlist.txt") | |
keepFile.withWriterAppend { w -> | |
// Get a reader for the input file | |
w.append('\n') | |
new File("${projectDir}/multidex.keep").withReader { r -> | |
// And write data from the input into the output | |
w << r << '\n' |