SourceSearcher searcher = new SourceSearcher(folders, extension); searcher.setUseExecutor(false); LeafFolderGatherer processor = new LeafFolderGatherer(); try { searcher.search(processor); } catch (InterruptedException | IOException
public void search(@NonNull SourceFileProcessor processor) throws ProcessException, LoggedErrorException, InterruptedException, IOException { for (File file : mSourceFolders) { // pass both the root folder (the source folder) and the file/folder to process, // in this case the source folder as well. processFile(file, file, processor); } if (mExecutor != null) { mExecutor.waitForTasksWithQuickFail(true /*cancelRemaining*/); } }
private void processFile( @NonNull final File rootFolder, @NonNull final File file, @NonNull final SourceFileProcessor processor) throws ProcessException, IOException { if (file.isFile()) { // get the extension of the file. if (checkExtension(file)) { if (mExecutor != null) { mExecutor.execute(new Callable<Void>() { @Override public Void call() throws Exception { processor.processFile(rootFolder, file); return null; } }); } else { processor.processFile(rootFolder, file); } } } else if (file.isDirectory()) { File[] children = file.listFiles(); if (children != null) { for (File child : children) { processFile(rootFolder, child, processor); } } } }
SourceSearcher searcher = new SourceSearcher( Collections.singletonList(rawFolder), EXT_BC); FileGatherer fileGatherer = new FileGatherer(); searcher.search(fileGatherer);
if (file.isFile()) { if (checkExtension(file)) { if (!initialized) { processor.initOnFirstFile(); if (children != null) { for (File child : children) { processFile(rootFolder, child, processor);
@NonNull final Map<String, String> env) throws IOException, InterruptedException, LoggedErrorException, ProcessException { SourceSearcher searcher = new SourceSearcher( Collections.singletonList(rawFolder), EXT_BC); FileGatherer fileGatherer = new FileGatherer(); searcher.search(fileGatherer);
SourceSearcher searcher = new SourceSearcher(folders, extension); searcher.setUseExecutor(false); LeafFolderGatherer processor = new LeafFolderGatherer(); try { searcher.search(processor); } catch (InterruptedException e) {
public void search(@NonNull SourceFileProcessor processor) throws ProcessException, LoggedErrorException, InterruptedException, IOException { for (File file : mSourceFolders) { // pass both the root folder (the source folder) and the file/folder to process, // in this case the source folder as well. processFile(file, file, processor); } if (mExecutor != null) { mExecutor.waitForTasksWithQuickFail(true /*cancelRemaining*/); } }
public void build( @NonNull ProcessExecutor processExecutor, @NonNull ProcessOutputHandler processOutputHandler) throws InterruptedException, ProcessException, LoggedErrorException, IOException { // gather the files to compile FileGatherer fileGatherer = new FileGatherer(); SourceSearcher searcher = new SourceSearcher(mSourceFolders, "rs", "fs"); searcher.setUseExecutor(false); searcher.search(fileGatherer); List<File> renderscriptFiles = fileGatherer.getFiles(); if (renderscriptFiles.isEmpty()) { return; } // get the env var Map<String, String> env = Maps.newHashMap(); if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) { env.put("DYLD_LIBRARY_PATH", mBuildToolInfo.getLocation().getAbsolutePath()); } else if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX) { env.put("LD_LIBRARY_PATH", mBuildToolInfo.getLocation().getAbsolutePath()); } doMainCompilation(renderscriptFiles, processExecutor, processOutputHandler, env); if (mSupportMode) { createSupportFiles(processExecutor, processOutputHandler, env); } }
public void build( @NonNull ProcessExecutor processExecutor, @NonNull ProcessOutputHandler processOutputHandler) throws InterruptedException, ProcessException, LoggedErrorException, IOException { // gather the files to compile FileGatherer fileGatherer = new FileGatherer(); SourceSearcher searcher = new SourceSearcher(mSourceFolders, "rs", "fs"); searcher.setUseExecutor(false); searcher.search(fileGatherer); List<File> renderscriptFiles = fileGatherer.getFiles(); if (renderscriptFiles.isEmpty()) { return; } // get the env var Map<String, String> env = Maps.newHashMap(); if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) { env.put("DYLD_LIBRARY_PATH", mBuildToolInfo.getLocation().getAbsolutePath()); } else if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX) { env.put("LD_LIBRARY_PATH", mBuildToolInfo.getLocation().getAbsolutePath()); } doMainCompilation(renderscriptFiles, processExecutor, processOutputHandler, env); if (mSupportMode) { createSupportFiles(processExecutor, processOutputHandler, env); } }
processOutputHandler); SourceSearcher searcher = new SourceSearcher( sourceFolder, ShaderProcessor.EXT_VERT, ShaderProcessor.EXT_FRAG, ShaderProcessor.EXT_COMP); searcher.setUseExecutor(true); searcher.search(processor);
mProcessOutputHandler); SourceSearcher searcher = new SourceSearcher(sourceFolders, "aidl"); searcher.setUseExecutor(true); searcher.search(processor);
processOutputHandler); SourceSearcher searcher = new SourceSearcher(sourceFolders, "aidl"); searcher.setUseExecutor(true); searcher.search(processor);