forked from qt-creator/qt-creator
Android: Remove remaining uses of FileName::appendPath()
Change-Id: I33fb650f357d93d177e5977b21b14b42894f571a Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -643,12 +643,12 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
|
|||||||
|
|
||||||
const QString sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString();
|
const QString sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString();
|
||||||
QFileInfo sourceDirInfo(sourceDirName);
|
QFileInfo sourceDirInfo(sourceDirName);
|
||||||
FileName packageSourceDir = FileName::fromString(sourceDirInfo.canonicalFilePath());
|
const FileName packageSourceDir = FileName::fromString(sourceDirInfo.canonicalFilePath())
|
||||||
if (!packageSourceDir.appendPath("gradlew").exists())
|
.pathAppended("gradlew");
|
||||||
|
if (!packageSourceDir.exists())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Utils::FileName wrapperProps = packageSourceDir;
|
const FileName wrapperProps = packageSourceDir.pathAppended("gradle/wrapper/gradle-wrapper.properties");
|
||||||
wrapperProps.appendPath(QLatin1String("gradle/wrapper/gradle-wrapper.properties"));
|
|
||||||
if (wrapperProps.exists()) {
|
if (wrapperProps.exists()) {
|
||||||
GradleProperties wrapperProperties = readGradleProperties(wrapperProps.toString());
|
GradleProperties wrapperProperties = readGradleProperties(wrapperProps.toString());
|
||||||
QString distributionUrl = QString::fromLocal8Bit(wrapperProperties["distributionUrl"]);
|
QString distributionUrl = QString::fromLocal8Bit(wrapperProperties["distributionUrl"]);
|
||||||
@@ -661,10 +661,11 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
|
|||||||
|
|
||||||
GradleProperties localProperties;
|
GradleProperties localProperties;
|
||||||
localProperties["sdk.dir"] = AndroidConfigurations::currentConfig().sdkLocation().toString().toLocal8Bit();
|
localProperties["sdk.dir"] = AndroidConfigurations::currentConfig().sdkLocation().toString().toLocal8Bit();
|
||||||
if (!mergeGradleProperties(packageSourceDir.appendPath("local.properties").toString(), localProperties))
|
const FileName localPropertiesFile = packageSourceDir.pathAppended("local.properties");
|
||||||
|
if (!mergeGradleProperties(localPropertiesFile.toString(), localProperties))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString gradlePropertiesPath = packageSourceDir.appendPath("gradle.properties").toString();
|
const QString gradlePropertiesPath = packageSourceDir.pathAppended("gradle.properties").toString();
|
||||||
GradleProperties gradleProperties = readGradleProperties(gradlePropertiesPath);
|
GradleProperties gradleProperties = readGradleProperties(gradlePropertiesPath);
|
||||||
gradleProperties["qt5AndroidDir"] = version->qmakeProperty("QT_INSTALL_PREFIX")
|
gradleProperties["qt5AndroidDir"] = version->qmakeProperty("QT_INSTALL_PREFIX")
|
||||||
.append(QLatin1String("/src/android/java")).toLocal8Bit();
|
.append(QLatin1String("/src/android/java")).toLocal8Bit();
|
||||||
|
|||||||
Reference in New Issue
Block a user