com.android.ide.common.internal.AaptCruncher Java Examples

The following examples show how to use com.android.ide.common.internal.AaptCruncher. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AndroidBuilder.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns an {@link PngCruncher} using aapt underneath
 *
 * @return an PngCruncher object
 */
@NonNull
public PngCruncher getAaptCruncher(ProcessOutputHandler processOutputHandler) {
    checkState(mTargetInfo != null,
            "Cannot call getAaptCruncher() before setTargetInfo() is called.");
    return new AaptCruncher(
            mTargetInfo.getBuildTools().getPath(BuildToolInfo.PathId.AAPT),
            mProcessExecutor,
            processOutputHandler);
}
 
Example #2
Source File: Compiler.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Merge XML resources from different dependencies into a single file that can be passed to AAPT.
 *
 * @param mainResDir Directory for resources from the application (i.e., not libraries)
 * @param buildDir Build directory path. Merged resources will be placed at $buildDir/intermediates/res/merged
 * @param aaptTool Path to the AAPT tool
 * @return true if the resources were merged successfully, otherwise false
 */
private boolean mergeResources(File mainResDir, File buildDir, String aaptTool) {
  // these should exist from earlier build steps
  File intermediates = createDir(buildDir, "intermediates");
  File resDir = createDir(intermediates, "res");
  mergedResDir = createDir(resDir, "merged");
  PngCruncher cruncher = new AaptCruncher(getResource(aaptTool), null, null);
  return explodedAarLibs.mergeResources(mergedResDir, mainResDir, cruncher);
}