/** * Gets the default path/unique id for the given build tools */ public static String getBuildToolsPath(Revision revision) { return SdkConstants.FD_BUILD_TOOLS + RepoPackage.PATH_SEPARATOR + revision.toString("-"); } }
/** * Returns the version in a fixed format major.minor.micro with an optional "rc preview#". For * example it would return "18.0.0", "18.1.0" or "18.1.2 rc5". The character before "rc" is * specified at construction time, and defaults to space. */ @Override public String toString() { return toString(getSeparator()); }
private static String getNewerVersionAvailableMessage(GradleCoordinate dependency, Revision version) { return getNewerVersionAvailableMessage(dependency, version.toString()); }
@NonNull @Override public Map<String, Object> getParameterInputs() { return ImmutableMap.of("buildToolsRev", buildToolInfo.get().getRevision().toString()); }
@Input public String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); }
@Input public String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); }
@Input public String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); } private List<File> sourceDirs;
@Input public String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); }
@Input public String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); }
@Input String getBuildToolsVersion() { return getBuildTools().getRevision().toString(); }
/** * Checks whether the build-tool is valid by verifying that the expected binaries * are actually present. This checks that all known paths point to a valid file * or directory. * * @param log An optional logger. If non-null, errors will be printed there. * @return True if the build-tool folder contains all the expected tools. */ public boolean isValid(@Nullable ILogger log) { for (Map.Entry<PathId, String> entry : mPaths.entrySet()) { File f = new File(entry.getValue()); // check if file is missing. It's only ok if the revision of the build-tools // is lower than the min rev of the element. if (!f.exists() && entry.getKey().isPresentIn(mRevision)) { if (log != null) { log.warning("Build-tool %1$s is missing %2$s at %3$s", //$NON-NLS-1$ mRevision.toString(), entry.getKey(), f.getAbsolutePath()); } return false; } } return true; }
@Override @NonNull public String getName() { return String.format("Uninstall %1$s (revision: %2$s)", mPackage.getDisplayName(), mPackage.getVersion().toString()); } }
@Override @NonNull public String getName() { return String.format("Install %1$s (revision: %2$s)", mPackage.getDisplayName(), mPackage.getVersion().toString()); } }
@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(); }
/** * Try to find an LLDB package at the given location. * Returns null if not found. */ @Nullable private LocalLLDBPkgInfo scanLLDB(@NonNull File lldbFolder) { File pinnedLLDBFolder = new File(lldbFolder, LocalLLDBPkgInfo.PINNED_REVISION.toString()); // Can we find some properties? Properties props = parseProperties(new File(pinnedLLDBFolder, SdkConstants.FN_SOURCE_PROP)); Revision rev = PackageParserUtils.getRevisionProperty(props, PkgProps.PKG_REVISION); if (rev == null) { return null; } return new LocalLLDBPkgInfo(this, pinnedLLDBFolder, props, rev); }
@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; }
@NonNull @Override public Map<String, Object> getParameterInputs() { try { // ATTENTION: if you add something here, consider adding the value to DexKey - it needs // to be saved if affects how dx is invoked. Map<String, Object> params = Maps.newHashMapWithExpectedSize(4); params.put("optimize", true); params.put("predex", dexOptions.getPreDexLibraries()); params.put("jumbo", dexOptions.getJumboMode()); params.put("multidex", multiDex); params.put("multidex-legacy", multiDex && mainDexListFile != null); params.put("java-max-heap-size", dexOptions.getJavaMaxHeapSize()); params.put( "additional-parameters", Iterables.toString(dexOptions.getAdditionalParameters())); TargetInfo targetInfo = androidBuilder.getTargetInfo(); Preconditions.checkState(targetInfo != null, "androidBuilder.targetInfo required for task '%s'.", getName()); BuildToolInfo buildTools = targetInfo.getBuildTools(); params.put("build-tools", buildTools.getRevision().toString()); return params; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Sets the SdkInfo and the targetInfo on the builder. This is required to actually * build (some of the steps). * * @see com.android.builder.sdk.SdkLoader */ public void setTargetInfo(@NonNull TargetInfo targetInfo) { mTargetInfo = targetInfo; mDexByteCodeConverter = new DexByteCodeConverter( getLogger(), mTargetInfo, mJavaProcessExecutor, mVerboseExec); if (mTargetInfo.getBuildTools().getRevision().compareTo(MIN_BUILD_TOOLS_REV) < 0) { mErrorReporter.handleSyncError( MIN_BUILD_TOOLS_REV.toString(), SyncIssue.TYPE_BUILD_TOOLS_TOO_LOW, String.format( "The SDK Build Tools revision (%1$s) is too low for project '%2$s'. " + "Minimum required is %3$s", mTargetInfo.getBuildTools().getRevision(), mProjectId, MIN_BUILD_TOOLS_REV)); } }
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; } }
private static Revision getNewerRevision(@NonNull GradleCoordinate dependency, @NonNull Revision revision) { assert dependency.getGroupId() != null; assert dependency.getArtifactId() != null; GradleCoordinate coordinate; if (revision.isPreview()) { String coordinateString = dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + revision.toString(); coordinate = GradleCoordinate.parseCoordinateString(coordinateString); } else { coordinate = new GradleCoordinate(dependency.getGroupId(), dependency.getArtifactId(), revision.getMajor(), revision.getMinor(), revision.getMicro()); } if (COMPARE_PLUS_HIGHER.compare(dependency, coordinate) < 0) { return revision; } else { return null; } }