Android: Remove Ant and make gradle as the default java build tool

All GUI options to choose between  ant and gradle are removed.
Gradle is the only java build tool used now.

Change-Id: I309ff66256c5d40920a5d77a8331c5917c53c185
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Vikas Pachdha
2017-09-08 23:36:13 +02:00
parent f4a8f52b0d
commit 027383814a
16 changed files with 305 additions and 657 deletions

View File

@@ -65,8 +65,6 @@ const char DeployActionKey[] = "Qt4ProjectManager.AndroidDeployQtStep.DeployQtAc
const char KeystoreLocationKey[] = "KeystoreLocation"; const char KeystoreLocationKey[] = "KeystoreLocation";
const char BuildTargetSdkKey[] = "BuildTargetSdk"; const char BuildTargetSdkKey[] = "BuildTargetSdk";
const char VerboseOutputKey[] = "VerboseOutput"; const char VerboseOutputKey[] = "VerboseOutput";
const char UseGradleKey[] = "UseGradle";
class PasswordInputDialog : public QDialog { class PasswordInputDialog : public QDialog {
public: public:
@@ -96,9 +94,6 @@ AndroidBuildApkStep::AndroidBuildApkStep(ProjectExplorer::BuildStepList *parent,
: ProjectExplorer::AbstractProcessStep(parent, id), : ProjectExplorer::AbstractProcessStep(parent, id),
m_buildTargetSdk(AndroidConfig::apiLevelNameFor(AndroidConfigurations::currentConfig().highestAndroidSdk())) m_buildTargetSdk(AndroidConfig::apiLevelNameFor(AndroidConfigurations::currentConfig().highestAndroidSdk()))
{ {
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0))
m_useGradle = AndroidConfigurations::currentConfig().useGrandle();
//: AndroidBuildApkStep default display name //: AndroidBuildApkStep default display name
setDefaultDisplayName(tr("Build Android APK")); setDefaultDisplayName(tr("Build Android APK"));
} }
@@ -109,14 +104,10 @@ AndroidBuildApkStep::AndroidBuildApkStep(ProjectExplorer::BuildStepList *parent,
m_deployAction(other->deployAction()), m_deployAction(other->deployAction()),
m_signPackage(other->signPackage()), m_signPackage(other->signPackage()),
m_verbose(other->m_verbose), m_verbose(other->m_verbose),
m_useGradle(other->m_useGradle),
m_openPackageLocation(other->m_openPackageLocation), m_openPackageLocation(other->m_openPackageLocation),
// leave m_openPackageLocationForRun at false // leave m_openPackageLocationForRun at false
m_buildTargetSdk(other->m_buildTargetSdk) m_buildTargetSdk(other->m_buildTargetSdk)
{ {
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (m_useGradle && version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0))
m_useGradle = false;
} }
bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
@@ -138,11 +129,18 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
return false; return false;
const QVersionNumber sdkToolsVersion = AndroidConfigurations::currentConfig().sdkToolsVersion(); const QVersionNumber sdkToolsVersion = AndroidConfigurations::currentConfig().sdkToolsVersion();
if (sdkToolsVersion >= gradleScriptRevokedSdkVersion && if (sdkToolsVersion >= gradleScriptRevokedSdkVersion) {
!version->sourcePath().appendPath("src/3rdparty/gradle").exists()) { if (!version->sourcePath().appendPath("src/3rdparty/gradle").exists()) {
emit addOutput(tr("The installed SDK tools version (%1) does not include Gradle scripts. The " emit addOutput(tr("The installed SDK tools version (%1) does not include Gradle "
"minimum Qt version required for Gradle build to work is %2.") "scripts. The minimum Qt version required for Gradle build to work "
.arg(sdkToolsVersion.toString()).arg("5.9.0/5.6.3"), OutputFormat::Stderr); "is %2").arg(sdkToolsVersion.toString()).arg("5.9.0/5.6.3"),
OutputFormat::Stderr);
return false;
}
} else if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
emit addOutput(tr("The minimum Qt version required for Gradle build to work is %2. "
"It is recommended to install the latest Qt version.")
.arg("5.4.0"), OutputFormat::Stderr);
return false; return false;
} }
@@ -241,7 +239,6 @@ bool AndroidBuildApkStep::fromMap(const QVariantMap &map)
if (m_buildTargetSdk.isEmpty()) if (m_buildTargetSdk.isEmpty())
m_buildTargetSdk = AndroidConfig::apiLevelNameFor(AndroidConfigurations::currentConfig().highestAndroidSdk()); m_buildTargetSdk = AndroidConfig::apiLevelNameFor(AndroidConfigurations::currentConfig().highestAndroidSdk());
m_verbose = map.value(VerboseOutputKey).toBool(); m_verbose = map.value(VerboseOutputKey).toBool();
m_useGradle = map.value(UseGradleKey).toBool();
return ProjectExplorer::BuildStep::fromMap(map); return ProjectExplorer::BuildStep::fromMap(map);
} }
@@ -252,7 +249,6 @@ QVariantMap AndroidBuildApkStep::toMap() const
map.insert(KeystoreLocationKey, m_keystorePath.toString()); map.insert(KeystoreLocationKey, m_keystorePath.toString());
map.insert(BuildTargetSdkKey, m_buildTargetSdk); map.insert(BuildTargetSdkKey, m_buildTargetSdk);
map.insert(VerboseOutputKey, m_verbose); map.insert(VerboseOutputKey, m_verbose);
map.insert(UseGradleKey, m_useGradle);
return map; return map;
} }
@@ -269,7 +265,6 @@ QString AndroidBuildApkStep::buildTargetSdk() const
void AndroidBuildApkStep::setBuildTargetSdk(const QString &sdk) void AndroidBuildApkStep::setBuildTargetSdk(const QString &sdk)
{ {
m_buildTargetSdk = sdk; m_buildTargetSdk = sdk;
if (m_useGradle)
AndroidManager::updateGradleProperties(target()); AndroidManager::updateGradleProperties(target());
} }
@@ -330,21 +325,6 @@ void AndroidBuildApkStep::setVerboseOutput(bool verbose)
m_verbose = verbose; m_verbose = verbose;
} }
bool AndroidBuildApkStep::useGradle() const
{
return m_useGradle;
}
void AndroidBuildApkStep::setUseGradle(bool b)
{
if (m_useGradle != b) {
m_useGradle = b;
if (m_useGradle)
AndroidManager::updateGradleProperties(target());
emit useGradleChanged();
}
}
bool AndroidBuildApkStep::addDebugger() const bool AndroidBuildApkStep::addDebugger() const
{ {
return m_addDebugger; return m_addDebugger;

View File

@@ -69,9 +69,6 @@ public:
bool verboseOutput() const; bool verboseOutput() const;
void setVerboseOutput(bool verbose); void setVerboseOutput(bool verbose);
bool useGradle() const;
void setUseGradle(bool b);
bool addDebugger() const; bool addDebugger() const;
void setAddDebugger(bool debug); void setAddDebugger(bool debug);
@@ -81,9 +78,6 @@ public:
virtual Utils::FileName androidPackageSourceDir() const = 0; virtual Utils::FileName androidPackageSourceDir() const = 0;
void setDeployAction(AndroidDeployAction deploy); void setDeployAction(AndroidDeployAction deploy);
signals:
void useGradleChanged();
protected: protected:
Q_INVOKABLE void showInGraphicalShell(); Q_INVOKABLE void showInGraphicalShell();
@@ -101,7 +95,6 @@ protected:
AndroidDeployAction m_deployAction = BundleLibrariesDeployment; AndroidDeployAction m_deployAction = BundleLibrariesDeployment;
bool m_signPackage = false; bool m_signPackage = false;
bool m_verbose = false; bool m_verbose = false;
bool m_useGradle = true; // Ant builds are deprecated.
bool m_openPackageLocation = false; bool m_openPackageLocation = false;
bool m_openPackageLocationForRun = false; bool m_openPackageLocationForRun = false;
bool m_addDebugger = true; bool m_addDebugger = true;

View File

@@ -54,8 +54,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->deprecatedInfoIconLabel->setPixmap(Utils::Icons::INFO.pixmap());
// Target sdk combobox // Target sdk combobox
int minApiLevel = 9; int minApiLevel = 9;
const AndroidConfig &config = AndroidConfigurations::currentConfig(); const AndroidConfig &config = AndroidConfigurations::currentConfig();
@@ -90,9 +88,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
m_ui->signingDebugWarningLabel->hide(); m_ui->signingDebugWarningLabel->hide();
signPackageCheckBoxToggled(m_step->signPackage()); signPackageCheckBoxToggled(m_step->signPackage());
m_ui->useGradleCheckBox->setEnabled(config.antScriptsAvailable());
m_ui->useGradleCheckBox->setChecked(!config.antScriptsAvailable() ||
m_step->useGradle());
m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput()); m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput());
m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation()); m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation());
m_ui->addDebuggerCheckBox->setChecked(m_step->addDebugger()); m_ui->addDebuggerCheckBox->setChecked(m_step->addDebugger());
@@ -108,8 +103,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
connect(m_ui->bundleQtOption, &QAbstractButton::clicked, connect(m_ui->bundleQtOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::setBundleQtLibs); this, &AndroidBuildApkWidget::setBundleQtLibs);
connect(m_ui->useGradleCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::useGradleCheckBoxToggled);
connect(m_ui->openPackageLocationCheckBox, &QAbstractButton::toggled, connect(m_ui->openPackageLocationCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::openPackageLocationCheckBoxToggled); this, &AndroidBuildApkWidget::openPackageLocationCheckBoxToggled);
connect(m_ui->verboseOutputCheckBox, &QAbstractButton::toggled, connect(m_ui->verboseOutputCheckBox, &QAbstractButton::toggled,
@@ -135,9 +128,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
this, &AndroidBuildApkWidget::updateSigningWarning); this, &AndroidBuildApkWidget::updateSigningWarning);
updateSigningWarning(); updateSigningWarning();
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(step->target()->kit());
bool qt54 = qt->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
m_ui->useGradleCheckBox->setVisible(qt54);
} }
AndroidBuildApkWidget::~AndroidBuildApkWidget() AndroidBuildApkWidget::~AndroidBuildApkWidget()
@@ -247,8 +237,3 @@ void AndroidBuildApkWidget::updateSigningWarning()
m_ui->signingDebugWarningLabel->setVisible(false); m_ui->signingDebugWarningLabel->setVisible(false);
} }
} }
void AndroidBuildApkWidget::useGradleCheckBoxToggled(bool checked)
{
m_step->setUseGradle(checked);
}

