Commit 190f2d9e authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Mobile platforms: Do not use QLatin1String in BuildSteps



Change-Id: I3d67e94e7dc2d86ac1eba641562ee4a045f95d6c
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Vikas Pachdha's avatarVikas Pachdha <vikas.pachdha@qt.io>
parent 05e0b001
......@@ -62,11 +62,11 @@ using namespace Internal;
const QVersionNumber gradleScriptRevokedSdkVersion(25, 3, 0);
const QVersionNumber gradleScriptsContainedQtVersion(5, 9, 0);
const QLatin1String DeployActionKey("Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction");
const QLatin1String KeystoreLocationKey("KeystoreLocation");
const QLatin1String BuildTargetSdkKey("BuildTargetSdk");
const QLatin1String VerboseOutputKey("VerboseOutput");
const QLatin1String UseGradleKey("UseGradle");
const char DeployActionKey[] = "Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction";
const char KeystoreLocationKey[] = "KeystoreLocation";
const char BuildTargetSdkKey[] = "BuildTargetSdk";
const char VerboseOutputKey[] = "VerboseOutput";
const char UseGradleKey[] = "UseGradle";
class PasswordInputDialog : public QDialog {
......@@ -161,7 +161,7 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
JavaParser *parser = new JavaParser;
parser->setProjectFileList(target()->project()->files(ProjectExplorer::Project::AllFiles));
parser->setSourceDirectory(androidPackageSourceDir());
parser->setBuildDirectory(Utils::FileName::fromString(bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString()));
parser->setBuildDirectory(Utils::FileName::fromString(bc->buildDirectory().appendPath(Constants::ANDROID_BUILDDIRECTORY).toString()));
setOutputParser(parser);
m_openPackageLocationForRun = m_openPackageLocation;
......@@ -376,11 +376,10 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
CertificatesModel *model = nullptr;
QStringList params
= {QLatin1String("-list"), QLatin1String("-v"), QLatin1String("-keystore"),
m_keystorePath.toUserOutput(), QLatin1String("-storepass")};
= {"-list", "-v", "-keystore", m_keystorePath.toUserOutput(), "-storepass"};
params << m_keystorePasswd;
params << QLatin1String("-J-Duser.language=en");
params << "-J-Duser.language=en";
Utils::SynchronousProcess keytoolProc;
keytoolProc.setTimeoutS(30);
......
......@@ -145,18 +145,18 @@ QVariantMap IosBuildStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(BUILD_ARGUMENTS_KEY), m_baseBuildArguments);
map.insert(QLatin1String(BUILD_USE_DEFAULT_ARGS_KEY), m_useDefaultArguments);
map.insert(QLatin1String(CLEAN_KEY), m_clean);
map.insert(BUILD_ARGUMENTS_KEY, m_baseBuildArguments);
map.insert(BUILD_USE_DEFAULT_ARGS_KEY, m_useDefaultArguments);
map.insert(CLEAN_KEY, m_clean);
return map;
}
bool IosBuildStep::fromMap(const QVariantMap &map)
{
QVariant bArgs = map.value(QLatin1String(BUILD_ARGUMENTS_KEY));
QVariant bArgs = map.value(BUILD_ARGUMENTS_KEY);
m_baseBuildArguments = bArgs.toStringList();
m_useDefaultArguments = map.value(QLatin1String(BUILD_USE_DEFAULT_ARGS_KEY)).toBool();
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
m_useDefaultArguments = map.value(BUILD_USE_DEFAULT_ARGS_KEY).toBool();
m_clean = map.value(CLEAN_KEY).toBool();
return BuildStep::fromMap(map);
}
......@@ -173,11 +173,11 @@ QStringList IosBuildStep::defaultArguments() const
ToolChain *tc = ToolChainKitInformation::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
switch (target()->activeBuildConfiguration()->buildType()) {
case BuildConfiguration::Debug :
res << QLatin1String("-configuration") << QLatin1String("Debug");
res << "-configuration" << "Debug";
break;
case BuildConfiguration::Release :
case BuildConfiguration::Profile :
res << QLatin1String("-configuration") << QLatin1String("Release");
res << "-configuration" << "Release";
break;
case BuildConfiguration::Unknown :
break;
......@@ -191,14 +191,14 @@ QStringList IosBuildStep::defaultArguments() const
res << gtc->platformCodeGenFlags();
}
if (!SysRootKitInformation::sysRoot(kit).isEmpty())
res << QLatin1String("-sdk") << SysRootKitInformation::sysRoot(kit).toString();
res << QLatin1String("SYMROOT=") + IosManager::resDirForTarget(target());
res << "-sdk" << SysRootKitInformation::sysRoot(kit).toString();
res << "SYMROOT=" + IosManager::resDirForTarget(target());
return res;
}
QString IosBuildStep::buildCommand() const
{
return QLatin1String("xcodebuild"); // add path?
return "xcodebuild"; // add path?
}
void IosBuildStep::run(QFutureInterface<bool> &fi)
......@@ -334,7 +334,7 @@ BuildStep *IosBuildStepFactory::create(BuildStepList *parent, const Id id)
IosBuildStep *step = new IosBuildStep(parent);
if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
step->setClean(true);
step->setExtraArguments(QStringList(QLatin1String("clean")));
step->setExtraArguments(QStringList("clean"));
} else if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_BUILD) {
// nomal setup
}
......
......@@ -112,23 +112,23 @@ QVariantMap IosPresetBuildStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(id().withSuffix(QLatin1String(ARGUMENTS_PARTIAL_KEY)).toString(),
map.insert(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString(),
arguments());
map.insert(id().withSuffix(QLatin1String(USE_DEFAULT_ARGS_PARTIAL_KEY)).toString(),
map.insert(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString(),
isDefault());
map.insert(id().withSuffix(QLatin1String(CLEAN_PARTIAL_KEY)).toString(), m_clean);
map.insert(id().withSuffix(QLatin1String(COMMAND_PARTIAL_KEY)).toString(), command());
map.insert(id().withSuffix(CLEAN_PARTIAL_KEY).toString(), m_clean);
map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command());
return map;
}
bool IosPresetBuildStep::fromMap(const QVariantMap &map)
{
QVariant bArgs = map.value(id().withSuffix(QLatin1String(ARGUMENTS_PARTIAL_KEY)).toString());
QVariant bArgs = map.value(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString());
m_arguments = bArgs.toStringList();
bool useDefaultArguments = map.value(
id().withSuffix(QLatin1String(USE_DEFAULT_ARGS_PARTIAL_KEY)).toString()).toBool();
m_clean = map.value(id().withSuffix(QLatin1String(CLEAN_PARTIAL_KEY)).toString(), m_clean).toBool();
m_command = map.value(id().withSuffix(QLatin1String(COMMAND_PARTIAL_KEY)).toString(), m_command)
id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString()).toBool();
m_clean = map.value(id().withSuffix(CLEAN_PARTIAL_KEY).toString(), m_clean).toBool();
m_command = map.value(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), m_command)
.toString();
if (useDefaultArguments) {
m_command = defaultCommand();
......@@ -380,7 +380,7 @@ IosPresetBuildStep *IosDsymBuildStepFactory::createPresetStep(BuildStepList *par
IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, const Id id)
: IosPresetBuildStep(parent, id)
{
setDefaultDisplayName(QLatin1String("dsymutil"));
setDefaultDisplayName("dsymutil");
}
QStringList IosDsymBuildStep::defaultCleanCmdList() const
......@@ -390,23 +390,23 @@ QStringList IosDsymBuildStep::defaultCleanCmdList() const
QTC_ASSERT(runConf, return QStringList("echo"));
QString dsymPath = runConf->bundleDirectory().toUserOutput();
dsymPath.chop(4);
dsymPath.append(QLatin1String(".dSYM"));
dsymPath.append(".dSYM");
return QStringList({"rm", "-rf", dsymPath});
}
QStringList IosDsymBuildStep::defaultCmdList() const
{
QString dsymutilCmd = QLatin1String("dsymutil");
QString dsymutilCmd = "dsymutil";
Utils::FileName dsymUtilPath = IosConfigurations::developerPath()
.appendPath(QLatin1String("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil"));
.appendPath("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil");
if (dsymUtilPath.exists())
dsymutilCmd = dsymUtilPath.toUserOutput();
IosRunConfiguration *runConf =
qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration());
QTC_ASSERT(runConf, return QStringList(QLatin1String("echo")));
QTC_ASSERT(runConf, return QStringList("echo"));
QString dsymPath = runConf->bundleDirectory().toUserOutput();
dsymPath.chop(4);
dsymPath.append(QLatin1String(".dSYM"));
dsymPath.append(".dSYM");
return QStringList({dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput()});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment