use of com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator in project android by JetBrains.
the class ComponentInstaller method getPackagesToInstall.
public List<RemotePackage> getPackagesToInstall(@NotNull Iterable<? extends InstallableComponent> components) throws SdkQuickfixUtils.PackageResolutionException {
// TODO: Prompt about connection in handoff case?
Set<UpdatablePackage> requests = Sets.newHashSet();
StudioLoggerProgressIndicator progress = new StudioLoggerProgressIndicator(getClass());
RepoManager sdkManager = mySdkHandler.getSdkManager(progress);
for (InstallableComponent component : components) {
requests.addAll(component.getPackagesToInstall());
}
List<UpdatablePackage> resolved = Lists.newArrayList();
resolved.addAll(SdkQuickfixUtils.resolve(requests, sdkManager.getPackages()));
List<RemotePackage> result = Lists.newArrayList();
for (UpdatablePackage p : resolved) {
result.add(p.getRemote());
}
return result;
}
use of com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator in project android by JetBrains.
the class GradleImport method getBuildToolsVersion.
String getBuildToolsVersion() {
AndroidSdkHandler sdkHandler = AndroidSdkHandler.getInstance(mySdkLocation);
StudioLoggerProgressIndicator progress = new StudioLoggerProgressIndicator(getClass());
BuildToolInfo buildTool = sdkHandler.getLatestBuildTool(progress, false);
if (buildTool == null) {
buildTool = sdkHandler.getLatestBuildTool(progress, true);
}
if (buildTool != null) {
return buildTool.getRevision().toString();
}
return CURRENT_BUILD_TOOLS_VERSION;
}
use of com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator in project android by JetBrains.
the class IdeSdks method isJdk7Supported.
public boolean isJdk7Supported(@Nullable AndroidSdkData sdkData) {
if (sdkData != null) {
ProgressIndicator progress = new StudioLoggerProgressIndicator(Jdks.class);
LocalPackage info = sdkData.getSdkHandler().getLocalPackage(SdkConstants.FD_PLATFORM_TOOLS, progress);
if (info != null) {
Revision revision = info.getVersion();
if (revision.getMajor() >= 19) {
JavaSdk jdk = JavaSdk.getInstance();
Sdk sdk = ProjectJdkTable.getInstance().findMostRecentSdkOfType(jdk);
if (sdk != null) {
JavaSdkVersion version = jdk.getVersion(sdk);
if (version != null && version.isAtLeast(JavaSdkVersion.JDK_1_7)) {
return true;
}
}
}
}
}
return false;
}
use of com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator in project android by JetBrains.
the class AndroidSdks method tryToCreate.
@Nullable
public Sdk tryToCreate(@NotNull File sdkPath, @NotNull String targetHashString) {
AndroidSdkData sdkData = getSdkData(sdkPath);
if (sdkData != null) {
sdkData.getSdkHandler().getSdkManager(new StudioLoggerProgressIndicator(AndroidSdks.class)).markInvalid();
IAndroidTarget target = sdkData.findTargetByHashString(targetHashString);
if (target != null) {
return create(target, sdkData.getLocation(), true);
}
}
return null;
}
use of com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator in project android by JetBrains.
the class NewModuleWizardState method putSdkDependentParams.
public void putSdkDependentParams() {
final AndroidSdkHandler sdkHandler = AndroidSdks.getInstance().tryToChooseSdkHandler();
BuildToolInfo buildTool = sdkHandler.getLatestBuildTool(new StudioLoggerProgressIndicator(getClass()), false);
if (buildTool != null) {
// If buildTool is null, the template will use buildApi instead, which might be good enough.
put(ATTR_BUILD_TOOLS_VERSION, buildTool.getRevision().toString());
}
File location = sdkHandler.getLocation();
if (location != null) {
// Gradle expects a platform-neutral path
put(ATTR_SDK_DIR, FileUtil.toSystemIndependentName(location.getPath()));
}
}
Aggregations