author | eckhart.koppen@nokia.com |
Wed, 31 Mar 2010 11:06:36 +0300 | |
changeset 7 | f7bc934e204c |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the qmake application of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include "initprojectdeploy_symbian.h" |
|
43 |
#include <QDirIterator> |
|
44 |
#include <project.h> |
|
45 |
#include <qxmlstream.h> |
|
46 |
#include <qsettings.h> |
|
47 |
#include <qdebug.h> |
|
48 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
49 |
// Included from tools/shared |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
50 |
#include <symbian/epocroot.h> |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
51 |
|
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
52 |
#define SYSBIN_DIR "/sys/bin" |
0 | 53 |
|
54 |
#define SUFFIX_DLL "dll" |
|
55 |
#define SUFFIX_EXE "exe" |
|
56 |
#define SUFFIX_QTPLUGIN "qtplugin" |
|
57 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
58 |
static QString fixPathToEpocOS(const QString &src) |
0 | 59 |
{ |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
60 |
QString ret = Option::fixPathToTargetOS(src); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
61 |
return ret.replace('/', '\\'); |
0 | 62 |
} |
63 |
||
64 |
static bool isPlugin(const QFileInfo& info, const QString& devicePath) |
|
65 |
{ |
|
66 |
// Libraries are plugins if deployment path is something else than |
|
67 |
// SYSBIN_DIR with or without drive letter |
|
68 |
if (0 == info.suffix().compare(QLatin1String(SUFFIX_DLL), Qt::CaseInsensitive) && |
|
69 |
(devicePath.size() < 8 || |
|
70 |
(0 != devicePath.compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive) && |
|
71 |
0 != devicePath.mid(1).compare(QLatin1String(":" SYSBIN_DIR), Qt::CaseInsensitive)))) { |
|
72 |
return true; |
|
73 |
} else { |
|
74 |
return false; |
|
75 |
} |
|
76 |
} |
|
77 |
||
78 |
static bool isBinary(const QFileInfo& info) |
|
79 |
{ |
|
80 |
if (0 == info.suffix().compare(QLatin1String(SUFFIX_DLL), Qt::CaseInsensitive) || |
|
81 |
0 == info.suffix().compare(QLatin1String(SUFFIX_EXE), Qt::CaseInsensitive)) { |
|
82 |
return true; |
|
83 |
} else { |
|
84 |
return false; |
|
85 |
} |
|
86 |
} |
|
87 |
||
88 |
static void createPluginStub(const QFileInfo& info, |
|
89 |
const QString& devicePath, |
|
90 |
DeploymentList &deploymentList, |
|
91 |
QStringList& generatedDirs, |
|
92 |
QStringList& generatedFiles) |
|
93 |
{ |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
94 |
QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR)); |
0 | 95 |
if (!generatedDirs.contains(PLUGIN_STUB_DIR)) |
96 |
generatedDirs << PLUGIN_STUB_DIR; |
|
97 |
// Plugin stubs must have different name from the actual plugins, because |
|
98 |
// the toolchain for creating ROM images cannot handle non-binary .dll files properly. |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
99 |
QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "/") + info.completeBaseName() + "." SUFFIX_QTPLUGIN); |
0 | 100 |
if (stubFile.open(QIODevice::WriteOnly)) { |
101 |
if (!generatedFiles.contains(stubFile.fileName())) |
|
102 |
generatedFiles << stubFile.fileName(); |
|
103 |
QTextStream t(&stubFile); |
|
104 |
// Add note to stub so that people will not wonder what it is. |
|
105 |
// Creation date is added to make new stub to deploy always to |
|
106 |
// force plugin cache miss when loading plugins. |
|
107 |
t << "This file is a Qt plugin stub file. The real Qt plugin is located in " SYSBIN_DIR ". Created:" << QDateTime::currentDateTime().toString(Qt::ISODate) << "\n"; |
|
108 |
} else { |
|
109 |
fprintf(stderr, "cannot deploy \"%s\" because of plugin stub file creation failed\n", info.fileName().toLatin1().constData()); |
|
110 |
} |
|
111 |
QFileInfo stubInfo(stubFile); |
|
112 |
deploymentList.append(CopyItem(Option::fixPathToLocalOS(stubInfo.absoluteFilePath()), |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
113 |
fixPathToEpocOS(devicePath + "/" + stubInfo.fileName()))); |
0 | 114 |
} |
115 |
||
116 |
QString generate_uid(const QString& target) |
|
117 |
{ |
|
118 |
static QMap<QString, QString> targetToUid; |
|
119 |
||
120 |
QString tmp = targetToUid[target]; |
|
121 |
||
122 |
if (!tmp.isEmpty()) { |
|
123 |
return tmp; |
|
124 |
} |
|
125 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
126 |
quint32 hash = 5381; |
0 | 127 |
int c; |
128 |
||
129 |
for (int i = 0; i < target.size(); ++i) { |
|
130 |
c = target.at(i).toAscii(); |
|
131 |
hash ^= c + ((c - i) << i % 20) + ((c + i) << (i + 5) % 20) + ((c - 2 * i) << (i + 10) % 20) + ((c + 2 * i) << (i + 15) % 20); |
|
132 |
} |
|
133 |
||
134 |
tmp.setNum(hash, 16); |
|
135 |
for (int i = tmp.size(); i < 8; ++i) |
|
136 |
tmp.prepend("0"); |
|
137 |
||
138 |
targetToUid[target] = tmp; |
|
139 |
||
140 |
return tmp; |
|
141 |
} |
|
142 |
||
143 |
// UIDs starting with 0xE are test UIDs in symbian |
|
144 |
QString generate_test_uid(const QString& target) |
|
145 |
{ |
|
146 |
QString tmp = generate_uid(target); |
|
147 |
tmp.replace(0, 1, "E"); |
|
148 |
tmp.prepend("0x"); |
|
149 |
||
150 |
return tmp; |
|
151 |
} |
|
152 |
||
153 |
||
154 |
void initProjectDeploySymbian(QMakeProject* project, |
|
155 |
DeploymentList &deploymentList, |
|
156 |
const QString &testPath, |
|
157 |
bool deployBinaries, |
|
158 |
const QString &platform, |
|
159 |
const QString &build, |
|
160 |
QStringList& generatedDirs, |
|
161 |
QStringList& generatedFiles) |
|
162 |
{ |
|
163 |
QString targetPath = project->values("deploy.path").join(" "); |
|
164 |
if (targetPath.isEmpty()) |
|
165 |
targetPath = testPath; |
|
166 |
if (targetPath.endsWith("/") || targetPath.endsWith("\\")) |
|
167 |
targetPath = targetPath.mid(0, targetPath.size() - 1); |
|
168 |
||
169 |
bool targetPathHasDriveLetter = false; |
|
170 |
if (targetPath.size() > 1) { |
|
171 |
targetPathHasDriveLetter = targetPath.at(1) == QLatin1Char(':'); |
|
172 |
} |
|
173 |
QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:"); |
|
174 |
||
175 |
foreach(QString item, project->values("DEPLOYMENT")) { |
|
176 |
QString devicePath = project->first(item + ".path"); |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
177 |
QString devicePathWithoutDrive = devicePath; |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
178 |
|
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
179 |
bool devicePathHasDriveLetter = false; |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
180 |
if (devicePath.size() > 1) { |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
181 |
devicePathHasDriveLetter = devicePath.at(1) == QLatin1Char(':'); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
182 |
} |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
183 |
|
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
184 |
// Sometimes devicePath can contain disk but APP_RESOURCE_DIR does not, |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
185 |
// so remove the drive letter for comparison purposes. |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
186 |
if (devicePathHasDriveLetter) |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
187 |
{ |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
188 |
devicePathWithoutDrive.remove(0,2); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
189 |
} |
0 | 190 |
if (!deployBinaries |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
191 |
&& !devicePathWithoutDrive.isEmpty() |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
192 |
&& (0 == devicePathWithoutDrive.compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive) |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
193 |
|| 0 == devicePathWithoutDrive.compare(project->values("REG_RESOURCE_IMPORT_DIR").join(""), Qt::CaseInsensitive))) { |
0 | 194 |
// Do not deploy resources in emulator builds, as that seems to cause conflicts |
195 |
// If there is ever a real need to deploy pre-built resources for emulator, |
|
196 |
// BLD_INF_RULES.prj_exports can be used as a workaround. |
|
197 |
continue; |
|
198 |
} |
|
199 |
||
200 |
if (devicePath.isEmpty() || devicePath == QLatin1String(".")) { |
|
201 |
devicePath = targetPath; |
|
202 |
} |
|
203 |
// check if item.path is relative (! either / or \) |
|
204 |
else if (!(devicePath.at(0) == QLatin1Char('/') |
|
205 |
|| devicePath.at(0) == QLatin1Char('\\') |
|
206 |
|| devicePathHasDriveLetter)) { |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
207 |
// Create output path |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
208 |
devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('/') + devicePath)); |
0 | 209 |
} else { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
210 |
if (!platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) { |
0 | 211 |
if (devicePathHasDriveLetter) { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
212 |
devicePath = epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1); |
0 | 213 |
} else { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
214 |
devicePath = epocRoot() + "epoc32/winscw/c" + devicePath; |
0 | 215 |
} |
216 |
} else { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
217 |
if (!devicePathHasDriveLetter) { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
218 |
if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
219 |
//For plugin deployment under ARM no needed drive letter |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
220 |
devicePath = epocRoot() + "epoc32/data/z" + devicePath; |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
221 |
} else if (targetPathHasDriveLetter) { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
222 |
// Drive letter needed if targetpath contains one and it is not already in |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
223 |
devicePath = deploymentDrive + devicePath; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
224 |
} |
0 | 225 |
} else { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
226 |
//it is necessary to delete drive letter for ARM deployment |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
227 |
if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
228 |
devicePath.remove(0,2); |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
229 |
devicePath = epocRoot() + "epoc32/data/z" + devicePath; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
230 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
231 |
} |
0 | 232 |
} |
233 |
} |
|
234 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
235 |
devicePath.replace(QLatin1String("\\"), QLatin1String("/")); |
0 | 236 |
|
237 |
if (!deployBinaries && |
|
238 |
0 == devicePath.right(8).compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive)) { |
|
239 |
// Skip deploying to SYSBIN_DIR for anything but binary deployments |
|
240 |
// Note: Deploying pre-built binaries also follow this rule, so emulator builds |
|
241 |
// will not get those deployed. Since there is no way to differentiate currently |
|
242 |
// between pre-built binaries for emulator and HW anyway, this is not a major issue. |
|
243 |
continue; |
|
244 |
} |
|
245 |
||
246 |
foreach(QString source, project->values(item + ".sources")) { |
|
247 |
source = Option::fixPathToLocalOS(source); |
|
248 |
QString nameFilter; |
|
249 |
QFileInfo info(source); |
|
250 |
QString searchPath; |
|
251 |
bool dirSearch = false; |
|
252 |
||
253 |
if (info.isDir()) { |
|
254 |
nameFilter = QLatin1String("*"); |
|
255 |
searchPath = info.absoluteFilePath(); |
|
256 |
dirSearch = true; |
|
257 |
} else { |
|
258 |
if (info.exists() || source.indexOf('*') != -1) { |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
259 |
nameFilter = source.split(QDir::separator()).last(); |
0 | 260 |
searchPath = info.absolutePath(); |
261 |
} else { |
|
262 |
// Entry was not found. That is ok if it is a binary, since those do not necessarily yet exist. |
|
263 |
// Dlls need to be processed even when not deploying binaries for the stubs |
|
264 |
if (isBinary(info)) { |
|
265 |
if (deployBinaries) { |
|
266 |
// Executables and libraries are deployed to \sys\bin |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
267 |
QFileInfo targetPath(epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); |
0 | 268 |
if(devicePathHasDriveLetter) { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
269 |
deploymentList.append(CopyItem( |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
270 |
Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
271 |
false, true), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
272 |
fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
273 |
+ info.fileName()))); |
0 | 274 |
} else { |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
275 |
deploymentList.append(CopyItem( |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
276 |
Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
277 |
false, true), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
278 |
fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
279 |
+ info.fileName()))); |
0 | 280 |
} |
281 |
} |
|
282 |
if (isPlugin(info, devicePath)) { |
|
283 |
createPluginStub(info, devicePath, deploymentList, generatedDirs, generatedFiles); |
|
284 |
continue; |
|
285 |
} |
|
286 |
} else { |
|
287 |
// Generate deployment even if file doesn't exist, as this may be the case |
|
288 |
// when generating .pkg files. |
|
289 |
deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()), |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
290 |
fixPathToEpocOS(devicePath + "/" + info.fileName()))); |
0 | 291 |
continue; |
292 |
} |
|
293 |
} |
|
294 |
} |
|
295 |
||
296 |
int pathSize = info.absolutePath().size(); |
|
297 |
QDirIterator iterator(searchPath, QStringList() << nameFilter |
|
298 |
, QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks |
|
299 |
, dirSearch ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags); |
|
300 |
||
301 |
while (iterator.hasNext()) { |
|
302 |
iterator.next(); |
|
303 |
QFileInfo iteratorInfo(iterator.filePath()); |
|
304 |
QString absoluteItemPath = Option::fixPathToLocalOS(iteratorInfo.absolutePath()); |
|
305 |
int diffSize = absoluteItemPath.size() - pathSize; |
|
306 |
||
307 |
if (!iteratorInfo.isDir()) { |
|
308 |
if (isPlugin(iterator.fileInfo(), devicePath)) { |
|
309 |
// This deploys pre-built plugins. Other pre-built binaries will deploy normally, |
|
310 |
// as they have SYSBIN_DIR target path. |
|
311 |
if (deployBinaries) { |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
312 |
if (devicePathHasDriveLetter) { |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
313 |
deploymentList.append(CopyItem( |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
314 |
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
315 |
fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
316 |
+ iterator.fileName()))); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
317 |
} else { |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
318 |
deploymentList.append(CopyItem( |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
319 |
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
320 |
fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
321 |
+ iterator.fileName()))); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
322 |
} |
0 | 323 |
} |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
324 |
createPluginStub(info, devicePath + "/" + absoluteItemPath.right(diffSize), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
325 |
deploymentList, generatedDirs, generatedFiles); |
0 | 326 |
continue; |
327 |
} else { |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
328 |
deploymentList.append(CopyItem( |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
329 |
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
330 |
fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize) |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
331 |
+ "/" + iterator.fileName()))); |
0 | 332 |
} |
333 |
} |
|
334 |
} |
|
335 |
} |
|
336 |
} |
|
337 |
} |