use of com.android.tools.idea.sdk.IdeSdks in project android by JetBrains.
the class GuiTests method setUpSdks.
public static void setUpSdks() {
File androidSdkPath = TestUtils.getSdk();
execute(new GuiTask() {
@Override
protected void executeInEDT() throws Throwable {
IdeSdks ideSdks = IdeSdks.getInstance();
File currentAndroidSdkPath = ideSdks.getAndroidSdkPath();
if (!filesEqual(androidSdkPath, currentAndroidSdkPath)) {
ApplicationManager.getApplication().runWriteAction(() -> {
System.out.println(String.format("Setting Android SDK: '%1$s'", androidSdkPath.getPath()));
ideSdks.setAndroidSdkPath(androidSdkPath, null);
ideSdks.setUseEmbeddedJdk();
System.out.println(String.format("Setting JDK: '%1$s'", ideSdks.getJdkPath()));
System.out.println();
});
}
}
});
}
use of com.android.tools.idea.sdk.IdeSdks in project android by JetBrains.
the class AndroidGradleBuildProcessParametersProviderTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
IdeSdks ideSdks = IdeSdks.getInstance();
if (IdeInfo.getInstance().isAndroidStudio()) {
ApplicationManager.getApplication().runWriteAction(ideSdks::setUseEmbeddedJdk);
}
File jdkPath = ideSdks.getJdkPath();
assert jdkPath != null;
myJdk = Jdks.getInstance().createJdk(jdkPath.getPath());
myParametersProvider = new AndroidGradleBuildProcessParametersProvider(myProject);
}
Aggregations