/** Returns the build tools for this builder. */ @NonNull public BuildToolInfo getBuildToolInfo() { checkNotNull( mTargetInfo, "Cannot call getBuildToolInfo() before setTargetInfo() is called."); return mTargetInfo.getBuildTools(); }
protected BuildToolInfo getBuildTools() { return androidBuilder.getTargetInfo().getBuildTools(); }
@NonNull public File getDxJar() { checkState(mTargetInfo != null, "Cannot call getDxJar() before setTargetInfo() is called."); return new File(mTargetInfo.getBuildTools().getPath(BuildToolInfo.PathId.DX_JAR)); }
@Override public File call() throws Exception { final TargetInfo info = androidBuilder.getTargetInfo(); if (info != null) { String path = info.getBuildTools().getPath(ZIP_ALIGN); if (path != null) { return new File(path); } } return null; } });
@Override public File call() throws Exception { final TargetInfo info = androidBuilder.getTargetInfo(); if (info == null) { return null; } String path = info.getBuildTools().getPath(ZIP_ALIGN); if (path == null) { return null; } return new File(path); } });
@InputFile public File getJackExe() { return new File( androidBuilder.getTargetInfo().getBuildTools().getPath(BuildToolInfo.PathId.JACK)); }
/** * Returns an {@link PngCruncher} using aapt underneath * @return an PngCruncher object */ @NonNull public PngCruncher getAaptCruncher() { checkState(mTargetInfo != null, "Cannot call getAaptCruncher() before setTargetInfo() is called."); return new AaptCruncher( mTargetInfo.getBuildTools().getPath(BuildToolInfo.PathId.AAPT), mProcessExecutor, mProcessOutputHandler); }
@Override public File call() throws Exception { final TargetInfo info = scope.getGlobalScope().getAndroidBuilder().getTargetInfo(); String path = info == null ? null : info.getBuildTools().getPath(SPLIT_SELECT); if (path != null) { File splitSelectExe = new File(path); return splitSelectExe.exists() ? splitSelectExe : null; } else { return null; } } });
@Override public File call() throws Exception { final TargetInfo info = scope.getGlobalScope().getAndroidBuilder() .getTargetInfo(); String path = info == null ? null : info.getBuildTools().getPath(SPLIT_SELECT); if (path != null) { File splitSelectExe = new File(path); return splitSelectExe.exists() ? splitSelectExe : null; } else { return null; } } });
@Override public File call() throws Exception { final TargetInfo info = scope.getGlobalScope().getAndroidBuilder().getTargetInfo(); String path = info == null ? null : info.getBuildTools().getPath(SPLIT_SELECT); if (path != null) { File splitSelectExe = new File(path); return splitSelectExe.exists() ? splitSelectExe : null; } else { return null; } } });
@NonNull @Override public Map<String, Object> getParameterInputs() { ImmutableMap.Builder<String, Object> params = ImmutableMap.builder(); params.put("keepRuntimeAnnotatedClasses", keepRuntimeAnnotatedClasses); TargetInfo targetInfo = variantScope.getGlobalScope().getAndroidBuilder().getTargetInfo(); if (targetInfo != null) { params.put("build_tools", targetInfo.getBuildTools().getRevision().toString()); } return params.build(); }
@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); }
@Override public File call() throws Exception { String path = scope.getGlobalScope().getAndroidBuilder().getTargetInfo() .getBuildTools().getPath(ZIP_ALIGN); if (path != null) { return new File(path); } return null; } });
/** * Returns the BuildToolInfo. * @throws IllegalStateException if androidBuilder.targetInfo has not been set, */ @NonNull protected BuildToolInfo getBuildTools() { TargetInfo targetInfo = getBuilder().getTargetInfo(); Preconditions.checkState(targetInfo != null, "androidBuilder.targetInfo required for task '%s'.", getName()); return targetInfo.getBuildTools(); }
@NonNull @Override public Map<String, Object> getParameterInputs() { Map<String, Object> params = Maps.newHashMap(); params.put("javaResourcesFolder", options.getResourceDirectories()); params.put("isDebuggable", options.isDebuggable()); params.put("multiDexEnabled", options.isMultiDex()); params.put("minSdkVersion", options.getMinSdkVersion().getApiString()); params.put("javaMaxHeapSize", options.getJavaMaxHeapSize()); params.put("sourceCompatibility", options.getSourceCompatibility()); params.put("buildToolsRev", androidBuilder.getTargetInfo().getBuildTools().getRevision().toString()); return params; }
@Override public File call() throws Exception { final TargetInfo info = scope.getGlobalScope().getAndroidBuilder().getTargetInfo(); if (info == null) { return null; } String path = info.getBuildTools().getPath(ZIP_ALIGN); if (path == null) { return null; } return new File(path); } });
private ApkInfoParser.ApkInfo loadTestedApkInfo() { File aaptFile = new File(androidBuilder.getTargetInfo().getBuildTools() .getPath(BuildToolInfo.PathId.AAPT)); ApkInfoParser apkInfoParser = new ApkInfoParser(aaptFile, androidBuilder.getProcessExecutor()); try { return apkInfoParser.parseApk(getMainApk()); } catch (ProcessException e) { throw new RuntimeException(e); } }
private ApkInfoParser.ApkInfo loadTestedApkInfo() { File aaptFile = new File(androidBuilder.getTargetInfo().getBuildTools() .getPath(BuildToolInfo.PathId.AAPT)); ApkInfoParser apkInfoParser = new ApkInfoParser(aaptFile, androidBuilder.getProcessExecutor()); try { return apkInfoParser.parseApk(getMainApk()); } catch (ProcessException e) { throw new RuntimeException(e); } }
private PngCruncher getCruncher() { if (getUseNewCruncher()) { if (getBuilder().getTargetInfo().getBuildTools().getRevision().getMajor() >= 22) { return QueuedCruncher.Builder.INSTANCE.newCruncher( getBuilder().getTargetInfo().getBuildTools().getPath( BuildToolInfo.PathId.AAPT), getILogger()); } getLogger().info("New PNG cruncher will be enabled with build tools 22 and above."); } return getBuilder().getAaptCruncher(); }
private static Pair<Dependency, DependencyNode> handleRenderscriptSupport( @NonNull VariantConfiguration variantConfiguration, @NonNull AndroidBuilder androidBuilder) { if (variantConfiguration.getRenderscriptSupportModeEnabled()) { File supportJar = androidBuilder.getRenderScriptSupportJar(); if (supportJar != null) { return sRSCache.get(Pair.of( supportJar, androidBuilder.getTargetInfo().getBuildTools().getRevision().toString())); } } return null; } }