Skip to content
Snippets Groups Projects
Commit 6782d848 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

GnuPoc: Do create pre-parsed pkg-file.

parent 8d14f18e
No related branches found
No related tags found
No related merge requests found
...@@ -671,12 +671,6 @@ void S60DeviceRunControlBase::start() ...@@ -671,12 +671,6 @@ void S60DeviceRunControlBase::start()
return; return;
} }
if (!createPackageFileFromTemplate(&errorMessage)) {
error(this, errorMessage);
emit finished();
return;
}
QStringList makeSisArgs; QStringList makeSisArgs;
switch (m_toolChain) { switch (m_toolChain) {
case ProjectExplorer::ToolChain::GCCE_GNUPOC: case ProjectExplorer::ToolChain::GCCE_GNUPOC:
...@@ -687,6 +681,12 @@ void S60DeviceRunControlBase::start() ...@@ -687,6 +681,12 @@ void S60DeviceRunControlBase::start()
<< (QLatin1String("QT_SIS_KEY=") + signSisKey()); << (QLatin1String("QT_SIS_KEY=") + signSisKey());
break; break;
default: default:
// ABLD: Create from template, replacing paths
if (!createPackageFileFromTemplate(&errorMessage)) {
error(this, errorMessage);
emit finished();
return;
}
makeSisArgs.push_back(m_packageFile); makeSisArgs.push_back(m_packageFile);
break; break;
} }
...@@ -737,29 +737,29 @@ void S60DeviceRunControlBase::readStandardOutput() ...@@ -737,29 +737,29 @@ void S60DeviceRunControlBase::readStandardOutput()
emit addToOutputWindowInline(this, QString::fromLocal8Bit(data.constData(), data.length())); emit addToOutputWindowInline(this, QString::fromLocal8Bit(data.constData(), data.length()));
} }
// ABLD: Create "foo_<platform>_<target>.pkg" and replace variables for the target
// path pointing into the EPOC directories.
bool S60DeviceRunControlBase::createPackageFileFromTemplate(QString *errorMessage) bool S60DeviceRunControlBase::createPackageFileFromTemplate(QString *errorMessage)
{ {
if (debug) if (debug)
qDebug() << "Creating package file" << m_packageFilePath << " from " << m_packageTemplateFile qDebug() << "Creating package file" << m_packageFilePath << " from " << m_packageTemplateFile
<< m_symbianPlatform << m_symbianTarget; << m_symbianPlatform << m_symbianTarget;
QFile packageTemplate(m_packageTemplateFile); QFile packageTemplate(m_packageTemplateFile);
if (!packageTemplate.open(QIODevice::ReadOnly)) { if (!packageTemplate.open(QIODevice::ReadOnly|QIODevice::Text)) {
*errorMessage = tr("Could not read template package file '%1'").arg(QDir::toNativeSeparators(m_packageTemplateFile)); *errorMessage = tr("Could not read template package file '%1'").arg(QDir::toNativeSeparators(m_packageTemplateFile));
return false; return false;
} }
QString contents = packageTemplate.readAll(); QString contents = QString::fromLocal8Bit(packageTemplate.readAll());
packageTemplate.close(); packageTemplate.close();
contents.replace(QLatin1String("$(PLATFORM)"), m_symbianPlatform); contents.replace(QLatin1String("$(PLATFORM)"), m_symbianPlatform);
contents.replace(QLatin1String("$(TARGET)"), m_symbianTarget); contents.replace(QLatin1String("$(TARGET)"), m_symbianTarget);
QFile packageFile(m_packageFilePath); QFile packageFile(m_packageFilePath);
if (!packageFile.open(QIODevice::WriteOnly)) { if (!packageFile.open(QIODevice::WriteOnly|QIODevice::Text)) {
*errorMessage = tr("Could not write package file '%1'").arg(QDir::toNativeSeparators(m_packageFilePath)); *errorMessage = tr("Could not write package file '%1'").arg(QDir::toNativeSeparators(m_packageFilePath));
return false; return false;
} }
packageFile.write(contents.toLocal8Bit()); packageFile.write(contents.toLocal8Bit());
packageFile.close(); packageFile.close();
if (debug > 1)
qDebug() << contents;
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment