forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/5.0' into 6.0" into 6.0
This commit is contained in:
@@ -268,7 +268,20 @@ FilePath AndroidManager::buildDirectory(const Target *target)
|
||||
{
|
||||
if (const BuildSystem *bs = target->buildSystem()) {
|
||||
const QString buildKey = target->activeBuildKey();
|
||||
const FilePath buildDir = bs->buildTarget(target->activeBuildKey()).workingDirectory;
|
||||
|
||||
// Get the target build dir based on the settings file path
|
||||
FilePath buildDir;
|
||||
const ProjectNode *node = target->project()->findNodeForBuildKey(buildKey);
|
||||
if (node) {
|
||||
const QString settingsFile = node->data(Constants::AndroidDeploySettingsFile).toString();
|
||||
buildDir = FilePath::fromUserInput(settingsFile).parentDir();
|
||||
}
|
||||
|
||||
if (!buildDir.isEmpty())
|
||||
return buildDir;
|
||||
|
||||
// Otherwise fallback to target working dir
|
||||
buildDir = bs->buildTarget(target->activeBuildKey()).workingDirectory;
|
||||
if (isQt5CmakeProject(target)) {
|
||||
// Return the main build dir and not the android libs dir
|
||||
const QString libsDir = QString(Constants::ANDROID_BUILD_DIRECTORY) + "/libs";
|
||||
|
||||
@@ -67,10 +67,6 @@ public:
|
||||
AndroidPackageInstallationStep(BuildStepList *bsl, Id id);
|
||||
|
||||
QString nativeAndroidBuildPath() const;
|
||||
|
||||
Utils::FilePath androidBuildDirectory() const;
|
||||
Utils::FilePath buildDirectory() const;
|
||||
|
||||
private:
|
||||
bool init() final;
|
||||
void setupOutputFormatter(OutputFormatter *formatter) final;
|
||||
@@ -108,7 +104,7 @@ bool AndroidPackageInstallationStep::init()
|
||||
|
||||
processParameters()->setCommandLine(cmd);
|
||||
// This is useful when running an example target from a Qt module project.
|
||||
processParameters()->setWorkingDirectory(buildDirectory());
|
||||
processParameters()->setWorkingDirectory(AndroidManager::buildDirectory(target()));
|
||||
|
||||
m_androidDirsToClean.clear();
|
||||
// don't remove gradle's cache, it takes ages to rebuild it.
|
||||
@@ -120,7 +116,7 @@ bool AndroidPackageInstallationStep::init()
|
||||
|
||||
QString AndroidPackageInstallationStep::nativeAndroidBuildPath() const
|
||||
{
|
||||
QString buildPath = androidBuildDirectory().toString();
|
||||
QString buildPath = AndroidManager::androidBuildDirectory(target()).toString();
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
if (buildEnvironment().searchInPath("sh.exe").isEmpty())
|
||||
buildPath = QDir::toNativeSeparators(buildPath);
|
||||
@@ -128,18 +124,6 @@ QString AndroidPackageInstallationStep::nativeAndroidBuildPath() const
|
||||
return buildPath;
|
||||
}
|
||||
|
||||
FilePath AndroidPackageInstallationStep::androidBuildDirectory() const
|
||||
{
|
||||
return buildDirectory() / Constants::ANDROID_BUILD_DIRECTORY;
|
||||
}
|
||||
|
||||
FilePath AndroidPackageInstallationStep::buildDirectory() const
|
||||
{
|
||||
if (const BuildSystem *bs = buildSystem())
|
||||
return bs->buildTarget(target()->activeBuildKey()).workingDirectory;
|
||||
return {};
|
||||
}
|
||||
|
||||
void AndroidPackageInstallationStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
formatter->addLineParser(new GnuMakeParser);
|
||||
|
||||
Reference in New Issue
Block a user