Search in sources :

Example 1 with RClassGenerator

use of com.google.devtools.build.android.resources.RClassGenerator in project bazel by bazelbuild.

the class AndroidResourceProcessor method writePackageRClasses.

void writePackageRClasses(Multimap<String, SymbolLoader> libMap, SymbolLoader fullSymbolValues, String appPackageName, Path classesOut, boolean finalFields) throws IOException {
    for (String packageName : libMap.keySet()) {
        Collection<SymbolLoader> symbols = libMap.get(packageName);
        RClassGenerator classWriter = RClassGenerator.fromSymbols(classesOut, packageName, fullSymbolValues, symbols, finalFields);
        classWriter.write();
    }
    // Unlike the R.java generation, we also write the app's R.class file so that the class
    // jar file can be complete (aapt doesn't generate it for us).
    RClassGenerator classWriter = RClassGenerator.fromSymbols(classesOut, appPackageName, fullSymbolValues, ImmutableList.of(fullSymbolValues), finalFields);
    classWriter.write();
}
Also used : RClassGenerator(com.google.devtools.build.android.resources.RClassGenerator) SymbolLoader(com.android.builder.internal.SymbolLoader)

Example 2 with RClassGenerator

use of com.google.devtools.build.android.resources.RClassGenerator in project bazel by bazelbuild.

the class AndroidResourceClassWriter method writeAsClass.

private void writeAsClass(Map<ResourceType, List<FieldInitializer>> initializers) throws IOException {
    RClassGenerator rClassGenerator = new RClassGenerator(outputBasePath, packageName, initializers, false);
    rClassGenerator.write();
}
Also used : RClassGenerator(com.google.devtools.build.android.resources.RClassGenerator)

Aggregations

RClassGenerator (com.google.devtools.build.android.resources.RClassGenerator)2 SymbolLoader (com.android.builder.internal.SymbolLoader)1