summaryrefslogtreecommitdiff
path: root/src/plugins/android/androidsettingswidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/android/androidsettingswidget.cpp')
-rw-r--r--src/plugins/android/androidsettingswidget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index 8a0163df7d..2cbbbdc6fa 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -278,6 +278,7 @@ void AndroidSettingsWidget::sdkLocationEditingFinished()
return;
}
m_androidConfig.sdkLocation = location;
+ searchForAnt(location.toString());
saveSettings(true);
m_AVDModel.setAvdList(AndroidConfigurations::instance().androidVirtualDevices());
m_ui->AVDManagerFrame->setEnabled(true);
@@ -289,9 +290,28 @@ void AndroidSettingsWidget::ndkLocationEditingFinished()
m_androidConfig.toolchainHost.clear(); // force toolchain host detection
if (!checkNDK(location))
return;
+ searchForAnt(location.toString());
saveSettings(true);
}
+void AndroidSettingsWidget::searchForAnt(const QString &location)
+{
+ if (!m_androidConfig.antLocation.isEmpty())
+ return;
+ if (location.isEmpty())
+ return;
+ QDir parentFolder = QFileInfo(location).absoluteDir();
+ foreach (const QString &file, parentFolder.entryList()) {
+ if (file.startsWith(QLatin1String("apache-ant"))) {
+ QString ant = parentFolder.absolutePath() + QLatin1Char('/') + file + QLatin1String("/bin/ant.bat");
+ if (QFileInfo(ant).exists()) {
+ m_androidConfig.antLocation = Utils::FileName::fromString(ant);
+ m_ui->AntLocationLineEdit->setText(ant);
+ }
+ }
+ }
+}
+
void AndroidSettingsWidget::antLocationEditingFinished()
{
Utils::FileName location = Utils::FileName::fromUserInput(m_ui->AntLocationLineEdit->text());