View File

@@ -57,7 +57,6 @@ private:
void certificatesAliasComboBoxCurrentIndexChanged(const QString &alias); void certificatesAliasComboBoxCurrentIndexChanged(const QString &alias);
void certificatesAliasComboBoxActivated(const QString &alias); void certificatesAliasComboBoxActivated(const QString &alias);
void updateSigningWarning(); void updateSigningWarning();
void useGradleCheckBoxToggled(bool checked);
void openPackageLocationCheckBoxToggled(bool checked); void openPackageLocationCheckBoxToggled(bool checked);
void verboseOutputCheckBoxToggled(bool checked); void verboseOutputCheckBoxToggled(bool checked);
void updateKeyStorePath(const QString &path); void updateKeyStorePath(const QString &path);

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>819</width> <width>641</width>
<height>478</height> <height>331</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -145,66 +145,21 @@
<string>Advanced Actions</string> <string>Advanced Actions</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="useGradleCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use Gradle (Ant builds are deprecated)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="deprecatedInfoIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Gradle builds are forced from Android SDK tools version 25.3.0 onwards as Ant scripts are no longer available.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="openPackageLocationCheckBox"> <widget class="QCheckBox" name="openPackageLocationCheckBox">
<property name="text"> <property name="text">
<string>Open package location after build</string> <string>Open package location after build</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="3"> <item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="verboseOutputCheckBox"> <widget class="QCheckBox" name="verboseOutputCheckBox">
<property name="text"> <property name="text">
<string>Verbose output</string> <string>Verbose output</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="addDebuggerCheckBox"> <widget class="QCheckBox" name="addDebuggerCheckBox">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>

