本文整理汇总了Java中com.android.SdkConstants.FD_RES_RAW属性的典型用法代码示例。如果您正苦于以下问题:Java SdkConstants.FD_RES_RAW属性的具体用法?Java SdkConstants.FD_RES_RAW怎么用?Java SdkConstants.FD_RES_RAW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.SdkConstants
的用法示例。
在下文中一共展示了SdkConstants.FD_RES_RAW属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSupportFiles
private void createSupportFiles(@NonNull CommandLineLauncher launcher,
@NonNull Map<String, String> env) throws IOException, InterruptedException {
// get the generated BC files.
File rawFolder = new File(mResOutputDir, SdkConstants.FD_RES_RAW);
SourceSearcher searcher = new SourceSearcher(Collections.singletonList(rawFolder), EXT_BC);
FileGatherer fileGatherer = new FileGatherer();
searcher.search(fileGatherer);
for (File bcFile : fileGatherer.getFiles()) {
String name = bcFile.getName();
String objName = name.replaceAll("\\.bc", ".o");
String soName = "librs." + name.replaceAll("\\.bc", ".so");
for (Abi abi : ABIS) {
File objFile = createSupportObjFile(bcFile, abi, objName, launcher, env);
createSupportLibFile(objFile, abi, soName, launcher, env);
}
}
}
示例2: doMainCompilation
private void doMainCompilation(@NonNull CommandLineLauncher launcher,
@NonNull Map<String, String> env)
throws IOException, InterruptedException {
if (mInputs.isEmpty()) {
return;
}
String renderscript = mBuildToolInfo.getPath(BuildToolInfo.PathId.LLVM_RS_CC);
if (renderscript == null || !new File(renderscript).isFile()) {
throw new IllegalStateException(BuildToolInfo.PathId.LLVM_RS_CC + " is missing");
}
String rsPath = mBuildToolInfo.getPath(BuildToolInfo.PathId.ANDROID_RS);
String rsClangPath = mBuildToolInfo.getPath(BuildToolInfo.PathId.ANDROID_RS_CLANG);
// the renderscript compiler doesn't expect the top res folder,
// but the raw folder directly.
File rawFolder = new File(mResOutputDir, SdkConstants.FD_RES_RAW);
// compile all the files in a single pass
ArrayList<String> command = Lists.newArrayListWithExpectedSize(25);
// Due to a device side bug, let's not enable this at this time.
// if (mDebugBuild) {
// command.add("-g");
// }
command.add("-O");
command.add(Integer.toString(mOptimLevel));
// add all import paths
command.add("-I");
command.add(rsPath);
command.add("-I");
command.add(rsClangPath);
for (File importPath : mImportFolders) {
if (importPath.isDirectory()) {
command.add("-I");
command.add(importPath.getAbsolutePath());
}
}
command.add("-d");
command.add(new File(mBuildFolder, RS_DEPS).getAbsolutePath());
command.add("-MD");
if (mSupportMode) {
command.add("-rs-package-name=android.support.v8.renderscript");
}
// source output
command.add("-p");
command.add(mSourceOutputDir.getAbsolutePath());
// res output
command.add("-o");
command.add(rawFolder.getAbsolutePath());
command.add("-target-api");
int targetApi = mTargetApi < 11 ? 11 : mTargetApi;
targetApi = (mSupportMode && targetApi < 18) ? 18 : targetApi;
command.add(Integer.toString(targetApi));
// input files
for (File sourceFile : mInputs) {
command.add(sourceFile.getAbsolutePath());
}
launcher.launch(new File(renderscript), command, env);
}