use of com.android.tools.idea.gradle.util.LocalProperties in project android by JetBrains.
the class NativeDebuggerGuiTestRule method updateLocalProperties.
@Override
protected void updateLocalProperties(@NotNull File projectPath) throws IOException {
super.updateLocalProperties(projectPath);
LocalProperties localProperties = new LocalProperties(projectPath);
localProperties.setAndroidNdkPath(getAndroidNdkPath());
localProperties.save();
}
use of com.android.tools.idea.gradle.util.LocalProperties in project android by JetBrains.
the class AndroidGradleTestCase method updateLocalProperties.
private void updateLocalProperties() throws IOException {
LocalProperties localProperties = new LocalProperties(getProject());
File sdkPath = getSdk();
assertAbout(file()).that(sdkPath).named("Android SDK path").isDirectory();
localProperties.setAndroidSdkPath(sdkPath.getPath());
localProperties.save();
}
use of com.android.tools.idea.gradle.util.LocalProperties in project android by JetBrains.
the class GradleSyncTest method sdkSwitch.
// Verifies that the IDE switches SDKs if the IDE and project SDKs are not the same.
@Test
public void sdkSwitch() throws IOException {
File secondSdkPath = getFilePathPropertyOrSkipTest("second.android.sdk.path", "the path of a secondary Android SDK", true);
getGuiTestSuiteState().setSkipSdkMerge(true);
IdeSdks ideSdks = IdeSdks.getInstance();
File originalSdkPath = ideSdks.getAndroidSdkPath();
guiTest.importSimpleApplication();
IdeFrameFixture ideFrame = guiTest.ideFrame();
// Change the SDK in the project. We expect the IDE to have the same SDK as the project.
LocalProperties localProperties = new LocalProperties(ideFrame.getProject());
localProperties.setAndroidSdkPath(secondSdkPath);
localProperties.save();
ideFrame.requestProjectSync();
MessagesFixture messages = ideFrame.findMessageDialog(ANDROID_SDK_MANAGER_DIALOG_TITLE);
messages.click("Use Project's SDK");
ideFrame.waitForGradleProjectSyncToFinish();
assertThat(ideSdks.getAndroidSdkPath()).isEqualTo(secondSdkPath);
// Set the project's SDK to be the original one. Now we will choose the IDE's SDK.
localProperties = new LocalProperties(ideFrame.getProject());
localProperties.setAndroidSdkPath(originalSdkPath);
localProperties.save();
ideFrame.requestProjectSync();
messages = ideFrame.findMessageDialog(ANDROID_SDK_MANAGER_DIALOG_TITLE);
messages.click("Use Android Studio's SDK");
ideFrame.waitForGradleProjectSyncToFinish();
localProperties = new LocalProperties(ideFrame.getProject());
assertThat(localProperties.getAndroidSdkPath()).isEqualTo(secondSdkPath);
}
use of com.android.tools.idea.gradle.util.LocalProperties in project android by JetBrains.
the class SdkSync method syncIdeAndProjectAndroidSdks.
public void syncIdeAndProjectAndroidSdks(@NotNull Project project) throws IOException {
LocalProperties localProperties = new LocalProperties(project);
syncIdeAndProjectAndroidSdk(localProperties, new FindValidSdkPathTask(myIdeSdks), project);
syncIdeAndProjectAndroidNdk(localProperties);
}
use of com.android.tools.idea.gradle.util.LocalProperties in project android by JetBrains.
the class NewGradleSyncTest method createLocalPropertiesFile.
private void createLocalPropertiesFile(@NotNull File androidSdkPath) throws IOException {
LocalProperties localProperties = new LocalProperties(getProject());
localProperties.setAndroidSdkPath(androidSdkPath);
localProperties.save();
}
Aggregations