/** * Get the path for build-tools lib directory * @return */ public String getBuildToolsLibDirectoryPath() { File buildToolsLib = new File( getBuildToolInfo().getLocation(), "lib" ); if ( buildToolsLib.exists() ) { return buildToolsLib.getAbsolutePath(); } throw new InvalidSdkException( "Cannot find " + buildToolsLib ); }
/** * Get the path for mainDexClasses.rules * @return */ public String getMainDexClassesRulesPath() { File mainDexClassesRules = new File( getBuildToolInfo().getLocation(), "mainDexClasses.rules" ); if ( mainDexClassesRules.exists() ) { return mainDexClassesRules.getAbsolutePath(); } throw new InvalidSdkException( "Cannot find " + mainDexClassesRules ); }
public void build(@NonNull CommandLineLauncher launcher) throws IOException, InterruptedException { // 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(launcher, env); if (mSupportMode) { createSupportFiles(launcher, env); } }
/** * Returns the BLAS lib folder for renderscript support mode. * * This may return null if the SDK has not been loaded yet. * * @return the folder, or null. * * @see #setTargetInfo(TargetInfo) */ @Nullable public File getSupportBlasLibFolder() { if (mTargetInfo != null) { return RenderScriptProcessor.getSupportBlasLibFolder( mTargetInfo.getBuildTools().getLocation().getAbsolutePath()); } return null; }
/** * Returns the native lib folder for the renderscript mode. * * This may return null if the SDK has not been loaded yet. * * @return the folder, or null. * * @see #setTargetInfo(TargetInfo) */ @Nullable public File getSupportNativeLibFolder() { if (mTargetInfo != null) { return RenderScriptProcessor.getSupportNativeLibFolder( mTargetInfo.getBuildTools().getLocation().getAbsolutePath()); } return null; }
/** * Returns the jar file for the renderscript mode. * * This may return null if the SDK has not been loaded yet. * * @return the jar file, or null. * * @see #setTargetInfo(TargetInfo) */ @Nullable public File getRenderScriptSupportJar() { if (mTargetInfo != null) { return RenderScriptProcessor.getSupportJar( mTargetInfo.getBuildTools().getLocation().getAbsolutePath()); } return null; }
/** * Returns the native lib folder for the renderscript mode. * * This may return null if the SDK has not been loaded yet. * * @return the folder, or null. * * @see #setTargetInfo(SdkInfo, TargetInfo, Collection) */ @Nullable public File getSupportNativeLibFolder() { if (mTargetInfo != null) { return RenderScriptProcessor.getSupportNativeLibFolder( mTargetInfo.getBuildTools().getLocation().getAbsolutePath()); } return null; }
/** * Returns the jar file for the renderscript mode. * * This may return null if the SDK has not been loaded yet. * * @return the jar file, or null. * * @see #setTargetInfo(SdkInfo, TargetInfo, Collection) */ @Nullable public File getRenderScriptSupportJar() { if (mTargetInfo != null) { return RenderScriptProcessor.getSupportJar( mTargetInfo.getBuildTools().getLocation().getAbsolutePath()); } return null; }
File buildToolLocation = buildToolInfo.getLocation(); if (System.getenv("USE_JACK_LOCATION") != null) { buildToolLocation = new File(System.getenv("USE_JACK_LOCATION"));
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); } }
File buildToolLocation = buildToolInfo.getLocation(); if (System.getenv("USE_JACK_LOCATION") != null) { buildToolLocation = new File(System.getenv("USE_JACK_LOCATION"));
@NonNull private File findShrinkedAndroidJar() { Preconditions.checkNotNull( variantScope.getGlobalScope().getAndroidBuilder().getTargetInfo()); File shrinkedAndroid = new File( variantScope.getGlobalScope().getAndroidBuilder().getTargetInfo() .getBuildTools() .getLocation(), "lib" + File.separatorChar + "shrinkedAndroid.jar"); if (!shrinkedAndroid.isFile()) { shrinkedAndroid = new File( variantScope.getGlobalScope().getAndroidBuilder().getTargetInfo() .getBuildTools().getLocation(), "multidex" + File.separatorChar + "shrinkedAndroid.jar"); } return shrinkedAndroid; }
@Override public File call() throws Exception { Preconditions.checkNotNull( scope.getGlobalScope().getAndroidBuilder().getTargetInfo()); File shrinkedAndroid = new File( scope.getGlobalScope().getAndroidBuilder().getTargetInfo() .getBuildTools() .getLocation(), "lib" + File.separatorChar + "shrinkedAndroid.jar"); // TODO remove in 1.0 // STOPSHIP if (!shrinkedAndroid.isFile()) { shrinkedAndroid = new File( scope.getGlobalScope().getAndroidBuilder().getTargetInfo() .getBuildTools().getLocation(), "multidex" + File.separatorChar + "shrinkedAndroid.jar"); } return shrinkedAndroid; } });
File rs = new File(mBuildToolInfo.getLocation(), "renderscript"); mRsLib = new File(rs, "lib"); File bcFolder = new File(mRsLib, "bc");
File rs = new File(mBuildToolInfo.getLocation(), "renderscript"); mRsLib = new File(rs, "lib"); File bcFolder = new File(mRsLib, "bc");
@NonNull private File getZipAlignExe() throws TransformException { final TargetInfo info = androidBuilder.getTargetInfo(); if (info == null) { throw new TransformException("Cannot find zipAlign executable, no target info set"); } String path1 = info.getBuildTools().getPath(ZIP_ALIGN); if (path1 == null) { throw new TransformException("Cannot find zipAlign executable for build tools " + info.getBuildTools().getLocation()); } return new File(path1); }
File rs = new File(mBuildToolInfo.getLocation(), "renderscript"); mRsLib = new File(rs, "lib"); File bcFolder = new File(mRsLib, "bc");