当前位置: 首页>>代码示例>>Java>>正文


Java SdkConstants.FD_RES_RAW属性代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:20,代码来源:RenderScriptProcessor.java

示例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);
    }
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:71,代码来源:RenderScriptProcessor.java


注:本文中的com.android.SdkConstants.FD_RES_RAW属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。