forked from qt-creator/qt-creator
Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -429,11 +429,11 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi
|
||||
} else if (valueForKey(avdInfoNameKey, line, &value)) {
|
||||
avd->avdname = value;
|
||||
} else if (valueForKey(avdInfoPathKey, line, &value)) {
|
||||
const Utils::FileName avdPath = Utils::FileName::fromString(value);
|
||||
const Utils::FilePath avdPath = Utils::FilePath::fromString(value);
|
||||
if (avdPath.exists())
|
||||
{
|
||||
// Get ABI.
|
||||
const Utils::FileName configFile = avdPath.pathAppended("config.ini");
|
||||
const Utils::FilePath configFile = avdPath.pathAppended("config.ini");
|
||||
QSettings config(configFile.toString(), QSettings::IniFormat);
|
||||
value = config.value(avdInfoAbiKey).toString();
|
||||
if (!value.isEmpty())
|
||||
@@ -443,7 +443,7 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi
|
||||
|
||||
// Get Target
|
||||
QString avdInfoFileName = avdPath.toFileInfo().baseName() + ".ini";
|
||||
const Utils::FileName
|
||||
const Utils::FilePath
|
||||
avdInfoFile = avdPath.parentDir().pathAppended(avdInfoFileName);
|
||||
QSettings avdInfo(avdInfoFile.toString(), QSettings::IniFormat);
|
||||
value = avdInfo.value(avdInfoTargetKey).toString();
|
||||
|
||||
@@ -94,7 +94,7 @@ static void setupProcessParameters(ProcessParameters *pp,
|
||||
pp->setWorkingDirectory(bc->buildDirectory());
|
||||
Utils::Environment env = bc->environment();
|
||||
pp->setEnvironment(env);
|
||||
pp->setCommand(FileName::fromString(command));
|
||||
pp->setCommand(FilePath::fromString(command));
|
||||
pp->setArguments(Utils::QtcProcess::joinArgs(arguments));
|
||||
pp->resolveAll();
|
||||
}
|
||||
@@ -191,7 +191,7 @@ bool AndroidBuildApkStep::init()
|
||||
|
||||
auto parser = new JavaParser;
|
||||
parser->setProjectFileList(Utils::transform(target()->project()->files(ProjectExplorer::Project::AllFiles),
|
||||
&Utils::FileName::toString));
|
||||
&Utils::FilePath::toString));
|
||||
|
||||
RunConfiguration *rc = target()->activeRunConfiguration();
|
||||
const QString buildKey = rc ? rc->buildKey() : QString();
|
||||
@@ -202,7 +202,7 @@ bool AndroidBuildApkStep::init()
|
||||
sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString();
|
||||
|
||||
QFileInfo sourceDirInfo(sourceDirName);
|
||||
parser->setSourceDirectory(Utils::FileName::fromString(sourceDirInfo.canonicalFilePath()));
|
||||
parser->setSourceDirectory(Utils::FilePath::fromString(sourceDirInfo.canonicalFilePath()));
|
||||
parser->setBuildDirectory(bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY));
|
||||
setOutputParser(parser);
|
||||
|
||||
@@ -375,7 +375,7 @@ void AndroidBuildApkStep::doRun()
|
||||
|
||||
auto setup = [this] {
|
||||
auto bc = target()->activeBuildConfiguration();
|
||||
Utils::FileName androidLibsDir = bc->buildDirectory()
|
||||
Utils::FilePath androidLibsDir = bc->buildDirectory()
|
||||
.pathAppended("android-build/libs")
|
||||
.pathAppended(AndroidManager::targetArch(target()));
|
||||
if (!androidLibsDir.exists() && !QDir{bc->buildDirectory().toString()}.mkpath(androidLibsDir.toString()))
|
||||
@@ -443,7 +443,7 @@ void AndroidBuildApkStep::processStarted()
|
||||
|
||||
bool AndroidBuildApkStep::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_keystorePath = Utils::FileName::fromString(map.value(KeystoreLocationKey).toString());
|
||||
m_keystorePath = Utils::FilePath::fromString(map.value(KeystoreLocationKey).toString());
|
||||
m_signPackage = false; // don't restore this
|
||||
m_buildTargetSdk = map.value(BuildTargetSdkKey).toString();
|
||||
if (m_buildTargetSdk.isEmpty()) {
|
||||
@@ -465,7 +465,7 @@ QVariantMap AndroidBuildApkStep::toMap() const
|
||||
return map;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidBuildApkStep::keystorePath()
|
||||
Utils::FilePath AndroidBuildApkStep::keystorePath()
|
||||
{
|
||||
return m_keystorePath;
|
||||
}
|
||||
@@ -493,7 +493,7 @@ QVariant AndroidBuildApkStep::data(Core::Id id) const
|
||||
return AbstractProcessStep::data(id);
|
||||
}
|
||||
|
||||
void AndroidBuildApkStep::setKeystorePath(const Utils::FileName &path)
|
||||
void AndroidBuildApkStep::setKeystorePath(const Utils::FilePath &path)
|
||||
{
|
||||
m_keystorePath = path;
|
||||
m_certificatePasswd.clear();
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
// signing
|
||||
Utils::FileName keystorePath();
|
||||
void setKeystorePath(const Utils::FileName &path);
|
||||
Utils::FilePath keystorePath();
|
||||
void setKeystorePath(const Utils::FilePath &path);
|
||||
void setKeystorePassword(const QString &pwd);
|
||||
void setCertificateAlias(const QString &alias);
|
||||
void setCertificatePassword(const QString &pwd);
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
bool m_addDebugger = true;
|
||||
QString m_buildTargetSdk;
|
||||
|
||||
Utils::FileName m_keystorePath;
|
||||
Utils::FilePath m_keystorePath;
|
||||
QString m_keystorePasswd;
|
||||
QString m_certificateAlias;
|
||||
QString m_certificatePasswd;
|
||||
|
||||
@@ -132,7 +132,7 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
|
||||
keystoreLocationChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)"));
|
||||
keystoreLocationChooser->setPromptDialogTitle(tr("Select Keystore File"));
|
||||
connect(keystoreLocationChooser, &PathChooser::pathChanged, this, [this](const QString &path) {
|
||||
FileName file = FileName::fromString(path);
|
||||
FilePath file = FilePath::fromString(path);
|
||||
m_step->setKeystorePath(file);
|
||||
m_signPackageCheckBox->setChecked(!file.isEmpty());
|
||||
if (!file.isEmpty())
|
||||
|
||||
@@ -225,23 +225,23 @@ void AndroidConfig::load(const QSettings &settings)
|
||||
{
|
||||
// user settings
|
||||
m_partitionSize = settings.value(PartitionSizeKey, 1024).toInt();
|
||||
m_sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString());
|
||||
m_sdkLocation = FilePath::fromString(settings.value(SDKLocationKey).toString());
|
||||
m_sdkManagerToolArgs = settings.value(SDKManagerToolArgsKey).toStringList();
|
||||
m_ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString());
|
||||
m_openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString());
|
||||
m_keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
||||
m_ndkLocation = FilePath::fromString(settings.value(NDKLocationKey).toString());
|
||||
m_openJDKLocation = FilePath::fromString(settings.value(OpenJDKLocationKey).toString());
|
||||
m_keystoreLocation = FilePath::fromString(settings.value(KeystoreLocationKey).toString());
|
||||
m_toolchainHost = settings.value(ToolchainHostKey).toString();
|
||||
m_automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool();
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (reader.load(FileName::fromString(sdkSettingsFileName()))
|
||||
if (reader.load(FilePath::fromString(sdkSettingsFileName()))
|
||||
&& settings.value(changeTimeStamp).toInt() != QFileInfo(sdkSettingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) {
|
||||
// persisten settings
|
||||
m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString());
|
||||
m_sdkLocation = FilePath::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString());
|
||||
m_sdkManagerToolArgs = reader.restoreValue(SDKManagerToolArgsKey, m_sdkManagerToolArgs).toStringList();
|
||||
m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.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_ndkLocation = FilePath::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString());
|
||||
m_openJDKLocation = FilePath::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString());
|
||||
m_keystoreLocation = FilePath::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString());
|
||||
m_toolchainHost = reader.restoreValue(ToolchainHostKey, m_toolchainHost).toString();
|
||||
m_automaticKitCreation = reader.restoreValue(AutomaticKitCreationKey, m_automaticKitCreation).toBool();
|
||||
// persistent settings
|
||||
@@ -313,17 +313,17 @@ QString AndroidConfig::apiLevelNameFor(const SdkPlatform *platform)
|
||||
QString("android-%1").arg(platform->apiLevel()) : "";
|
||||
}
|
||||
|
||||
FileName AndroidConfig::adbToolPath() const
|
||||
FilePath AndroidConfig::adbToolPath() const
|
||||
{
|
||||
return m_sdkLocation.pathAppended("platform-tools/adb" QTC_HOST_EXE_SUFFIX);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::androidToolPath() const
|
||||
FilePath AndroidConfig::androidToolPath() const
|
||||
{
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
// I want to switch from using android.bat to using an executable. All it really does is call
|
||||
// Java and I've made some progress on it. So if android.exe exists, return that instead.
|
||||
const FileName path = m_sdkLocation.pathAppended("tools/android" QTC_HOST_EXE_SUFFIX);
|
||||
const FilePath path = m_sdkLocation.pathAppended("tools/android" QTC_HOST_EXE_SUFFIX);
|
||||
if (path.exists())
|
||||
return path;
|
||||
return m_sdkLocation.pathAppended("tools/android" ANDROID_BAT_SUFFIX);
|
||||
@@ -331,7 +331,7 @@ FileName AndroidConfig::androidToolPath() const
|
||||
return m_sdkLocation.pathAppended("tools/android");
|
||||
}
|
||||
|
||||
FileName AndroidConfig::emulatorToolPath() const
|
||||
FilePath AndroidConfig::emulatorToolPath() const
|
||||
{
|
||||
QString relativePath = "emulator/emulator";
|
||||
if (sdkToolsVersion() < QVersionNumber(25, 3, 0))
|
||||
@@ -339,7 +339,7 @@ FileName AndroidConfig::emulatorToolPath() const
|
||||
return m_sdkLocation.pathAppended(relativePath + QTC_HOST_EXE_SUFFIX);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::sdkManagerToolPath() const
|
||||
FilePath AndroidConfig::sdkManagerToolPath() const
|
||||
{
|
||||
QString toolPath = "tools/bin/sdkmanager";
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
@@ -347,7 +347,7 @@ FileName AndroidConfig::sdkManagerToolPath() const
|
||||
return m_sdkLocation.pathAppended(toolPath);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::avdManagerToolPath() const
|
||||
FilePath AndroidConfig::avdManagerToolPath() const
|
||||
{
|
||||
QString toolPath = "tools/bin/avdmanager";
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
@@ -355,20 +355,20 @@ FileName AndroidConfig::avdManagerToolPath() const
|
||||
return m_sdkLocation.pathAppended(toolPath);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::aaptToolPath() const
|
||||
FilePath AndroidConfig::aaptToolPath() const
|
||||
{
|
||||
const Utils::FileName aaptToolPath = m_sdkLocation.pathAppended("build-tools");
|
||||
const Utils::FilePath aaptToolPath = m_sdkLocation.pathAppended("build-tools");
|
||||
QString toolPath = QString("%1/aapt").arg(buildToolsVersion().toString());
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
toolPath += QTC_HOST_EXE_SUFFIX;
|
||||
return aaptToolPath.pathAppended(toolPath);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::clangPath() const
|
||||
FilePath AndroidConfig::clangPath() const
|
||||
{
|
||||
const FileName clangPath = m_ndkLocation.pathAppended("toolchains/llvm/prebuilt/");
|
||||
const FileName oldNdkClangPath = m_ndkLocation.pathAppended("toolchains/llvm-3.6/prebuilt/");
|
||||
const QVector<FileName> clangSearchPaths{clangPath, oldNdkClangPath};
|
||||
const FilePath clangPath = m_ndkLocation.pathAppended("toolchains/llvm/prebuilt/");
|
||||
const FilePath oldNdkClangPath = m_ndkLocation.pathAppended("toolchains/llvm-3.6/prebuilt/");
|
||||
const QVector<FilePath> clangSearchPaths{clangPath, oldNdkClangPath};
|
||||
|
||||
// detect toolchain host
|
||||
QStringList hostPatterns;
|
||||
@@ -382,10 +382,10 @@ FileName AndroidConfig::clangPath() const
|
||||
case OsTypeMac:
|
||||
hostPatterns << QLatin1String("darwin*");
|
||||
break;
|
||||
default: /* unknown host */ return FileName();
|
||||
default: /* unknown host */ return FilePath();
|
||||
}
|
||||
|
||||
for (const FileName &path : clangSearchPaths) {
|
||||
for (const FilePath &path : clangSearchPaths) {
|
||||
QDirIterator iter(path.toString(), hostPatterns, QDir::Dirs);
|
||||
if (iter.hasNext()) {
|
||||
iter.next();
|
||||
@@ -397,9 +397,9 @@ FileName AndroidConfig::clangPath() const
|
||||
return {};
|
||||
}
|
||||
|
||||
FileName AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const
|
||||
FilePath AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const
|
||||
{
|
||||
const FileName path = m_ndkLocation.pathAppended(
|
||||
const FilePath path = m_ndkLocation.pathAppended(
|
||||
QString("prebuilt/%1/bin/gdb%2").arg(toolchainHost(), QTC_HOST_EXE_SUFFIX));
|
||||
if (path.exists())
|
||||
return path;
|
||||
@@ -408,21 +408,21 @@ FileName AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const
|
||||
.arg(toolchainPrefix(abi), toolchainHost(), toolsPrefix(abi), QTC_HOST_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
FileName AndroidConfig::makePath() const
|
||||
FilePath AndroidConfig::makePath() const
|
||||
{
|
||||
return m_ndkLocation.pathAppended(
|
||||
QString("prebuilt/%1/bin/make%2").arg(toolchainHost(), QTC_HOST_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
FileName AndroidConfig::openJDKBinPath() const
|
||||
FilePath AndroidConfig::openJDKBinPath() const
|
||||
{
|
||||
const FileName path = m_openJDKLocation;
|
||||
const FilePath path = m_openJDKLocation;
|
||||
if (!path.isEmpty())
|
||||
return path.pathAppended("bin");
|
||||
return path;
|
||||
}
|
||||
|
||||
FileName AndroidConfig::keytoolPath() const
|
||||
FilePath AndroidConfig::keytoolPath() const
|
||||
{
|
||||
return openJDKBinPath().pathAppended(keytoolName);
|
||||
}
|
||||
@@ -685,12 +685,12 @@ QString AndroidConfig::bestNdkPlatformMatch(int target) const
|
||||
return QString("android-%1").arg(AndroidManager::apiLevelRange().first);
|
||||
}
|
||||
|
||||
FileName AndroidConfig::sdkLocation() const
|
||||
FilePath AndroidConfig::sdkLocation() const
|
||||
{
|
||||
return m_sdkLocation;
|
||||
}
|
||||
|
||||
void AndroidConfig::setSdkLocation(const FileName &sdkLocation)
|
||||
void AndroidConfig::setSdkLocation(const FilePath &sdkLocation)
|
||||
{
|
||||
m_sdkLocation = sdkLocation;
|
||||
}
|
||||
@@ -699,7 +699,7 @@ QVersionNumber AndroidConfig::sdkToolsVersion() const
|
||||
{
|
||||
QVersionNumber version;
|
||||
if (m_sdkLocation.exists()) {
|
||||
const Utils::FileName sdkToolsPropertiesPath
|
||||
const Utils::FilePath sdkToolsPropertiesPath
|
||||
= m_sdkLocation.pathAppended("tools/source.properties");
|
||||
QSettings settings(sdkToolsPropertiesPath.toString(), QSettings::IniFormat);
|
||||
auto versionStr = settings.value(sdkToolsVersionKey).toString();
|
||||
@@ -728,7 +728,7 @@ void AndroidConfig::setSdkManagerToolArgs(const QStringList &args)
|
||||
m_sdkManagerToolArgs = args;
|
||||
}
|
||||
|
||||
FileName AndroidConfig::ndkLocation() const
|
||||
FilePath AndroidConfig::ndkLocation() const
|
||||
{
|
||||
return m_ndkLocation;
|
||||
}
|
||||
@@ -744,9 +744,9 @@ static inline QString gdbServerArch(const Abi &abi)
|
||||
};
|
||||
}
|
||||
|
||||
FileName AndroidConfig::gdbServer(const ProjectExplorer::Abi &abi) const
|
||||
FilePath AndroidConfig::gdbServer(const ProjectExplorer::Abi &abi) const
|
||||
{
|
||||
const FileName path = AndroidConfigurations::currentConfig().ndkLocation()
|
||||
const FilePath path = AndroidConfigurations::currentConfig().ndkLocation()
|
||||
.pathAppended(QString("prebuilt/android-%1/gdbserver/gdbserver")
|
||||
.arg(gdbServerArch(abi)));
|
||||
if (path.exists())
|
||||
@@ -763,7 +763,7 @@ QVersionNumber AndroidConfig::ndkVersion() const
|
||||
return version;
|
||||
}
|
||||
|
||||
const FileName ndkPropertiesPath = m_ndkLocation.pathAppended("source.properties");
|
||||
const FilePath ndkPropertiesPath = m_ndkLocation.pathAppended("source.properties");
|
||||
if (ndkPropertiesPath.exists()) {
|
||||
// source.properties files exists in NDK version > 11
|
||||
QSettings settings(ndkPropertiesPath.toString(), QSettings::IniFormat);
|
||||
@@ -771,7 +771,7 @@ QVersionNumber AndroidConfig::ndkVersion() const
|
||||
version = QVersionNumber::fromString(versionStr);
|
||||
} else {
|
||||
// No source.properties. There should be a file named RELEASE.TXT
|
||||
const FileName ndkReleaseTxtPath = m_ndkLocation.pathAppended("RELEASE.TXT");
|
||||
const FilePath ndkReleaseTxtPath = m_ndkLocation.pathAppended("RELEASE.TXT");
|
||||
Utils::FileReader reader;
|
||||
QString errorString;
|
||||
if (reader.fetch(ndkReleaseTxtPath.toString(), &errorString)) {
|
||||
@@ -799,28 +799,28 @@ QVersionNumber AndroidConfig::ndkVersion() const
|
||||
return version;
|
||||
}
|
||||
|
||||
void AndroidConfig::setNdkLocation(const FileName &ndkLocation)
|
||||
void AndroidConfig::setNdkLocation(const FilePath &ndkLocation)
|
||||
{
|
||||
m_ndkLocation = ndkLocation;
|
||||
m_NdkInformationUpToDate = false;
|
||||
}
|
||||
|
||||
FileName AndroidConfig::openJDKLocation() const
|
||||
FilePath AndroidConfig::openJDKLocation() const
|
||||
{
|
||||
return m_openJDKLocation;
|
||||
}
|
||||
|
||||
void AndroidConfig::setOpenJDKLocation(const FileName &openJDKLocation)
|
||||
void AndroidConfig::setOpenJDKLocation(const FilePath &openJDKLocation)
|
||||
{
|
||||
m_openJDKLocation = openJDKLocation;
|
||||
}
|
||||
|
||||
FileName AndroidConfig::keystoreLocation() const
|
||||
FilePath AndroidConfig::keystoreLocation() const
|
||||
{
|
||||
return m_keystoreLocation;
|
||||
}
|
||||
|
||||
void AndroidConfig::setKeystoreLocation(const FileName &keystoreLocation)
|
||||
void AndroidConfig::setKeystoreLocation(const FilePath &keystoreLocation)
|
||||
{
|
||||
m_keystoreLocation = keystoreLocation;
|
||||
}
|
||||
@@ -851,12 +851,12 @@ void AndroidConfig::setAutomaticKitCreation(bool b)
|
||||
m_automaticKitCreation = b;
|
||||
}
|
||||
|
||||
FileName AndroidConfig::qtLiveApkPath() const
|
||||
FilePath AndroidConfig::qtLiveApkPath() const
|
||||
{
|
||||
QString apkPathStr(defaultQtLiveApk);
|
||||
if (qEnvironmentVariableIsSet("QTC_QT_LIVE_APK_PATH"))
|
||||
apkPathStr = QString::fromLocal8Bit(qgetenv("QTC_QT_LIVE_APK_PATH"));
|
||||
return Utils::FileName::fromString(apkPathStr);
|
||||
return Utils::FilePath::fromString(apkPathStr);
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
@@ -947,7 +947,7 @@ void AndroidConfigurations::removeOldToolChains()
|
||||
|
||||
static QVariant findOrRegisterDebugger(ToolChain *tc)
|
||||
{
|
||||
const FileName command = tc->suggestedDebugger();
|
||||
const FilePath command = tc->suggestedDebugger();
|
||||
// check if the debugger is already registered, but ignoring the display name
|
||||
const Debugger::DebuggerItem *existing = Debugger::DebuggerItemManager::findByCommand(command);
|
||||
if (existing && existing->engineType() == Debugger::GdbEngineType && existing->isAutoDetected()
|
||||
@@ -1074,7 +1074,7 @@ bool AndroidConfigurations::force32bitEmulator()
|
||||
QProcessEnvironment AndroidConfigurations::toolsEnvironment(const AndroidConfig &config)
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
Utils::FileName jdkLocation = config.openJDKLocation();
|
||||
Utils::FilePath jdkLocation = config.openJDKLocation();
|
||||
if (!jdkLocation.isEmpty()) {
|
||||
env.set("JAVA_HOME", jdkLocation.toUserOutput());
|
||||
env.prependOrSetPath(jdkLocation.pathAppended("bin").toUserOutput());
|
||||
@@ -1147,7 +1147,7 @@ AndroidConfigurations::AndroidConfigurations()
|
||||
|
||||
AndroidConfigurations::~AndroidConfigurations() = default;
|
||||
|
||||
static FileName javaHomeForJavac(const FileName &location)
|
||||
static FilePath javaHomeForJavac(const FilePath &location)
|
||||
{
|
||||
QFileInfo fileInfo = location.toFileInfo();
|
||||
int tries = 5;
|
||||
@@ -1155,14 +1155,14 @@ static FileName javaHomeForJavac(const FileName &location)
|
||||
QDir dir = fileInfo.dir();
|
||||
dir.cdUp();
|
||||
if (QFileInfo::exists(dir.filePath(QLatin1String("lib/tools.jar"))))
|
||||
return FileName::fromString(dir.path());
|
||||
return FilePath::fromString(dir.path());
|
||||
if (fileInfo.isSymLink())
|
||||
fileInfo.setFile(fileInfo.symLinkTarget());
|
||||
else
|
||||
break;
|
||||
--tries;
|
||||
}
|
||||
return FileName();
|
||||
return FilePath();
|
||||
}
|
||||
|
||||
void AndroidConfigurations::load()
|
||||
@@ -1175,7 +1175,7 @@ void AndroidConfigurations::load()
|
||||
if (m_config.openJDKLocation().isEmpty()) {
|
||||
if (HostOsInfo::isLinuxHost()) {
|
||||
Environment env = Environment::systemEnvironment();
|
||||
FileName location = env.searchInPath(QLatin1String("javac"));
|
||||
FilePath location = env.searchInPath(QLatin1String("javac"));
|
||||
QFileInfo fi = location.toFileInfo();
|
||||
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
|
||||
m_config.setOpenJDKLocation(javaHomeForJavac(location));
|
||||
@@ -1191,7 +1191,7 @@ void AndroidConfigurations::load()
|
||||
if (response.result == SynchronousProcessResponse::Finished) {
|
||||
const QString &javaHome = response.allOutput().trimmed();
|
||||
if (!javaHome.isEmpty() && QFileInfo::exists(javaHome))
|
||||
m_config.setOpenJDKLocation(FileName::fromString(javaHome));
|
||||
m_config.setOpenJDKLocation(FilePath::fromString(javaHome));
|
||||
}
|
||||
}
|
||||
} else if (HostOsInfo::isWindowsHost()) {
|
||||
@@ -1233,7 +1233,7 @@ void AndroidConfigurations::load()
|
||||
}
|
||||
}
|
||||
if (!javaHome.isEmpty()) {
|
||||
m_config.setOpenJDKLocation(FileName::fromString(javaHome));
|
||||
m_config.setOpenJDKLocation(FilePath::fromString(javaHome));
|
||||
saveSettings = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,23 +97,23 @@ public:
|
||||
static QStringList apiLevelNamesFor(const SdkPlatformList &platforms);
|
||||
static QString apiLevelNameFor(const SdkPlatform *platform);
|
||||
|
||||
Utils::FileName sdkLocation() const;
|
||||
void setSdkLocation(const Utils::FileName &sdkLocation);
|
||||
Utils::FilePath sdkLocation() const;
|
||||
void setSdkLocation(const Utils::FilePath &sdkLocation);
|
||||
QVersionNumber sdkToolsVersion() const;
|
||||
QVersionNumber buildToolsVersion() const;
|
||||
QStringList sdkManagerToolArgs() const;
|
||||
void setSdkManagerToolArgs(const QStringList &args);
|
||||
|
||||
Utils::FileName ndkLocation() const;
|
||||
Utils::FileName gdbServer(const ProjectExplorer::Abi &abi) const;
|
||||
Utils::FilePath ndkLocation() const;
|
||||
Utils::FilePath gdbServer(const ProjectExplorer::Abi &abi) const;
|
||||
QVersionNumber ndkVersion() const;
|
||||
void setNdkLocation(const Utils::FileName &ndkLocation);
|
||||
void setNdkLocation(const Utils::FilePath &ndkLocation);
|
||||
|
||||
Utils::FileName openJDKLocation() const;
|
||||
void setOpenJDKLocation(const Utils::FileName &openJDKLocation);
|
||||
Utils::FilePath openJDKLocation() const;
|
||||
void setOpenJDKLocation(const Utils::FilePath &openJDKLocation);
|
||||
|
||||
Utils::FileName keystoreLocation() const;
|
||||
void setKeystoreLocation(const Utils::FileName &keystoreLocation);
|
||||
Utils::FilePath keystoreLocation() const;
|
||||
void setKeystoreLocation(const Utils::FilePath &keystoreLocation);
|
||||
|
||||
QString toolchainHost() const;
|
||||
|
||||
@@ -123,20 +123,20 @@ public:
|
||||
bool automaticKitCreation() const;
|
||||
void setAutomaticKitCreation(bool b);
|
||||
|
||||
Utils::FileName qtLiveApkPath() const;
|
||||
Utils::FilePath qtLiveApkPath() const;
|
||||
|
||||
Utils::FileName adbToolPath() const;
|
||||
Utils::FileName androidToolPath() const;
|
||||
Utils::FileName emulatorToolPath() const;
|
||||
Utils::FileName sdkManagerToolPath() const;
|
||||
Utils::FileName avdManagerToolPath() const;
|
||||
Utils::FileName aaptToolPath() const;
|
||||
Utils::FilePath adbToolPath() const;
|
||||
Utils::FilePath androidToolPath() const;
|
||||
Utils::FilePath emulatorToolPath() const;
|
||||
Utils::FilePath sdkManagerToolPath() const;
|
||||
Utils::FilePath avdManagerToolPath() const;
|
||||
Utils::FilePath aaptToolPath() const;
|
||||
|
||||
Utils::FileName clangPath() const;
|
||||
Utils::FileName gdbPath(const ProjectExplorer::Abi &abi) const;
|
||||
Utils::FileName makePath() const;
|
||||
Utils::FilePath clangPath() const;
|
||||
Utils::FilePath gdbPath(const ProjectExplorer::Abi &abi) const;
|
||||
Utils::FilePath makePath() const;
|
||||
|
||||
Utils::FileName keytoolPath() const;
|
||||
Utils::FilePath keytoolPath() const;
|
||||
|
||||
QVector<AndroidDeviceInfo> connectedDevices(QString *error = nullptr) const;
|
||||
static QVector<AndroidDeviceInfo> connectedDevices(const QString &adbToolPath, QString *error = nullptr);
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
private:
|
||||
static QString getDeviceProperty(const QString &adbToolPath, const QString &device, const QString &property);
|
||||
|
||||
Utils::FileName openJDKBinPath() const;
|
||||
Utils::FilePath openJDKBinPath() const;
|
||||
int getSDKVersion(const QString &device) const;
|
||||
static int getSDKVersion(const QString &adbToolPath, const QString &device);
|
||||
QStringList getAbis(const QString &device) const;
|
||||
@@ -169,11 +169,11 @@ private:
|
||||
|
||||
void updateNdkInformation() const;
|
||||
|
||||
Utils::FileName m_sdkLocation;
|
||||
Utils::FilePath m_sdkLocation;
|
||||
QStringList m_sdkManagerToolArgs;
|
||||
Utils::FileName m_ndkLocation;
|
||||
Utils::FileName m_openJDKLocation;
|
||||
Utils::FileName m_keystoreLocation;
|
||||
Utils::FilePath m_ndkLocation;
|
||||
Utils::FilePath m_openJDKLocation;
|
||||
Utils::FilePath m_keystoreLocation;
|
||||
unsigned m_partitionSize = 1024;
|
||||
bool m_automaticKitCreation = true;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ AndroidCreateKeystoreCertificate::~AndroidCreateKeystoreCertificate()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidCreateKeystoreCertificate::keystoreFilePath()
|
||||
Utils::FilePath AndroidCreateKeystoreCertificate::keystoreFilePath()
|
||||
{
|
||||
return m_keystoreFilePath;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ void AndroidCreateKeystoreCertificate::on_buttonBox_accepted()
|
||||
if (!validateUserInput())
|
||||
return;
|
||||
|
||||
m_keystoreFilePath = Utils::FileName::fromString(QFileDialog::getSaveFileName(this, tr("Keystore Filename"),
|
||||
m_keystoreFilePath = Utils::FilePath::fromString(QFileDialog::getSaveFileName(this, tr("Keystore Filename"),
|
||||
QDir::homePath() + QLatin1String("/android_release.keystore"),
|
||||
tr("Keystore files (*.keystore *.jks)")));
|
||||
if (m_keystoreFilePath.isEmpty())
|
||||
|
||||
@@ -49,7 +49,7 @@ class AndroidCreateKeystoreCertificate : public QDialog
|
||||
public:
|
||||
explicit AndroidCreateKeystoreCertificate(QWidget *parent = nullptr);
|
||||
~AndroidCreateKeystoreCertificate() override;
|
||||
Utils::FileName keystoreFilePath();
|
||||
Utils::FilePath keystoreFilePath();
|
||||
QString keystorePassword();
|
||||
QString certificateAlias();
|
||||
QString certificatePassword();
|
||||
@@ -69,7 +69,7 @@ private slots:
|
||||
private:
|
||||
bool validateUserInput();
|
||||
Ui::AndroidCreateKeystoreCertificate *ui;
|
||||
Utils::FileName m_keystoreFilePath;
|
||||
Utils::FilePath m_keystoreFilePath;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -190,7 +190,7 @@ void AndroidDebugSupport::start()
|
||||
const int minimumNdk = qt ? qt->minimumNDK() : 0;
|
||||
|
||||
int sdkVersion = qMax(AndroidManager::minimumSDK(kit), minimumNdk);
|
||||
Utils::FileName sysRoot = AndroidConfigurations::currentConfig().ndkLocation()
|
||||
Utils::FilePath sysRoot = AndroidConfigurations::currentConfig().ndkLocation()
|
||||
.pathAppended("platforms")
|
||||
.pathAppended(QString("android-%1").arg(sdkVersion))
|
||||
.pathAppended(toNdkArch(AndroidManager::targetArch(target)));
|
||||
|
||||
@@ -232,9 +232,9 @@ bool AndroidDeployQtStep::init()
|
||||
|
||||
if (m_useAndroiddeployqt) {
|
||||
const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey());
|
||||
m_apkPath = Utils::FileName::fromString(node->data(Constants::AndroidApk).toString());
|
||||
m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString());
|
||||
if (!m_apkPath.isEmpty()) {
|
||||
m_manifestName = Utils::FileName::fromString(node->data(Constants::AndroidManifest).toString());
|
||||
m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString());
|
||||
m_command = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
||||
AndroidManager::setManifestPath(target(), m_manifestName);
|
||||
} else {
|
||||
|
||||
@@ -106,10 +106,10 @@ private:
|
||||
friend void operator|=(DeployErrorCode &e1, const DeployErrorCode &e2) { e1 = static_cast<AndroidDeployQtStep::DeployErrorCode>((int)e1 | (int)e2); }
|
||||
friend DeployErrorCode operator|(const DeployErrorCode &e1, const DeployErrorCode &e2) { return static_cast<AndroidDeployQtStep::DeployErrorCode>((int)e1 | (int)e2); }
|
||||
|
||||
Utils::FileName m_manifestName;
|
||||
Utils::FilePath m_manifestName;
|
||||
QString m_serialNumber;
|
||||
QString m_avdName;
|
||||
Utils::FileName m_apkPath;
|
||||
Utils::FilePath m_apkPath;
|
||||
QMap<QString, QString> m_filesToPull;
|
||||
|
||||
QString m_targetArch;
|
||||
|
||||
@@ -112,23 +112,23 @@ Core::Id AndroidGdbServerKitAspect::id()
|
||||
return "Android.GdbServer.Information";
|
||||
}
|
||||
|
||||
FileName AndroidGdbServerKitAspect::gdbServer(const Kit *kit)
|
||||
FilePath AndroidGdbServerKitAspect::gdbServer(const Kit *kit)
|
||||
{
|
||||
QTC_ASSERT(kit, return FileName());
|
||||
return FileName::fromString(kit->value(AndroidGdbServerKitAspect::id()).toString());
|
||||
QTC_ASSERT(kit, return FilePath());
|
||||
return FilePath::fromString(kit->value(AndroidGdbServerKitAspect::id()).toString());
|
||||
}
|
||||
|
||||
void AndroidGdbServerKitAspect::setGdbSever(Kit *kit, const FileName &gdbServerCommand)
|
||||
void AndroidGdbServerKitAspect::setGdbSever(Kit *kit, const FilePath &gdbServerCommand)
|
||||
{
|
||||
QTC_ASSERT(kit, return);
|
||||
kit->setValue(AndroidGdbServerKitAspect::id(), gdbServerCommand.toString());
|
||||
}
|
||||
|
||||
FileName AndroidGdbServerKitAspect::autoDetect(const Kit *kit)
|
||||
FilePath AndroidGdbServerKitAspect::autoDetect(const Kit *kit)
|
||||
{
|
||||
ToolChain *tc = ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_ID)
|
||||
return FileName();
|
||||
return FilePath();
|
||||
auto atc = static_cast<AndroidToolChain *>(tc);
|
||||
return atc->suggestedGdbServer();
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ public:
|
||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const override;
|
||||
|
||||
static Core::Id id();
|
||||
static Utils::FileName gdbServer(const ProjectExplorer::Kit *kit);
|
||||
static void setGdbSever(ProjectExplorer::Kit *kit, const Utils::FileName &gdbServerCommand);
|
||||
static Utils::FileName autoDetect(const ProjectExplorer::Kit *kit);
|
||||
static Utils::FilePath gdbServer(const ProjectExplorer::Kit *kit);
|
||||
static void setGdbSever(ProjectExplorer::Kit *kit, const Utils::FilePath &gdbServerCommand);
|
||||
static Utils::FilePath autoDetect(const ProjectExplorer::Kit *kit);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
|
||||
using LibrariesMap = QMap<QString, Library>;
|
||||
|
||||
static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName);
|
||||
static bool openXmlFile(QDomDocument &doc, const Utils::FilePath &fileName);
|
||||
static bool openManifest(ProjectExplorer::Target *target, QDomDocument &doc);
|
||||
static int parseMinSdk(const QDomElement &manifestElem);
|
||||
|
||||
@@ -129,7 +129,7 @@ QString AndroidManager::packageName(ProjectExplorer::Target *target)
|
||||
return manifestElem.attribute(QLatin1String("package"));
|
||||
}
|
||||
|
||||
QString AndroidManager::packageName(const Utils::FileName &manifestFile)
|
||||
QString AndroidManager::packageName(const Utils::FilePath &manifestFile)
|
||||
{
|
||||
QDomDocument doc;
|
||||
if (!openXmlFile(doc, manifestFile))
|
||||
@@ -174,7 +174,7 @@ int AndroidManager::packageVersionCode(const QString &deviceSerial,
|
||||
return -1;
|
||||
}
|
||||
|
||||
void AndroidManager::apkInfo(const Utils::FileName &apkPath,
|
||||
void AndroidManager::apkInfo(const Utils::FilePath &apkPath,
|
||||
QString *packageName,
|
||||
int *version,
|
||||
QString *activityPath)
|
||||
@@ -237,8 +237,8 @@ int AndroidManager::minimumSDK(const ProjectExplorer::Kit *kit)
|
||||
int minSDKVersion = -1;
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(kit);
|
||||
if (version && version->targetDeviceTypes().contains(Constants::ANDROID_DEVICE_TYPE)) {
|
||||
Utils::FileName stockManifestFilePath =
|
||||
Utils::FileName::fromUserInput(version->qmakeProperty("QT_INSTALL_PREFIX") +
|
||||
Utils::FilePath stockManifestFilePath =
|
||||
Utils::FilePath::fromUserInput(version->qmakeProperty("QT_INSTALL_PREFIX") +
|
||||
QLatin1String("/src/android/templates/AndroidManifest.xml"));
|
||||
QDomDocument doc;
|
||||
if (openXmlFile(doc, stockManifestFilePath)) {
|
||||
@@ -292,20 +292,20 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target)
|
||||
return settings;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidManager::dirPath(const ProjectExplorer::Target *target)
|
||||
Utils::FilePath AndroidManager::dirPath(const ProjectExplorer::Target *target)
|
||||
{
|
||||
if (target->activeBuildConfiguration())
|
||||
return target->activeBuildConfiguration()->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY);
|
||||
return Utils::FileName();
|
||||
return Utils::FilePath();
|
||||
}
|
||||
|
||||
Utils::FileName AndroidManager::apkPath(const ProjectExplorer::Target *target)
|
||||
Utils::FilePath AndroidManager::apkPath(const ProjectExplorer::Target *target)
|
||||
{
|
||||
QTC_ASSERT(target, return Utils::FileName());
|
||||
QTC_ASSERT(target, return Utils::FilePath());
|
||||
|
||||
auto buildApkStep = AndroidBuildApkStep::findInBuild(target->activeBuildConfiguration());
|
||||
if (!buildApkStep)
|
||||
return Utils::FileName();
|
||||
return Utils::FilePath();
|
||||
|
||||
QString apkPath("build/outputs/apk/android-build-");
|
||||
if (buildApkStep->signPackage())
|
||||
@@ -316,13 +316,13 @@ Utils::FileName AndroidManager::apkPath(const ProjectExplorer::Target *target)
|
||||
return dirPath(target).pathAppended(apkPath);
|
||||
}
|
||||
|
||||
Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *target)
|
||||
Utils::FilePath AndroidManager::manifestSourcePath(ProjectExplorer::Target *target)
|
||||
{
|
||||
if (const ProjectNode *node = currentProjectNode(target)) {
|
||||
const QString packageSource
|
||||
= node->data(Android::Constants::AndroidPackageSourceDir).toString();
|
||||
if (!packageSource.isEmpty()) {
|
||||
const FileName manifest = FileName::fromUserInput(packageSource + "/AndroidManifest.xml");
|
||||
const FilePath manifest = FilePath::fromUserInput(packageSource + "/AndroidManifest.xml");
|
||||
if (manifest.exists())
|
||||
return manifest;
|
||||
}
|
||||
@@ -330,20 +330,20 @@ Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *targ
|
||||
return manifestPath(target);
|
||||
}
|
||||
|
||||
Utils::FileName AndroidManager::manifestPath(ProjectExplorer::Target *target)
|
||||
Utils::FilePath AndroidManager::manifestPath(ProjectExplorer::Target *target)
|
||||
{
|
||||
QVariant manifest = target->namedSettings(AndroidManifestName);
|
||||
if (manifest.isValid())
|
||||
return manifest.value<FileName>();
|
||||
return manifest.value<FilePath>();
|
||||
return dirPath(target).pathAppended(AndroidManifestName);
|
||||
}
|
||||
|
||||
void AndroidManager::setManifestPath(Target *target, const FileName &path)
|
||||
void AndroidManager::setManifestPath(Target *target, const FilePath &path)
|
||||
{
|
||||
target->setNamedSettings(AndroidManifestName, QVariant::fromValue(path));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidManager::defaultPropertiesPath(ProjectExplorer::Target *target)
|
||||
Utils::FilePath AndroidManager::defaultPropertiesPath(ProjectExplorer::Target *target)
|
||||
{
|
||||
return dirPath(target).pathAppended(AndroidDefaultPropertiesName);
|
||||
}
|
||||
@@ -440,7 +440,7 @@ static void raiseError(const QString &reason)
|
||||
QMessageBox::critical(nullptr, AndroidManager::tr("Error creating Android templates."), reason);
|
||||
}
|
||||
|
||||
static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName)
|
||||
static bool openXmlFile(QDomDocument &doc, const Utils::FilePath &fileName)
|
||||
{
|
||||
QFile f(fileName.toString());
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
@@ -643,12 +643,12 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
|
||||
|
||||
const QString sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString();
|
||||
QFileInfo sourceDirInfo(sourceDirName);
|
||||
const FileName packageSourceDir = FileName::fromString(sourceDirInfo.canonicalFilePath())
|
||||
const FilePath packageSourceDir = FilePath::fromString(sourceDirInfo.canonicalFilePath())
|
||||
.pathAppended("gradlew");
|
||||
if (!packageSourceDir.exists())
|
||||
return false;
|
||||
|
||||
const FileName wrapperProps = packageSourceDir.pathAppended("gradle/wrapper/gradle-wrapper.properties");
|
||||
const FilePath wrapperProps = packageSourceDir.pathAppended("gradle/wrapper/gradle-wrapper.properties");
|
||||
if (wrapperProps.exists()) {
|
||||
GradleProperties wrapperProperties = readGradleProperties(wrapperProps.toString());
|
||||
QString distributionUrl = QString::fromLocal8Bit(wrapperProperties["distributionUrl"]);
|
||||
@@ -661,7 +661,7 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
|
||||
|
||||
GradleProperties localProperties;
|
||||
localProperties["sdk.dir"] = AndroidConfigurations::currentConfig().sdkLocation().toString().toLocal8Bit();
|
||||
const FileName localPropertiesFile = packageSourceDir.pathAppended("local.properties");
|
||||
const FilePath localPropertiesFile = packageSourceDir.pathAppended("local.properties");
|
||||
if (!mergeGradleProperties(localPropertiesFile.toString(), localProperties))
|
||||
return false;
|
||||
|
||||
@@ -680,10 +680,10 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
|
||||
return mergeGradleProperties(gradlePropertiesPath, gradleProperties);
|
||||
}
|
||||
|
||||
int AndroidManager::findApiLevel(const Utils::FileName &platformPath)
|
||||
int AndroidManager::findApiLevel(const Utils::FilePath &platformPath)
|
||||
{
|
||||
int apiLevel = -1;
|
||||
const Utils::FileName propertiesPath = platformPath.pathAppended("/source.properties");
|
||||
const Utils::FilePath propertiesPath = platformPath.pathAppended("/source.properties");
|
||||
if (propertiesPath.exists()) {
|
||||
QSettings sdkProperties(propertiesPath.toString(), QSettings::IniFormat);
|
||||
bool validInt = false;
|
||||
|
||||
@@ -40,7 +40,7 @@ class Kit;
|
||||
class Target;
|
||||
}
|
||||
|
||||
namespace Utils { class FileName; }
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
namespace Android {
|
||||
|
||||
@@ -66,10 +66,10 @@ class ANDROID_EXPORT AndroidManager : public QObject
|
||||
|
||||
public:
|
||||
static QString packageName(ProjectExplorer::Target *target);
|
||||
static QString packageName(const Utils::FileName &manifestFile);
|
||||
static QString packageName(const Utils::FilePath &manifestFile);
|
||||
static bool packageInstalled(const QString &deviceSerial, const QString &packageName);
|
||||
static int packageVersionCode(const QString &deviceSerial, const QString &packageName);
|
||||
static void apkInfo(const Utils::FileName &apkPath,
|
||||
static void apkInfo(const Utils::FilePath &apkPath,
|
||||
QString *packageName = nullptr,
|
||||
int *version = nullptr,
|
||||
QString *activityPath = nullptr);
|
||||
@@ -89,12 +89,12 @@ public:
|
||||
|
||||
static QString targetArch(const ProjectExplorer::Target *target);
|
||||
|
||||
static Utils::FileName dirPath(const ProjectExplorer::Target *target);
|
||||
static Utils::FileName manifestPath(ProjectExplorer::Target *target);
|
||||
static void setManifestPath(ProjectExplorer::Target *target, const Utils::FileName &path);
|
||||
static Utils::FileName manifestSourcePath(ProjectExplorer::Target *target);
|
||||
static Utils::FileName defaultPropertiesPath(ProjectExplorer::Target *target);
|
||||
static Utils::FileName apkPath(const ProjectExplorer::Target *target);
|
||||
static Utils::FilePath dirPath(const ProjectExplorer::Target *target);
|
||||
static Utils::FilePath manifestPath(ProjectExplorer::Target *target);
|
||||
static void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path);
|
||||
static Utils::FilePath manifestSourcePath(ProjectExplorer::Target *target);
|
||||
static Utils::FilePath defaultPropertiesPath(ProjectExplorer::Target *target);
|
||||
static Utils::FilePath apkPath(const ProjectExplorer::Target *target);
|
||||
|
||||
static QPair<int, int> apiLevelRange();
|
||||
static QString androidNameForApiLevel(int x);
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
static bool checkCertificateExists(const QString &keystorePath, const QString &keystorePasswd,
|
||||
const QString &alias);
|
||||
static bool updateGradleProperties(ProjectExplorer::Target *target);
|
||||
static int findApiLevel(const Utils::FileName &platformPath);
|
||||
static int findApiLevel(const Utils::FilePath &platformPath);
|
||||
|
||||
static QProcess *runAdbCommandDetached(const QStringList &args, QString *err = nullptr,
|
||||
bool deleteOnFinish = false);
|
||||
|
||||
@@ -85,7 +85,7 @@ bool checkPackageName(const QString &packageName)
|
||||
return QRegExp(packageNameRegExp).exactMatch(packageName);
|
||||
}
|
||||
|
||||
Project *androidProject(const Utils::FileName &fileName)
|
||||
Project *androidProject(const Utils::FilePath &fileName)
|
||||
{
|
||||
for (Project *project : SessionManager::projects()) {
|
||||
if (!project->activeTarget())
|
||||
@@ -604,7 +604,7 @@ void AndroidManifestEditorWidget::preSave()
|
||||
|
||||
void AndroidManifestEditorWidget::postSave()
|
||||
{
|
||||
const Utils::FileName docPath = m_textEditorWidget->textDocument()->filePath();
|
||||
const Utils::FilePath docPath = m_textEditorWidget->textDocument()->filePath();
|
||||
ProjectExplorer::Project *project = androidProject(docPath);
|
||||
if (project) {
|
||||
if (Target *target = project->activeTarget()) {
|
||||
|
||||
@@ -100,7 +100,7 @@ void AndroidPackageInstallationStep::doRun()
|
||||
{
|
||||
QString error;
|
||||
foreach (const QString &dir, m_androidDirsToClean) {
|
||||
FileName androidDir = FileName::fromString(dir);
|
||||
FilePath androidDir = FilePath::fromString(dir);
|
||||
if (!dir.isEmpty() && androidDir.exists()) {
|
||||
emit addOutput(tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage);
|
||||
if (!FileUtils::removeRecursively(androidDir, &error)) {
|
||||
|
||||
@@ -223,7 +223,7 @@ private:
|
||||
AndroidSdkManager &m_sdkManager;
|
||||
const AndroidConfig &m_config;
|
||||
AndroidSdkPackageList m_allPackages;
|
||||
FileName lastSdkManagerPath;
|
||||
FilePath lastSdkManagerPath;
|
||||
QString m_licenseTextCache;
|
||||
QByteArray m_licenseUserInput;
|
||||
mutable QReadWriteLock m_licenseInputLock;
|
||||
@@ -243,7 +243,7 @@ class SdkManagerOutputParser
|
||||
QStringList headerParts;
|
||||
QVersionNumber revision;
|
||||
QString description;
|
||||
Utils::FileName installedLocation;
|
||||
Utils::FilePath installedLocation;
|
||||
QMap<QString, QString> extraData;
|
||||
};
|
||||
|
||||
@@ -612,7 +612,7 @@ bool SdkManagerOutputParser::parseAbstractData(SdkManagerOutputParser::GenericPa
|
||||
for (const auto &key: qAsConst(extraKeys)) {
|
||||
if (valueForKey(key, line, &value)) {
|
||||
if (key == installLocationKey)
|
||||
output.installedLocation = Utils::FileName::fromString(value);
|
||||
output.installedLocation = Utils::FilePath::fromString(value);
|
||||
else if (key == revisionKey)
|
||||
output.revision = QVersionNumber::fromString(value);
|
||||
else if (key == descriptionKey)
|
||||
|
||||
@@ -69,7 +69,7 @@ const QString &AndroidSdkPackage::sdkStylePath() const
|
||||
return m_sdkStylePath;
|
||||
}
|
||||
|
||||
const Utils::FileName &AndroidSdkPackage::installedLocation() const
|
||||
const Utils::FilePath &AndroidSdkPackage::installedLocation() const
|
||||
{
|
||||
return m_installedLocation;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void AndroidSdkPackage::setState(AndroidSdkPackage::PackageState state)
|
||||
m_state = state;
|
||||
}
|
||||
|
||||
void AndroidSdkPackage::setInstalledLocation(const Utils::FileName &path)
|
||||
void AndroidSdkPackage::setInstalledLocation(const Utils::FilePath &path)
|
||||
{
|
||||
m_installedLocation = path;
|
||||
if (m_installedLocation.exists())
|
||||
|
||||
@@ -77,13 +77,13 @@ public:
|
||||
const QVersionNumber &revision() const;
|
||||
PackageState state() const;
|
||||
const QString &sdkStylePath() const;
|
||||
const Utils::FileName &installedLocation() const;
|
||||
const Utils::FilePath &installedLocation() const;
|
||||
|
||||
protected:
|
||||
void setDisplayText(const QString &str);
|
||||
void setDescriptionText(const QString &str);
|
||||
void setState(PackageState state);
|
||||
void setInstalledLocation(const Utils::FileName &path);
|
||||
void setInstalledLocation(const Utils::FilePath &path);
|
||||
|
||||
virtual void updatePackageDetails();
|
||||
|
||||
@@ -93,7 +93,7 @@ private:
|
||||
QVersionNumber m_revision;
|
||||
PackageState m_state = PackageState::Unknown;
|
||||
QString m_sdkStylePath;
|
||||
Utils::FileName m_installedLocation;
|
||||
Utils::FilePath m_installedLocation;
|
||||
|
||||
friend class Internal::SdkManagerOutputParser;
|
||||
friend class Internal::AndroidToolOutputParser;
|
||||
|
||||
@@ -371,28 +371,28 @@ void AndroidSettingsWidget::saveSettings()
|
||||
|
||||
void AndroidSettingsWidget::validateJdk()
|
||||
{
|
||||
auto javaPath = Utils::FileName::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath());
|
||||
auto javaPath = Utils::FilePath::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath());
|
||||
m_androidConfig.setOpenJDKLocation(javaPath);
|
||||
bool jdkPathExists = m_androidConfig.openJDKLocation().exists();
|
||||
auto summaryWidget = static_cast<SummaryWidget *>(m_ui->javaDetailsWidget->widget());
|
||||
summaryWidget->setPointValid(JavaPathExistsRow, jdkPathExists);
|
||||
|
||||
const Utils::FileName bin = m_androidConfig.openJDKLocation().pathAppended("bin/javac" QTC_HOST_EXE_SUFFIX);
|
||||
const Utils::FilePath bin = m_androidConfig.openJDKLocation().pathAppended("bin/javac" QTC_HOST_EXE_SUFFIX);
|
||||
summaryWidget->setPointValid(JavaJdkValidRow, jdkPathExists && bin.exists());
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::validateNdk()
|
||||
{
|
||||
auto ndkPath = Utils::FileName::fromUserInput(m_ui->NDKLocationPathChooser->rawPath());
|
||||
auto ndkPath = Utils::FilePath::fromUserInput(m_ui->NDKLocationPathChooser->rawPath());
|
||||
m_androidConfig.setNdkLocation(ndkPath);
|
||||
|
||||
auto summaryWidget = static_cast<SummaryWidget *>(m_ui->androidDetailsWidget->widget());
|
||||
summaryWidget->setPointValid(NdkPathExistsRow, m_androidConfig.ndkLocation().exists());
|
||||
|
||||
const Utils::FileName ndkPlatformsDir = ndkPath.pathAppended("platforms");
|
||||
const Utils::FileName ndkToolChainsDir = ndkPath.pathAppended("toolchains");
|
||||
const Utils::FileName ndkSourcesDir = ndkPath.pathAppended("sources/cxx-stl");
|
||||
const Utils::FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms");
|
||||
const Utils::FilePath ndkToolChainsDir = ndkPath.pathAppended("toolchains");
|
||||
const Utils::FilePath ndkSourcesDir = ndkPath.pathAppended("sources/cxx-stl");
|
||||
summaryWidget->setPointValid(NdkDirStructureRow,
|
||||
ndkPlatformsDir.exists()
|
||||
&& ndkToolChainsDir.exists()
|
||||
@@ -405,7 +405,7 @@ void AndroidSettingsWidget::validateNdk()
|
||||
|
||||
void AndroidSettingsWidget::onSdkPathChanged()
|
||||
{
|
||||
auto sdkPath = Utils::FileName::fromUserInput(m_ui->SDKLocationPathChooser->rawPath());
|
||||
auto sdkPath = Utils::FilePath::fromUserInput(m_ui->SDKLocationPathChooser->rawPath());
|
||||
m_androidConfig.setSdkLocation(sdkPath);
|
||||
// Package reload will trigger validateSdk.
|
||||
m_sdkManager->reloadPackages();
|
||||
|
||||
@@ -60,7 +60,7 @@ static const QHash<QString, Abi> ClangTargets = {
|
||||
static const QList<Core::Id> LanguageIds = {ProjectExplorer::Constants::CXX_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::C_LANGUAGE_ID};
|
||||
|
||||
static ToolChain *findToolChain(Utils::FileName &compilerPath, Core::Id lang, const QString &target,
|
||||
static ToolChain *findToolChain(Utils::FilePath &compilerPath, Core::Id lang, const QString &target,
|
||||
CToolChainList &alreadyKnown)
|
||||
{
|
||||
ToolChain * tc = Utils::findOrDefault(alreadyKnown, [target, compilerPath, lang](ToolChain *tc) {
|
||||
@@ -92,11 +92,11 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
|
||||
{
|
||||
env.set(QLatin1String("ANDROID_NDK_HOST"),
|
||||
AndroidConfigurations::currentConfig().toolchainHost());
|
||||
const Utils::FileName javaHome = AndroidConfigurations::currentConfig().openJDKLocation();
|
||||
const Utils::FilePath javaHome = AndroidConfigurations::currentConfig().openJDKLocation();
|
||||
if (!javaHome.exists()) {
|
||||
env.set(QLatin1String("JAVA_HOME"), javaHome.toString());
|
||||
const FileName javaBin = javaHome.pathAppended("bin");
|
||||
if (!Utils::contains(env.path(), [&javaBin](const Utils::FileName &p) { return p == javaBin; }))
|
||||
const FilePath javaBin = javaHome.pathAppended("bin");
|
||||
if (!Utils::contains(env.path(), [&javaBin](const Utils::FilePath &p) { return p == javaBin; }))
|
||||
env.prependOrSetPath(javaBin.toUserOutput());
|
||||
}
|
||||
env.set(QLatin1String("ANDROID_HOME"),
|
||||
@@ -105,13 +105,13 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
|
||||
AndroidConfigurations::currentConfig().sdkLocation().toString());
|
||||
}
|
||||
|
||||
FileName AndroidToolChain::suggestedDebugger() const
|
||||
FilePath AndroidToolChain::suggestedDebugger() const
|
||||
{
|
||||
// TODO: Make use of LLDB if available.
|
||||
return AndroidConfigurations::currentConfig().gdbPath(targetAbi());
|
||||
}
|
||||
|
||||
FileName AndroidToolChain::suggestedGdbServer() const
|
||||
FilePath AndroidToolChain::suggestedGdbServer() const
|
||||
{
|
||||
return AndroidConfigurations::currentConfig().gdbServer(targetAbi());
|
||||
}
|
||||
@@ -128,11 +128,11 @@ QStringList AndroidToolChain::suggestedMkspecList() const
|
||||
return {"android-g++", "android-clang"};
|
||||
}
|
||||
|
||||
FileName AndroidToolChain::makeCommand(const Environment &env) const
|
||||
FilePath AndroidToolChain::makeCommand(const Environment &env) const
|
||||
{
|
||||
Q_UNUSED(env);
|
||||
FileName makePath = AndroidConfigurations::currentConfig().makePath();
|
||||
return makePath.exists() ? makePath : FileName::fromString("make");
|
||||
FilePath makePath = AndroidConfigurations::currentConfig().makePath();
|
||||
return makePath.exists() ? makePath : FilePath::fromString("make");
|
||||
}
|
||||
|
||||
GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const
|
||||
@@ -162,7 +162,7 @@ ToolChainList AndroidToolChainFactory::autoDetect(CToolChainList &alreadyKnown)
|
||||
return autodetectToolChainsForNdk(alreadyKnown);
|
||||
}
|
||||
|
||||
static FileName clangPlusPlusPath(const FileName &clangPath)
|
||||
static FilePath clangPlusPlusPath(const FilePath &clangPath)
|
||||
{
|
||||
return clangPath.parentDir().pathAppended(
|
||||
HostOsInfo::withExecutableSuffix(
|
||||
@@ -172,7 +172,7 @@ static FileName clangPlusPlusPath(const FileName &clangPath)
|
||||
ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(CToolChainList &alreadyKnown)
|
||||
{
|
||||
QList<ToolChain *> result;
|
||||
FileName clangPath = AndroidConfigurations::currentConfig().clangPath();
|
||||
FilePath clangPath = AndroidConfigurations::currentConfig().clangPath();
|
||||
if (!clangPath.exists()) {
|
||||
qCDebug(androidTCLog) << "Clang toolchains detection fails. Can not find Clang"<< clangPath;
|
||||
return result;
|
||||
@@ -182,7 +182,7 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(CToolChainList
|
||||
<< AndroidConfigurations::currentConfig().ndkLocation();
|
||||
|
||||
for (const Core::Id &lang : LanguageIds) {
|
||||
FileName compilerCommand = clangPath;
|
||||
FilePath compilerCommand = clangPath;
|
||||
if (lang == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
||||
compilerCommand = clangPlusPlusPath(clangPath);
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ public:
|
||||
bool isValid() const override;
|
||||
void addToEnvironment(Utils::Environment &env) const override;
|
||||
|
||||
Utils::FileName suggestedDebugger() const override;
|
||||
Utils::FileName suggestedGdbServer() const;
|
||||
Utils::FilePath suggestedDebugger() const override;
|
||||
Utils::FilePath suggestedGdbServer() const;
|
||||
QStringList suggestedMkspecList() const override;
|
||||
Utils::FileName makeCommand(const Utils::Environment &environment) const override;
|
||||
Utils::FilePath makeCommand(const Utils::Environment &environment) const override;
|
||||
bool fromMap(const QVariantMap &data) override;
|
||||
|
||||
protected:
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
{
|
||||
public:
|
||||
Core::Id language;
|
||||
Utils::FileName compilerCommand;
|
||||
Utils::FilePath compilerCommand;
|
||||
ProjectExplorer::Abi abi;
|
||||
QString version;
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ using namespace Utils;
|
||||
class AndroidToolOutputParser
|
||||
{
|
||||
public:
|
||||
void parseTargetListing(const QString &output, const FileName &sdkLocation,
|
||||
void parseTargetListing(const QString &output, const FilePath &sdkLocation,
|
||||
SdkPlatformList &platformList);
|
||||
|
||||
QList<SdkPlatform> m_installedPlatforms;
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
environment. Returns \c true for successful execution. Command's output is copied to \a
|
||||
output.
|
||||
*/
|
||||
static bool androidToolCommand(Utils::FileName toolPath, const QStringList &args,
|
||||
static bool androidToolCommand(Utils::FilePath toolPath, const QStringList &args,
|
||||
const QProcessEnvironment &environment, QString *output)
|
||||
{
|
||||
QString androidToolPath = toolPath.toString();
|
||||
@@ -143,7 +143,7 @@ QFuture<AndroidDeviceInfoList> AndroidToolManager::androidVirtualDevicesFuture()
|
||||
AndroidConfigurations::toolsEnvironment(m_config));
|
||||
}
|
||||
|
||||
CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FileName androidToolPath,
|
||||
CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FilePath androidToolPath,
|
||||
QProcessEnvironment env)
|
||||
{
|
||||
QProcess proc;
|
||||
@@ -195,8 +195,8 @@ CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FileName and
|
||||
return info;
|
||||
}
|
||||
|
||||
AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::FileName &androidTool,
|
||||
const FileName &sdkLocationPath,
|
||||
AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::FilePath &androidTool,
|
||||
const FilePath &sdkLocationPath,
|
||||
const QProcessEnvironment &env)
|
||||
{
|
||||
AndroidDeviceInfoList devices;
|
||||
@@ -274,7 +274,7 @@ AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::Fil
|
||||
}
|
||||
|
||||
void AndroidToolOutputParser::parseTargetListing(const QString &output,
|
||||
const Utils::FileName &sdkLocation,
|
||||
const Utils::FilePath &sdkLocation,
|
||||
SdkPlatformList &platformList)
|
||||
{
|
||||
auto addSystemImage = [](const QStringList& abiList, SdkPlatform *platform) {
|
||||
@@ -291,7 +291,7 @@ void AndroidToolOutputParser::parseTargetListing(const QString &output,
|
||||
QVersionNumber revision;
|
||||
int apiLevel = -1;
|
||||
QString description;
|
||||
Utils::FileName installedLocation;
|
||||
Utils::FilePath installedLocation;
|
||||
|
||||
void clear() {
|
||||
abiList.clear();
|
||||
|
||||
@@ -58,10 +58,10 @@ public:
|
||||
|
||||
// Helper methods
|
||||
private:
|
||||
static CreateAvdInfo createAvdImpl(CreateAvdInfo info, Utils::FileName androidToolPath,
|
||||
static CreateAvdInfo createAvdImpl(CreateAvdInfo info, Utils::FilePath androidToolPath,
|
||||
QProcessEnvironment env);
|
||||
static AndroidDeviceInfoList androidVirtualDevices(const Utils::FileName &androidTool,
|
||||
const Utils::FileName &sdkLlocationPath,
|
||||
static AndroidDeviceInfoList androidVirtualDevices(const Utils::FilePath &androidTool,
|
||||
const Utils::FilePath &sdkLlocationPath,
|
||||
const QProcessEnvironment &env);
|
||||
private:
|
||||
const AndroidConfig &m_config;
|
||||
|
||||
@@ -324,22 +324,22 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
|
||||
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
|
||||
const QString src(version->qmakeProperty("QT_INSTALL_PREFIX")
|
||||
.append(QLatin1String("/src/android/java/AndroidManifest.xml")));
|
||||
FileUtils::copyRecursively(FileName::fromString(src),
|
||||
FileName::fromString(m_directory + QLatin1String("/AndroidManifest.xml")),
|
||||
FileUtils::copyRecursively(FilePath::fromString(src),
|
||||
FilePath::fromString(m_directory + QLatin1String("/AndroidManifest.xml")),
|
||||
nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);});
|
||||
} else {
|
||||
const QString src(version->qmakeProperty("QT_INSTALL_PREFIX")
|
||||
.append(QLatin1String("/src/android/templates")));
|
||||
|
||||
FileUtils::copyRecursively(FileName::fromString(src),
|
||||
FileName::fromString(m_directory),
|
||||
FileUtils::copyRecursively(FilePath::fromString(src),
|
||||
FilePath::fromString(m_directory),
|
||||
nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);});
|
||||
|
||||
if (m_copyGradle) {
|
||||
FileName gradlePath = FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX").append(QLatin1String("/src/3rdparty/gradle")));
|
||||
FilePath gradlePath = FilePath::fromString(version->qmakeProperty("QT_INSTALL_PREFIX").append(QLatin1String("/src/3rdparty/gradle")));
|
||||
if (!gradlePath.exists())
|
||||
gradlePath = AndroidConfigurations::currentConfig().sdkLocation().pathAppended("/tools/templates/gradle/wrapper");
|
||||
FileUtils::copyRecursively(gradlePath, FileName::fromString(m_directory),
|
||||
FileUtils::copyRecursively(gradlePath, FilePath::fromString(m_directory),
|
||||
nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);});
|
||||
}
|
||||
|
||||
|
||||
@@ -53,12 +53,12 @@ void JavaParser::setProjectFileList(const QStringList &fileList)
|
||||
m_fileList = fileList;
|
||||
}
|
||||
|
||||
void JavaParser::setBuildDirectory(const Utils::FileName &buildDirectory)
|
||||
void JavaParser::setBuildDirectory(const Utils::FilePath &buildDirectory)
|
||||
{
|
||||
m_buildDirectory = buildDirectory;
|
||||
}
|
||||
|
||||
void JavaParser::setSourceDirectory(const Utils::FileName &sourceDirectory)
|
||||
void JavaParser::setSourceDirectory(const Utils::FilePath &sourceDirectory)
|
||||
{
|
||||
m_sourceDirectory = sourceDirectory;
|
||||
}
|
||||
@@ -70,16 +70,16 @@ void JavaParser::parse(const QString &line)
|
||||
int lineno = m_javaRegExp.cap(3).toInt(&ok);
|
||||
if (!ok)
|
||||
lineno = -1;
|
||||
Utils::FileName file = Utils::FileName::fromUserInput(m_javaRegExp.cap(2));
|
||||
Utils::FilePath file = Utils::FilePath::fromUserInput(m_javaRegExp.cap(2));
|
||||
if (file.isChildOf(m_buildDirectory)) {
|
||||
Utils::FileName relativePath = file.relativeChildPath(m_buildDirectory);
|
||||
Utils::FilePath relativePath = file.relativeChildPath(m_buildDirectory);
|
||||
file = m_sourceDirectory.pathAppended(relativePath.toString());
|
||||
}
|
||||
|
||||
if (file.toFileInfo().isRelative()) {
|
||||
for (int i = 0; i < m_fileList.size(); i++)
|
||||
if (m_fileList[i].endsWith(file.toString())) {
|
||||
file = Utils::FileName::fromString(m_fileList[i]);
|
||||
file = Utils::FilePath::fromString(m_fileList[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,16 +43,16 @@ public:
|
||||
void stdError(const QString &line) override;
|
||||
void setProjectFileList(const QStringList &fileList);
|
||||
|
||||
void setBuildDirectory(const Utils::FileName &buildDirectory);
|
||||
void setSourceDirectory(const Utils::FileName &sourceDirectory);
|
||||
void setBuildDirectory(const Utils::FilePath &buildDirectory);
|
||||
void setSourceDirectory(const Utils::FilePath &sourceDirectory);
|
||||
|
||||
private:
|
||||
void parse(const QString &line);
|
||||
|
||||
QRegExp m_javaRegExp;
|
||||
QStringList m_fileList;
|
||||
Utils::FileName m_sourceDirectory;
|
||||
Utils::FileName m_buildDirectory;
|
||||
Utils::FilePath m_sourceDirectory;
|
||||
Utils::FilePath m_buildDirectory;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user