View File

@@ -84,16 +84,13 @@ using namespace Internal;
namespace { namespace {
const char jdkSettingsPath[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit"; const char jdkSettingsPath[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit";
const QVersionNumber sdkToolsAntMissingVersion(25, 3, 0);
const QLatin1String SettingsGroup("AndroidConfigurations"); const QLatin1String SettingsGroup("AndroidConfigurations");
const QLatin1String SDKLocationKey("SDKLocation"); const QLatin1String SDKLocationKey("SDKLocation");
const QLatin1String NDKLocationKey("NDKLocation"); const QLatin1String NDKLocationKey("NDKLocation");
const QLatin1String AntLocationKey("AntLocation");
const QLatin1String OpenJDKLocationKey("OpenJDKLocation"); const QLatin1String OpenJDKLocationKey("OpenJDKLocation");
const QLatin1String KeystoreLocationKey("KeystoreLocation"); const QLatin1String KeystoreLocationKey("KeystoreLocation");
const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation"); const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation");
const QLatin1String UseGradleKey("UseGradle");
const QLatin1String MakeExtraSearchDirectory("MakeExtraSearchDirectory"); const QLatin1String MakeExtraSearchDirectory("MakeExtraSearchDirectory");
const QLatin1String PartitionSizeKey("PartitionSize"); const QLatin1String PartitionSizeKey("PartitionSize");
const QLatin1String ToolchainHostKey("ToolchainHost"); const QLatin1String ToolchainHostKey("ToolchainHost");
@@ -250,8 +247,6 @@ void AndroidConfig::load(const QSettings &settings)
m_partitionSize = settings.value(PartitionSizeKey, 1024).toInt(); m_partitionSize = settings.value(PartitionSizeKey, 1024).toInt();
m_sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString()); m_sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString());
m_ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString()); m_ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString());
m_antLocation = FileName::fromString(settings.value(AntLocationKey).toString());
m_useGradle = settings.value(UseGradleKey, false).toBool();
m_openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString()); m_openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString());
m_keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString()); m_keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
m_toolchainHost = settings.value(ToolchainHostKey).toString(); m_toolchainHost = settings.value(ToolchainHostKey).toString();
@@ -267,7 +262,6 @@ void AndroidConfig::load(const QSettings &settings)
// persisten settings // persisten settings
m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString()); m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString());
m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString()); m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString());
m_antLocation = FileName::fromString(reader.restoreValue(AntLocationKey, m_antLocation.toString()).toString());
m_openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString()); m_openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString());
m_keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString()); m_keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString());
m_toolchainHost = reader.restoreValue(ToolchainHostKey, m_toolchainHost).toString(); m_toolchainHost = reader.restoreValue(ToolchainHostKey, m_toolchainHost).toString();
@@ -291,8 +285,6 @@ void AndroidConfig::save(QSettings &settings) const
// user settings // user settings
settings.setValue(SDKLocationKey, m_sdkLocation.toString()); settings.setValue(SDKLocationKey, m_sdkLocation.toString());
settings.setValue(NDKLocationKey, m_ndkLocation.toString()); settings.setValue(NDKLocationKey, m_ndkLocation.toString());
settings.setValue(AntLocationKey, m_antLocation.toString());
settings.setValue(UseGradleKey, m_useGradle);
settings.setValue(OpenJDKLocationKey, m_openJDKLocation.toString()); settings.setValue(OpenJDKLocationKey, m_openJDKLocation.toString());
settings.setValue(KeystoreLocationKey, m_keystoreLocation.toString()); settings.setValue(KeystoreLocationKey, m_keystoreLocation.toString());
settings.setValue(PartitionSizeKey, m_partitionSize); settings.setValue(PartitionSizeKey, m_partitionSize);
@@ -400,14 +392,6 @@ FileName AndroidConfig::androidToolPath() const
} }
} }
FileName AndroidConfig::antToolPath() const
{
if (!m_antLocation.isEmpty())
return m_antLocation;
else
return FileName::fromLatin1("ant");
}
FileName AndroidConfig::emulatorToolPath() const FileName AndroidConfig::emulatorToolPath() const
{ {
FileName path = m_sdkLocation; FileName path = m_sdkLocation;
@@ -844,16 +828,6 @@ void AndroidConfig::setNdkLocation(const FileName &ndkLocation)
m_NdkInformationUpToDate = false; m_NdkInformationUpToDate = false;
} }
FileName AndroidConfig::antLocation() const
{
return m_antLocation;
}
void AndroidConfig::setAntLocation(const FileName &antLocation)
{
m_antLocation = antLocation;
}
FileName AndroidConfig::openJDKLocation() const FileName AndroidConfig::openJDKLocation() const
{ {
return m_openJDKLocation; return m_openJDKLocation;
@@ -906,25 +880,6 @@ void AndroidConfig::setAutomaticKitCreation(bool b)
m_automaticKitCreation = b; m_automaticKitCreation = b;
} }
bool AndroidConfig::antScriptsAvailable() const
{
return sdkToolsVersion() < sdkToolsAntMissingVersion;
}
bool AndroidConfig::useGrandle() const
{
if (antScriptsAvailable()) {
return m_useGradle;
}
// Force gradle builds.
return true;
}
void AndroidConfig::setUseGradle(bool b)
{
m_useGradle = b;
}
/////////////////////////////////// ///////////////////////////////////
// AndroidConfigurations // AndroidConfigurations
/////////////////////////////////// ///////////////////////////////////
@@ -1225,16 +1180,6 @@ void AndroidConfigurations::load()
settings->beginGroup(SettingsGroup); settings->beginGroup(SettingsGroup);
m_config.load(*settings); m_config.load(*settings);
if (m_config.antLocation().isEmpty()) {
Environment env = Environment::systemEnvironment();
FileName location = env.searchInPath(QLatin1String("ant"));
QFileInfo fi = location.toFileInfo();
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
m_config.setAntLocation(location);
saveSettings = true;
}
}
if (m_config.openJDKLocation().isEmpty()) { if (m_config.openJDKLocation().isEmpty()) {
if (HostOsInfo::isLinuxHost()) { if (HostOsInfo::isLinuxHost()) {
Environment env = Environment::systemEnvironment(); Environment env = Environment::systemEnvironment();

View File

@@ -119,9 +119,6 @@ public:
QVersionNumber ndkVersion() const; QVersionNumber ndkVersion() const;
void setNdkLocation(const Utils::FileName &ndkLocation); void setNdkLocation(const Utils::FileName &ndkLocation);
Utils::FileName antLocation() const;
void setAntLocation(const Utils::FileName &antLocation);
Utils::FileName openJDKLocation() const; Utils::FileName openJDKLocation() const;
void setOpenJDKLocation(const Utils::FileName &openJDKLocation); void setOpenJDKLocation(const Utils::FileName &openJDKLocation);
@@ -137,14 +134,8 @@ public:
bool automaticKitCreation() const; bool automaticKitCreation() const;
void setAutomaticKitCreation(bool b); void setAutomaticKitCreation(bool b);
bool antScriptsAvailable() const;
bool useGrandle() const;
void setUseGradle(bool b);
Utils::FileName adbToolPath() const; Utils::FileName adbToolPath() const;
Utils::FileName androidToolPath() const; Utils::FileName androidToolPath() const;
Utils::FileName antToolPath() const;
Utils::FileName emulatorToolPath() const; Utils::FileName emulatorToolPath() const;
Utils::FileName sdkManagerToolPath() const; Utils::FileName sdkManagerToolPath() const;
Utils::FileName avdManagerToolPath() const; Utils::FileName avdManagerToolPath() const;
@@ -203,13 +194,11 @@ private:
Utils::FileName m_sdkLocation; Utils::FileName m_sdkLocation;
Utils::FileName m_ndkLocation; Utils::FileName m_ndkLocation;
Utils::FileName m_antLocation;
Utils::FileName m_openJDKLocation; Utils::FileName m_openJDKLocation;
Utils::FileName m_keystoreLocation; Utils::FileName m_keystoreLocation;
QStringList m_makeExtraSearchDirectories; QStringList m_makeExtraSearchDirectories;
unsigned m_partitionSize = 1024; unsigned m_partitionSize = 1024;
bool m_automaticKitCreation = true; bool m_automaticKitCreation = true;
bool m_useGradle = true; // Ant builds are deprecated.
//caches //caches
mutable bool m_availableSdkPlatformsUpToDate = false; mutable bool m_availableSdkPlatformsUpToDate = false;

View File

@@ -233,7 +233,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("bundled")); Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("bundled"));
break; break;
} }
if (androidBuildApkStep->useGradle())
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--gradle")); Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--gradle"));
if (androidBuildApkStep->signPackage()) { if (androidBuildApkStep->signPackage()) {

View File

@@ -463,15 +463,6 @@ AndroidQtSupport *AndroidManager::androidQtSupport(ProjectExplorer::Target *targ
return 0; return 0;
} }
bool AndroidManager::useGradle(ProjectExplorer::Target *target)
{
if (!target)
return false;
AndroidBuildApkStep *buildApkStep
= AndroidGlobal::buildStep<AndroidBuildApkStep>(target->activeBuildConfiguration());
return buildApkStep && buildApkStep->useGradle();
}
typedef QMap<QByteArray, QByteArray> GradleProperties; typedef QMap<QByteArray, QByteArray> GradleProperties;
static GradleProperties readGradleProperties(const QString &path) static GradleProperties readGradleProperties(const QString &path)
@@ -543,7 +534,7 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
AndroidBuildApkStep *buildApkStep AndroidBuildApkStep *buildApkStep
= AndroidGlobal::buildStep<AndroidBuildApkStep>(target->activeBuildConfiguration()); = AndroidGlobal::buildStep<AndroidBuildApkStep>(target->activeBuildConfiguration());
if (!buildApkStep || !buildApkStep->useGradle() || !buildApkStep->androidPackageSourceDir().appendPath(QLatin1String("gradlew")).exists()) if (!buildApkStep || !buildApkStep->androidPackageSourceDir().appendPath(QLatin1String("gradlew")).exists())
return false; return false;
Utils::FileName wrapperProps(buildApkStep->androidPackageSourceDir()); Utils::FileName wrapperProps(buildApkStep->androidPackageSourceDir());

View File

@@ -87,7 +87,6 @@ public:
const QString &alias); const QString &alias);
static bool checkForQt51Files(Utils::FileName fileName); static bool checkForQt51Files(Utils::FileName fileName);
static AndroidQtSupport *androidQtSupport(ProjectExplorer::Target *target); static AndroidQtSupport *androidQtSupport(ProjectExplorer::Target *target);
static bool useGradle(ProjectExplorer::Target *target);
static bool updateGradleProperties(ProjectExplorer::Target *target); static bool updateGradleProperties(ProjectExplorer::Target *target);
static int findApiLevel(const Utils::FileName &platformPath); static int findApiLevel(const Utils::FileName &platformPath);
}; };

