Android: Add Android tool manager

Refactor the use of android tool and groundwork for the new sdk
and avd management tool's integration

Task-number: QTCREATORBUG-17814
Change-Id: I6a5920f9ba92508f904cd8cf28bf62c82de2d820
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Vikas Pachdha
2017-03-30 14:43:13 +02:00
parent f173dc82df
commit 198c83ea70
12 changed files with 472 additions and 284 deletions

View File

@@ -66,6 +66,7 @@ namespace {
const QLatin1String AndroidManifestName("AndroidManifest.xml");
const QLatin1String AndroidDefaultPropertiesName("project.properties");
const QLatin1String AndroidDeviceSn("AndroidDeviceSerialNumber");
const QLatin1String ApiLevelKey("AndroidVersion.ApiLevel");
} // anonymous namespace
@@ -580,4 +581,19 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
return mergeGradleProperties(gradlePropertiesPath, gradleProperties);
}
int AndroidManager::findApiLevel(const Utils::FileName &platformPath)
{
int apiLevel = -1;
Utils::FileName propertiesPath = platformPath;
propertiesPath.appendPath("/source.properties");
if (propertiesPath.exists()) {
QSettings sdkProperties(propertiesPath.toString(), QSettings::IniFormat);
bool validInt = false;
apiLevel = sdkProperties.value(ApiLevelKey).toInt(&validInt);
if (!validInt)
apiLevel = -1;
}
return apiLevel;
}
} // namespace Android