View File

@@ -41,11 +41,7 @@ Utils::FileName Android::AndroidQtSupport::apkPath(ProjectExplorer::Target *targ
if (!buildApkStep) if (!buildApkStep)
return Utils::FileName(); return Utils::FileName();
QString apkPath; QString apkPath("build/outputs/apk/android-build-");
if (buildApkStep->useGradle())
apkPath = QLatin1String("build/outputs/apk/android-build-");
else
apkPath = QLatin1String("bin/QtApp-");
if (buildApkStep->signPackage()) if (buildApkStep->signPackage())
apkPath += QLatin1String("release.apk"); apkPath += QLatin1String("release.apk");
else else

View File

@@ -134,8 +134,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->deprecatedInfoIconLabel->setPixmap(Utils::Icons::INFO.pixmap());
connect(&m_checkGdbWatcher, &QFutureWatcherBase::finished, connect(&m_checkGdbWatcher, &QFutureWatcherBase::finished,
this, &AndroidSettingsWidget::checkGdbFinished); this, &AndroidSettingsWidget::checkGdbFinished);
@@ -144,27 +142,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_ui->NDKLocationPathChooser->setFileName(m_androidConfig.ndkLocation()); m_ui->NDKLocationPathChooser->setFileName(m_androidConfig.ndkLocation());
m_ui->NDKLocationPathChooser->setPromptDialogTitle(tr("Select Android NDK folder")); m_ui->NDKLocationPathChooser->setPromptDialogTitle(tr("Select Android NDK folder"));
QString dir;
QString filter;
if (Utils::HostOsInfo::isWindowsHost()) {
dir = QDir::homePath() + QLatin1String("/ant.bat");
filter = QLatin1String("ant (ant.bat)");
} else if (Utils::HostOsInfo::isMacHost()) {
// work around QTBUG-7739 that prohibits filters that don't start with *
dir = QLatin1String("/usr/bin/ant");
filter = QLatin1String("ant (*ant)");
} else {
dir = QLatin1String("/usr/bin/ant");
filter = QLatin1String("ant (ant)");
}
m_ui->AntLocationPathChooser->setFileName(m_androidConfig.antLocation());
m_ui->AntLocationPathChooser->setExpectedKind(Utils::PathChooser::Command);
m_ui->AntLocationPathChooser->setPromptDialogTitle(tr("Select ant Script"));
m_ui->AntLocationPathChooser->setInitialBrowsePathBackup(dir);
m_ui->AntLocationPathChooser->setPromptDialogFilter(filter);
updateGradleBuildUi();
m_ui->OpenJDKLocationPathChooser->setFileName(m_androidConfig.openJDKLocation()); m_ui->OpenJDKLocationPathChooser->setFileName(m_androidConfig.openJDKLocation());
m_ui->OpenJDKLocationPathChooser->setPromptDialogTitle(tr("Select JDK Path")); m_ui->OpenJDKLocationPathChooser->setPromptDialogTitle(tr("Select JDK Path"));
m_ui->DataPartitionSizeSpinBox->setValue(m_androidConfig.partitionSize()); m_ui->DataPartitionSizeSpinBox->setValue(m_androidConfig.partitionSize());
@@ -173,7 +150,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
m_ui->downloadAntToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost()); m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
const QPixmap warningPixmap = Utils::Icons::WARNING.pixmap(); const QPixmap warningPixmap = Utils::Icons::WARNING.pixmap();
@@ -201,8 +177,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
this, &AndroidSettingsWidget::ndkLocationEditingFinished); this, &AndroidSettingsWidget::ndkLocationEditingFinished);
connect(m_ui->SDKLocationPathChooser, &Utils::PathChooser::rawPathChanged, connect(m_ui->SDKLocationPathChooser, &Utils::PathChooser::rawPathChanged,
this, &AndroidSettingsWidget::sdkLocationEditingFinished); this, &AndroidSettingsWidget::sdkLocationEditingFinished);
connect(m_ui->AntLocationPathChooser, &Utils::PathChooser::rawPathChanged,
this, &AndroidSettingsWidget::antLocationEditingFinished);
connect(m_ui->OpenJDKLocationPathChooser, &Utils::PathChooser::rawPathChanged, connect(m_ui->OpenJDKLocationPathChooser, &Utils::PathChooser::rawPathChanged,
this, &AndroidSettingsWidget::openJDKLocationEditingFinished); this, &AndroidSettingsWidget::openJDKLocationEditingFinished);
connect(m_ui->AVDAddPushButton, &QAbstractButton::clicked, connect(m_ui->AVDAddPushButton, &QAbstractButton::clicked,
@@ -225,13 +199,8 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
this, &AndroidSettingsWidget::openSDKDownloadUrl); this, &AndroidSettingsWidget::openSDKDownloadUrl);
connect(m_ui->downloadNDKToolButton, &QAbstractButton::clicked, connect(m_ui->downloadNDKToolButton, &QAbstractButton::clicked,
this, &AndroidSettingsWidget::openNDKDownloadUrl); this, &AndroidSettingsWidget::openNDKDownloadUrl);
connect(m_ui->downloadAntToolButton, &QAbstractButton::clicked,
this, &AndroidSettingsWidget::openAntDownloadUrl);
connect(m_ui->downloadOpenJDKToolButton, &QAbstractButton::clicked, connect(m_ui->downloadOpenJDKToolButton, &QAbstractButton::clicked,
this, &AndroidSettingsWidget::openOpenJDKDownloadUrl); this, &AndroidSettingsWidget::openOpenJDKDownloadUrl);
connect(m_ui->UseGradleCheckBox, &QAbstractButton::toggled,
this, &AndroidSettingsWidget::useGradleToggled);
} }
AndroidSettingsWidget::~AndroidSettingsWidget() AndroidSettingsWidget::~AndroidSettingsWidget()
@@ -473,13 +442,6 @@ void AndroidSettingsWidget::updateAvds()
enableAvdControls(); enableAvdControls();
} }
void AndroidSettingsWidget::updateGradleBuildUi()
{
m_ui->UseGradleCheckBox->setEnabled(m_androidConfig.antScriptsAvailable());
m_ui->UseGradleCheckBox->setChecked(!m_androidConfig.antScriptsAvailable() ||
m_androidConfig.useGrandle());
}
bool AndroidSettingsWidget::verifySdkInstallation(QString *errorDetails) const bool AndroidSettingsWidget::verifySdkInstallation(QString *errorDetails) const
{ {
if (m_androidConfig.sdkLocation().isEmpty()) { if (m_androidConfig.sdkLocation().isEmpty()) {
@@ -522,7 +484,6 @@ void AndroidSettingsWidget::saveSettings()
{ {
sdkLocationEditingFinished(); sdkLocationEditingFinished();
ndkLocationEditingFinished(); ndkLocationEditingFinished();
antLocationEditingFinished();
openJDKLocationEditingFinished(); openJDKLocationEditingFinished();
dataPartitionSizeEditingFinished(); dataPartitionSizeEditingFinished();
AndroidConfigurations::setConfig(m_androidConfig); AndroidConfigurations::setConfig(m_androidConfig);
@@ -531,13 +492,8 @@ void AndroidSettingsWidget::saveSettings()
void AndroidSettingsWidget::sdkLocationEditingFinished() void AndroidSettingsWidget::sdkLocationEditingFinished()
{ {
m_androidConfig.setSdkLocation(Utils::FileName::fromUserInput(m_ui->SDKLocationPathChooser->rawPath())); m_androidConfig.setSdkLocation(Utils::FileName::fromUserInput(m_ui->SDKLocationPathChooser->rawPath()));
updateGradleBuildUi();
check(Sdk); check(Sdk);
if (m_sdkState == Okay)
searchForAnt(m_androidConfig.sdkLocation());
applyToUi(Sdk); applyToUi(Sdk);
} }
@@ -546,41 +502,9 @@ void AndroidSettingsWidget::ndkLocationEditingFinished()
m_androidConfig.setNdkLocation(Utils::FileName::fromUserInput(m_ui->NDKLocationPathChooser->rawPath())); m_androidConfig.setNdkLocation(Utils::FileName::fromUserInput(m_ui->NDKLocationPathChooser->rawPath()));
check(Ndk); check(Ndk);
if (m_ndkState == Okay)
searchForAnt(m_androidConfig.ndkLocation());
applyToUi(Ndk); applyToUi(Ndk);
} }
void AndroidSettingsWidget::searchForAnt(const Utils::FileName &location)
{
if (!m_androidConfig.antLocation().isEmpty())
return;
if (location.isEmpty())
return;
QDir parentFolder = location.toFileInfo().absoluteDir();
foreach (const QString &file, parentFolder.entryList()) {
if (file.startsWith(QLatin1String("apache-ant"))) {
Utils::FileName ant = Utils::FileName::fromString(parentFolder.absolutePath());
ant.appendPath(file).appendPath(QLatin1String("bin"));
if (Utils::HostOsInfo::isWindowsHost())
ant.appendPath(QLatin1String("ant.bat"));
else
ant.appendPath(QLatin1String("ant"));
if (ant.exists()) {
m_androidConfig.setAntLocation(ant);
m_ui->AntLocationPathChooser->setFileName(ant);
}
}
}
}
void AndroidSettingsWidget::antLocationEditingFinished()
{
m_androidConfig.setAntLocation(Utils::FileName::fromUserInput(m_ui->AntLocationPathChooser->rawPath()));
}
void AndroidSettingsWidget::openJDKLocationEditingFinished() void AndroidSettingsWidget::openJDKLocationEditingFinished()
{ {
m_androidConfig.setOpenJDKLocation(Utils::FileName::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath())); m_androidConfig.setOpenJDKLocation(Utils::FileName::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath()));
@@ -599,11 +523,6 @@ void AndroidSettingsWidget::openNDKDownloadUrl()
QDesktopServices::openUrl(QUrl::fromUserInput("https://developer.android.com/ndk/downloads/")); QDesktopServices::openUrl(QUrl::fromUserInput("https://developer.android.com/ndk/downloads/"));
} }
void AndroidSettingsWidget::openAntDownloadUrl()
{
QDesktopServices::openUrl(QUrl::fromUserInput("http://ant.apache.org/bindownload.cgi"));
}
void AndroidSettingsWidget::openOpenJDKDownloadUrl() void AndroidSettingsWidget::openOpenJDKDownloadUrl()
{ {
QDesktopServices::openUrl(QUrl::fromUserInput("http://www.oracle.com/technetwork/java/javase/downloads/")); QDesktopServices::openUrl(QUrl::fromUserInput("http://www.oracle.com/technetwork/java/javase/downloads/"));
@@ -672,11 +591,6 @@ void AndroidSettingsWidget::createKitToggled()
m_androidConfig.setAutomaticKitCreation(m_ui->CreateKitCheckBox->isChecked()); m_androidConfig.setAutomaticKitCreation(m_ui->CreateKitCheckBox->isChecked());
} }
void AndroidSettingsWidget::useGradleToggled()
{
m_androidConfig.setUseGradle(m_ui->UseGradleCheckBox->isChecked());
}
void AndroidSettingsWidget::checkGdbFinished() void AndroidSettingsWidget::checkGdbFinished()
{ {
QPair<QStringList, bool> result = m_checkGdbWatcher.future().result(); QPair<QStringList, bool> result = m_checkGdbWatcher.future().result();

View File

@@ -75,12 +75,9 @@ public:
private: private:
void sdkLocationEditingFinished(); void sdkLocationEditingFinished();
void ndkLocationEditingFinished(); void ndkLocationEditingFinished();
void searchForAnt(const Utils::FileName &location);
void antLocationEditingFinished();
void openJDKLocationEditingFinished(); void openJDKLocationEditingFinished();
void openSDKDownloadUrl(); void openSDKDownloadUrl();
void openNDKDownloadUrl(); void openNDKDownloadUrl();
void openAntDownloadUrl();
void openOpenJDKDownloadUrl(); void openOpenJDKDownloadUrl();
void addAVD(); void addAVD();
void avdAdded(); void avdAdded();
@@ -90,12 +87,10 @@ private:
void dataPartitionSizeEditingFinished(); void dataPartitionSizeEditingFinished();
void manageAVD(); void manageAVD();
void createKitToggled(); void createKitToggled();
void useGradleToggled();
void checkGdbFinished(); void checkGdbFinished();
void showGdbWarningDialog(); void showGdbWarningDialog();
void updateAvds(); void updateAvds();
void updateGradleBuildUi();
private: private:
enum Mode { Sdk = 1, Ndk = 2, Java = 4, All = Sdk | Ndk | Java }; enum Mode { Sdk = 1, Ndk = 2, Java = 4, All = Sdk | Ndk | Java };

View File

@@ -14,376 +14,16 @@
<string>Android Configuration</string> <string>Android Configuration</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="4" column="1">
<widget class="QLabel" name="OpenJDKLocationLabel"> <widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>JDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="jdkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="jdkWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="downloadOpenJDKToolButton">
<property name="toolTip">
<string>Download JDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="SDKLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Android SDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/> <widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/>
</item> </item>
<item row="2" column="2"> <item row="0" column="1">
<widget class="QToolButton" name="downloadSDKToolButton"> <widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/>
<property name="toolTip">
<string>Download Android SDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item> </item>
<item row="3" column="1"> <item row="10" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="sdkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sdkWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="NDKLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Android NDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="downloadNDKToolButton">
<property name="toolTip">
<string>Download Android NDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="gdbWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="gdbWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;a href=&quot;xx&quot;&gt;The GDB in the NDK appears to have broken python support.&lt;/a&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="ndkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="toolchainFoundLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="CreateKitCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Automatically create kits for Android tool chains</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="kitWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="kitWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="UseGradleCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use Gradle instead of Ant (Ant builds are deprecated)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="deprecatedInfoIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Gradle builds are forced from Android SDK tools version 25.3.0 onwards as Ant scripts are no longer available.</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="0">
<widget class="QLabel" name="AntLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Ant executable:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="Utils::PathChooser" name="AntLocationPathChooser" native="true"/>
</item>
<item row="11" column="2">
<widget class="QToolButton" name="downloadAntToolButton">
<property name="toolTip">
<string>Download Ant</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<widget class="QFrame" name="AVDManagerFrame"> <widget class="QFrame" name="AVDManagerFrame">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
@@ -502,6 +142,281 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="jdkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="jdkWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="downloadNDKToolButton">
<property name="toolTip">
<string>Download Android NDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="sdkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sdkWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="OpenJDKLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>JDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="ndkWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="toolchainFoundLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="NDKLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Android NDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="downloadSDKToolButton">
<property name="toolTip">
<string>Download Android SDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="CreateKitCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Automatically create kits for Android tool chains</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="kitWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="kitWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="gdbWarningIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="gdbWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;a href=&quot;xx&quot;&gt;The GDB in the NDK appears to have broken python support.&lt;/a&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="downloadOpenJDKToolButton">
<property name="toolTip">
<string>Download JDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
<normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="SDKLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Android SDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>

View File

@@ -88,12 +88,8 @@ bool AndroidPackageInstallationStep::init(QList<const BuildStep *> &earlierSteps
m_androidDirsToClean.clear(); m_androidDirsToClean.clear();
// don't remove gradle's cache, it takes ages to rebuild it. // don't remove gradle's cache, it takes ages to rebuild it.
if (!QFile::exists(dirPath + "/build.xml") && Android::AndroidManager::useGradle(target())) {
m_androidDirsToClean << dirPath + "/assets"; m_androidDirsToClean << dirPath + "/assets";
m_androidDirsToClean << dirPath + "/libs"; m_androidDirsToClean << dirPath + "/libs";
} else {
m_androidDirsToClean << dirPath;
}
return AbstractProcessStep::init(earlierSteps); return AbstractProcessStep::init(earlierSteps);
} }

View File

@@ -172,11 +172,7 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
if (m_verbose) if (m_verbose)
arguments << "--verbose"; arguments << "--verbose";
if (m_useGradle)
arguments << "--gradle"; arguments << "--gradle";
else
arguments << "--ant" << AndroidConfigurations::currentConfig().antToolPath().toString();
QStringList argumentsPasswordConcealed = arguments; QStringList argumentsPasswordConcealed = arguments;