Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/cmakecache-4.1 into lp:qtcreator-plugin-ubuntu
- cmakecache-4.1
- Merge into trunk
Proposed by
Benjamin Zeller
Status: | Merged |
---|---|
Approved by: | Zoltan Balogh |
Approved revision: | 474 |
Merged at revision: | 469 |
Proposed branch: | lp:~zeller-benjamin/qtcreator-plugin-ubuntu/cmakecache-4.1 |
Merge into: | lp:qtcreator-plugin-ubuntu |
Diff against target: |
411 lines (+36/-219) 10 files modified
UbuntuPlugin.pro (+0/-2) src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp (+0/-1) src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp (+0/-1) src/ubuntu/ubuntucmakecache.cpp (+0/-130) src/ubuntu/ubuntucmakecache.h (+0/-58) src/ubuntu/ubuntupackagingmodel.cpp (+0/-1) src/ubuntu/ubuntuplugin.cpp (+0/-2) src/ubuntu/ubuntuprojecthelper.cpp (+18/-5) src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp (+17/-18) src/ubuntu/wizards/ubuntuprojectapplicationwizard.h (+1/-1) |
To merge this branch: | bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/cmakecache-4.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Needs Fixing | |
Zoltan Balogh | Approve | ||
Review via email: mp+304946@code.launchpad.net |
Commit message
Refactored CMakePlugin uses a temporary dir as long as the builddir was not created.
We can now get the CMakeCache information directly from the plugin.
Description of the change
Refactored CMakePlugin uses a temporary dir as long as the builddir was not created.
We can now get the CMakeCache information directly from the plugin.
To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) : | # |
review:
Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:474
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
review:
Needs Fixing
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'UbuntuPlugin.pro' | |||
2 | --- UbuntuPlugin.pro 2016-07-20 14:56:52 +0000 | |||
3 | +++ UbuntuPlugin.pro 2016-09-05 17:16:02 +0000 | |||
4 | @@ -88,7 +88,6 @@ | |||
5 | 88 | src/ubuntu/ubuntuabstractguieditordocument.cpp \ | 88 | src/ubuntu/ubuntuabstractguieditordocument.cpp \ |
6 | 89 | src/ubuntu/ubuntuapparmoreditor.cpp \ | 89 | src/ubuntu/ubuntuapparmoreditor.cpp \ |
7 | 90 | src/ubuntu/ubuntueditorfactory.cpp \ | 90 | src/ubuntu/ubuntueditorfactory.cpp \ |
8 | 91 | src/ubuntu/ubuntucmakecache.cpp \ | ||
9 | 92 | src/ubuntu/ubuntutestcontrol.cpp \ | 91 | src/ubuntu/ubuntutestcontrol.cpp \ |
10 | 93 | src/ubuntu/ubuntupackageoutputparser.cpp \ | 92 | src/ubuntu/ubuntupackageoutputparser.cpp \ |
11 | 94 | src/ubuntu/ubuntuprojecthelper.cpp \ | 93 | src/ubuntu/ubuntuprojecthelper.cpp \ |
12 | @@ -156,7 +155,6 @@ | |||
13 | 156 | src/ubuntu/ubuntuabstractguieditordocument.h \ | 155 | src/ubuntu/ubuntuabstractguieditordocument.h \ |
14 | 157 | src/ubuntu/ubuntuapparmoreditor.h \ | 156 | src/ubuntu/ubuntuapparmoreditor.h \ |
15 | 158 | src/ubuntu/ubuntueditorfactory.h \ | 157 | src/ubuntu/ubuntueditorfactory.h \ |
16 | 159 | src/ubuntu/ubuntucmakecache.h \ | ||
17 | 160 | src/ubuntu/ubuntutestcontrol.h \ | 158 | src/ubuntu/ubuntutestcontrol.h \ |
18 | 161 | src/ubuntu/ubuntupackageoutputparser.h \ | 159 | src/ubuntu/ubuntupackageoutputparser.h \ |
19 | 162 | src/ubuntu/ubuntuprojecthelper.h \ | 160 | src/ubuntu/ubuntuprojecthelper.h \ |
20 | 163 | 161 | ||
21 | === modified file 'src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp' | |||
22 | --- src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-08-29 15:46:17 +0000 | |||
23 | +++ src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-09-05 17:16:02 +0000 | |||
24 | @@ -21,7 +21,6 @@ | |||
25 | 21 | #include <ubuntu/ubuntuprojecthelper.h> | 21 | #include <ubuntu/ubuntuprojecthelper.h> |
26 | 22 | #include <ubuntu/ubuntuclickmanifest.h> | 22 | #include <ubuntu/ubuntuclickmanifest.h> |
27 | 23 | #include <ubuntu/device/remote/ubunturemoterunconfiguration.h> | 23 | #include <ubuntu/device/remote/ubunturemoterunconfiguration.h> |
28 | 24 | #include <ubuntu/ubuntucmakecache.h> | ||
29 | 25 | #include <ubuntu/ubuntuprojecthelper.h> | 24 | #include <ubuntu/ubuntuprojecthelper.h> |
30 | 26 | #include <ubuntu/ubuntuclicktool.h> | 25 | #include <ubuntu/ubuntuclicktool.h> |
31 | 27 | #include <ubuntu/clicktoolchain.h> | 26 | #include <ubuntu/clicktoolchain.h> |
32 | 28 | 27 | ||
33 | === modified file 'src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp' | |||
34 | --- src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-07-20 14:56:52 +0000 | |||
35 | +++ src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-09-05 17:16:02 +0000 | |||
36 | @@ -20,7 +20,6 @@ | |||
37 | 20 | #include <ubuntu/ubuntuprojecthelper.h> | 20 | #include <ubuntu/ubuntuprojecthelper.h> |
38 | 21 | #include <ubuntu/clicktoolchain.h> | 21 | #include <ubuntu/clicktoolchain.h> |
39 | 22 | #include <ubuntu/ubuntuclickmanifest.h> | 22 | #include <ubuntu/ubuntuclickmanifest.h> |
40 | 23 | #include <ubuntu/ubuntucmakecache.h> | ||
41 | 24 | #include <ubuntu/ubuntushared.h> | 23 | #include <ubuntu/ubuntushared.h> |
42 | 25 | 24 | ||
43 | 26 | #include <ubuntu/device/remote/ubunturemoterunconfiguration.h> | 25 | #include <ubuntu/device/remote/ubunturemoterunconfiguration.h> |
44 | 27 | 26 | ||
45 | === removed file 'src/ubuntu/ubuntucmakecache.cpp' | |||
46 | --- src/ubuntu/ubuntucmakecache.cpp 2016-07-20 14:56:52 +0000 | |||
47 | +++ src/ubuntu/ubuntucmakecache.cpp 1970-01-01 00:00:00 +0000 | |||
48 | @@ -1,130 +0,0 @@ | |||
49 | 1 | #include "ubuntucmakecache.h" | ||
50 | 2 | |||
51 | 3 | #include <projectexplorer/session.h> | ||
52 | 4 | #include <projectexplorer/project.h> | ||
53 | 5 | #include <projectexplorer/target.h> | ||
54 | 6 | #include <projectexplorer/buildconfiguration.h> | ||
55 | 7 | #include <cmakeprojectmanager/cmakeprojectconstants.h> | ||
56 | 8 | |||
57 | 9 | #include <QRegularExpression> | ||
58 | 10 | #include <QDir> | ||
59 | 11 | #include <QDebug> | ||
60 | 12 | |||
61 | 13 | namespace Ubuntu{ | ||
62 | 14 | namespace Internal { | ||
63 | 15 | |||
64 | 16 | enum { | ||
65 | 17 | debug = 0 | ||
66 | 18 | }; | ||
67 | 19 | |||
68 | 20 | /*! | ||
69 | 21 | * \class UbuntuCMakeCache::UbuntuCMakeCache | ||
70 | 22 | * Automatic updating value cache, this reads all relevant CMakeCache files | ||
71 | 23 | * and stores some for quick querying | ||
72 | 24 | */ | ||
73 | 25 | |||
74 | 26 | UbuntuCMakeCache * UbuntuCMakeCache::m_instance = nullptr; | ||
75 | 27 | |||
76 | 28 | UbuntuCMakeCache::UbuntuCMakeCache(QObject *parent) : | ||
77 | 29 | QObject(parent) | ||
78 | 30 | { | ||
79 | 31 | Q_ASSERT_X(m_instance == nullptr,Q_FUNC_INFO,"There can be only one UbuntuCMakeCache instance"); | ||
80 | 32 | m_instance = this; | ||
81 | 33 | |||
82 | 34 | connect(ProjectExplorer::SessionManager::instance(),SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), | ||
83 | 35 | this,SLOT(onAboutToRemoveProject(ProjectExplorer::Project*))); | ||
84 | 36 | } | ||
85 | 37 | |||
86 | 38 | QVariant UbuntuCMakeCache::getValue(const QString &key, ProjectExplorer::BuildConfiguration *bc, const QVariant defaultValue) | ||
87 | 39 | { | ||
88 | 40 | UbuntuCMakeCache *inst = instance(); | ||
89 | 41 | if(!inst || !bc) | ||
90 | 42 | return defaultValue; | ||
91 | 43 | |||
92 | 44 | Utils::FileName cacheFile = bc->buildDirectory().appendPath(QStringLiteral("CMakeCache.txt")); | ||
93 | 45 | QString cacheKey = inst->normalize(cacheFile.toString()); | ||
94 | 46 | |||
95 | 47 | bool needsRefresh = false; | ||
96 | 48 | if(!inst->m_map.contains(cacheKey)) { | ||
97 | 49 | //we need to read it | ||
98 | 50 | needsRefresh = true; | ||
99 | 51 | } else { | ||
100 | 52 | //check if the file has changed since the last read | ||
101 | 53 | inst->m_map[cacheKey].cacheFile.refresh(); | ||
102 | 54 | if(debug) qDebug()<<"File Last Read "<<inst->m_map[cacheKey].cacheFile.lastModified() | ||
103 | 55 | <<"Cache Last Read "<<inst->m_map[cacheKey].lastRead; | ||
104 | 56 | if(inst->m_map[cacheKey].cacheFile.lastModified() != inst->m_map[cacheKey].lastRead) { | ||
105 | 57 | needsRefresh = true; | ||
106 | 58 | } | ||
107 | 59 | } | ||
108 | 60 | |||
109 | 61 | if(needsRefresh) | ||
110 | 62 | inst->refreshCache(cacheKey, cacheFile); | ||
111 | 63 | |||
112 | 64 | if(inst->m_map[cacheKey].values.contains(key)) | ||
113 | 65 | return inst->m_map[cacheKey].values[key]; | ||
114 | 66 | |||
115 | 67 | return defaultValue; | ||
116 | 68 | } | ||
117 | 69 | |||
118 | 70 | UbuntuCMakeCache *UbuntuCMakeCache::instance() | ||
119 | 71 | { | ||
120 | 72 | return m_instance; | ||
121 | 73 | } | ||
122 | 74 | |||
123 | 75 | void UbuntuCMakeCache::onAboutToRemoveProject(ProjectExplorer::Project *p) | ||
124 | 76 | { | ||
125 | 77 | if(!p) | ||
126 | 78 | return; | ||
127 | 79 | |||
128 | 80 | //remove all values that belong to the project | ||
129 | 81 | for (ProjectExplorer::Target *t : p->targets()) { | ||
130 | 82 | for(ProjectExplorer::BuildConfiguration *bc : t->buildConfigurations()) { | ||
131 | 83 | Utils::FileName cacheFile = bc->buildDirectory().appendPath(QStringLiteral("CMakeCache.txt")); | ||
132 | 84 | m_map.remove(normalize(cacheFile.toString())); | ||
133 | 85 | } | ||
134 | 86 | } | ||
135 | 87 | } | ||
136 | 88 | |||
137 | 89 | QString UbuntuCMakeCache::normalize(const QString &path) const | ||
138 | 90 | { | ||
139 | 91 | return QDir::cleanPath(path); | ||
140 | 92 | } | ||
141 | 93 | |||
142 | 94 | void UbuntuCMakeCache::refreshCache(const QString &key, const Utils::FileName &fName) | ||
143 | 95 | { | ||
144 | 96 | if(debug) qDebug()<<"Rebuilding cache for: "<<key; | ||
145 | 97 | UbuntuCMakeCacheEntry *entry = nullptr; | ||
146 | 98 | if(m_map.contains(key)) { | ||
147 | 99 | entry = &m_map[key]; | ||
148 | 100 | entry->lastRead = fName.toFileInfo().lastModified(); | ||
149 | 101 | } else { | ||
150 | 102 | QFileInfo fInfo = fName.toFileInfo(); | ||
151 | 103 | entry = &m_map.insert(key,UbuntuCMakeCacheEntry{fInfo,fInfo.lastModified(),CMakeCacheValueMap()}).value(); | ||
152 | 104 | } | ||
153 | 105 | |||
154 | 106 | QFile cache(fName.toString()); | ||
155 | 107 | if(cache.exists() && cache.open(QIODevice::ReadOnly)) { | ||
156 | 108 | static const QRegularExpression regExpPType(QLatin1String("^UBUNTU_PROJECT_TYPE:(.*)=\\s*(\\S*)\\s*$")); | ||
157 | 109 | static const QRegularExpression regExpManifestPath (QLatin1String("^UBUNTU_MANIFEST_PATH:(.*)=\\s*(\\S*)\\s*$")); | ||
158 | 110 | QTextStream in(&cache); | ||
159 | 111 | while (!in.atEnd()) { | ||
160 | 112 | QString contents = in.readLine(); | ||
161 | 113 | QRegularExpressionMatch m = regExpPType.match(contents); | ||
162 | 114 | if(m.hasMatch()) { | ||
163 | 115 | entry->values.insert(QStringLiteral("UBUNTU_PROJECT_TYPE"),m.captured(2)); | ||
164 | 116 | continue; | ||
165 | 117 | } | ||
166 | 118 | m = regExpManifestPath.match(contents); | ||
167 | 119 | if(m.hasMatch()) { | ||
168 | 120 | entry->values.insert(QStringLiteral("UBUNTU_MANIFEST_PATH"),m.captured(2)); | ||
169 | 121 | continue; | ||
170 | 122 | } | ||
171 | 123 | } | ||
172 | 124 | |||
173 | 125 | |||
174 | 126 | } | ||
175 | 127 | } | ||
176 | 128 | |||
177 | 129 | }} | ||
178 | 130 | |||
179 | 131 | 0 | ||
180 | === removed file 'src/ubuntu/ubuntucmakecache.h' | |||
181 | --- src/ubuntu/ubuntucmakecache.h 2014-08-20 07:38:07 +0000 | |||
182 | +++ src/ubuntu/ubuntucmakecache.h 1970-01-01 00:00:00 +0000 | |||
183 | @@ -1,58 +0,0 @@ | |||
184 | 1 | #ifndef UBUNTUCMAKECACHE_H | ||
185 | 2 | #define UBUNTUCMAKECACHE_H | ||
186 | 3 | |||
187 | 4 | #include <QObject> | ||
188 | 5 | #include <QHash> | ||
189 | 6 | #include <QMap> | ||
190 | 7 | #include <QVariant> | ||
191 | 8 | #include <QDateTime> | ||
192 | 9 | #include <QFileInfo> | ||
193 | 10 | |||
194 | 11 | #include <utils/fileutils.h> | ||
195 | 12 | |||
196 | 13 | namespace ProjectExplorer { | ||
197 | 14 | class Project; | ||
198 | 15 | class Target; | ||
199 | 16 | class BuildConfiguration; | ||
200 | 17 | } | ||
201 | 18 | |||
202 | 19 | namespace Ubuntu{ | ||
203 | 20 | namespace Internal { | ||
204 | 21 | |||
205 | 22 | typedef QMap<QString,QVariant> CMakeCacheValueMap; | ||
206 | 23 | |||
207 | 24 | struct UbuntuCMakeCacheEntry { | ||
208 | 25 | QFileInfo cacheFile; | ||
209 | 26 | QDateTime lastRead; | ||
210 | 27 | CMakeCacheValueMap values; | ||
211 | 28 | }; | ||
212 | 29 | |||
213 | 30 | typedef QMap<QString,UbuntuCMakeCacheEntry> CMakeCache; | ||
214 | 31 | |||
215 | 32 | class UbuntuCMakeCache : public QObject | ||
216 | 33 | { | ||
217 | 34 | Q_OBJECT | ||
218 | 35 | public: | ||
219 | 36 | explicit UbuntuCMakeCache(QObject *parent = 0); | ||
220 | 37 | |||
221 | 38 | static QVariant getValue (const QString &key, ProjectExplorer::BuildConfiguration *bc, const QVariant defaultValue = QVariant()); | ||
222 | 39 | static UbuntuCMakeCache *instance(); | ||
223 | 40 | |||
224 | 41 | private slots: | ||
225 | 42 | void onAboutToRemoveProject (ProjectExplorer::Project *p); | ||
226 | 43 | |||
227 | 44 | private: | ||
228 | 45 | QString normalize (const QString &path) const; | ||
229 | 46 | void refreshCache (const QString &key, const Utils::FileName &fName); | ||
230 | 47 | |||
231 | 48 | private: | ||
232 | 49 | CMakeCache m_map; | ||
233 | 50 | static UbuntuCMakeCache *m_instance; | ||
234 | 51 | |||
235 | 52 | }; | ||
236 | 53 | |||
237 | 54 | }} | ||
238 | 55 | |||
239 | 56 | |||
240 | 57 | |||
241 | 58 | #endif // UBUNTUCMAKECACHE_H | ||
242 | 59 | 0 | ||
243 | === modified file 'src/ubuntu/ubuntupackagingmodel.cpp' | |||
244 | --- src/ubuntu/ubuntupackagingmodel.cpp 2016-07-20 14:56:52 +0000 | |||
245 | +++ src/ubuntu/ubuntupackagingmodel.cpp 2016-09-05 17:16:02 +0000 | |||
246 | @@ -23,7 +23,6 @@ | |||
247 | 23 | #include "ubuntuvalidationresultmodel.h" | 23 | #include "ubuntuvalidationresultmodel.h" |
248 | 24 | #include "ubuntupackagestep.h" | 24 | #include "ubuntupackagestep.h" |
249 | 25 | #include "ubuntushared.h" | 25 | #include "ubuntushared.h" |
250 | 26 | #include "ubuntucmakecache.h" | ||
251 | 27 | #include "ubuntuprojecthelper.h" | 26 | #include "ubuntuprojecthelper.h" |
252 | 28 | #include "ubuntufixmanifeststep.h" | 27 | #include "ubuntufixmanifeststep.h" |
253 | 29 | #include "wizards/ubuntufatpackagingwizard.h" | 28 | #include "wizards/ubuntufatpackagingwizard.h" |
254 | 30 | 29 | ||
255 | === modified file 'src/ubuntu/ubuntuplugin.cpp' | |||
256 | --- src/ubuntu/ubuntuplugin.cpp 2016-07-20 14:56:52 +0000 | |||
257 | +++ src/ubuntu/ubuntuplugin.cpp 2016-09-05 17:16:02 +0000 | |||
258 | @@ -29,7 +29,6 @@ | |||
259 | 29 | #include "ubuntuqtversion.h" | 29 | #include "ubuntuqtversion.h" |
260 | 30 | #include "ubuntuqmlbuildconfiguration.h" | 30 | #include "ubuntuqmlbuildconfiguration.h" |
261 | 31 | #include "ubuntueditorfactory.h" | 31 | #include "ubuntueditorfactory.h" |
262 | 32 | #include "ubuntucmakecache.h" | ||
263 | 33 | #include "ubuntutestcontrol.h" | 32 | #include "ubuntutestcontrol.h" |
264 | 34 | #include "ubuntupackageoutputparser.h" | 33 | #include "ubuntupackageoutputparser.h" |
265 | 35 | #include "ubuntuprojecthelper.h" | 34 | #include "ubuntuprojecthelper.h" |
266 | @@ -175,7 +174,6 @@ | |||
267 | 175 | 174 | ||
268 | 176 | // Build support | 175 | // Build support |
269 | 177 | addAutoReleasedObject(new ClickToolChainFactory); | 176 | addAutoReleasedObject(new ClickToolChainFactory); |
270 | 178 | addAutoReleasedObject(new UbuntuCMakeCache); | ||
271 | 179 | addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory); | 177 | addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory); |
272 | 180 | addAutoReleasedObject(new UbuntuQmlBuildConfigurationFactory); | 178 | addAutoReleasedObject(new UbuntuQmlBuildConfigurationFactory); |
273 | 181 | addAutoReleasedObject(new UbuntuQmlBuildStepFactory); | 179 | addAutoReleasedObject(new UbuntuQmlBuildStepFactory); |
274 | 182 | 180 | ||
275 | === modified file 'src/ubuntu/ubuntuprojecthelper.cpp' | |||
276 | --- src/ubuntu/ubuntuprojecthelper.cpp 2015-06-30 13:34:14 +0000 | |||
277 | +++ src/ubuntu/ubuntuprojecthelper.cpp 2016-09-05 17:16:02 +0000 | |||
278 | @@ -16,7 +16,6 @@ | |||
279 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> |
280 | 17 | */ | 17 | */ |
281 | 18 | #include "ubuntuprojecthelper.h" | 18 | #include "ubuntuprojecthelper.h" |
282 | 19 | #include "ubuntucmakecache.h" | ||
283 | 20 | 19 | ||
284 | 21 | #include <projectexplorer/project.h> | 20 | #include <projectexplorer/project.h> |
285 | 22 | #include <projectexplorer/target.h> | 21 | #include <projectexplorer/target.h> |
286 | @@ -24,6 +23,7 @@ | |||
287 | 24 | 23 | ||
288 | 25 | #include <cmakeprojectmanager/cmakeproject.h> | 24 | #include <cmakeprojectmanager/cmakeproject.h> |
289 | 26 | #include <cmakeprojectmanager/cmakeprojectconstants.h> | 25 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
290 | 26 | #include <cmakeprojectmanager/cmakebuildconfiguration.h> | ||
291 | 27 | 27 | ||
292 | 28 | #include <qmakeprojectmanager/qmakeproject.h> | 28 | #include <qmakeprojectmanager/qmakeproject.h> |
293 | 29 | #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> | 29 | #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
294 | @@ -33,6 +33,7 @@ | |||
295 | 33 | #include <QDebug> | 33 | #include <QDebug> |
296 | 34 | 34 | ||
297 | 35 | #include <QFile> | 35 | #include <QFile> |
298 | 36 | #include <QDir> | ||
299 | 36 | #include <QTextStream> | 37 | #include <QTextStream> |
300 | 37 | #include <QRegularExpression> | 38 | #include <QRegularExpression> |
301 | 38 | 39 | ||
302 | @@ -124,12 +125,24 @@ | |||
303 | 124 | QString UbuntuProjectHelper::getManifestPath(ProjectExplorer::Target *target, const QString &defaultValue) | 125 | QString UbuntuProjectHelper::getManifestPath(ProjectExplorer::Target *target, const QString &defaultValue) |
304 | 125 | { | 126 | { |
305 | 126 | if(target && target->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID ) { | 127 | if(target && target->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID ) { |
309 | 127 | QVariant manifestPath = UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_MANIFEST_PATH"), | 128 | |
310 | 128 | target->activeBuildConfiguration(), | 129 | CMakeProjectManager::CMakeConfig fullCache = CMakeProjectManager::CMakeProject::activeCmakeCacheForTarget(target); |
311 | 129 | defaultValue); | 130 | |
312 | 131 | QString manifestPath; | ||
313 | 132 | |||
314 | 133 | QByteArray fromCache = CMakeProjectManager::CMakeConfigItem::valueOf("UBUNTU_MANIFEST_PATH", fullCache ); | ||
315 | 134 | if (!fromCache.isEmpty()) { | ||
316 | 135 | manifestPath = QString::fromUtf8(fromCache); | ||
317 | 136 | } else { | ||
318 | 137 | manifestPath = defaultValue; | ||
319 | 138 | } | ||
320 | 139 | |||
321 | 140 | if(QDir::isAbsolutePath(manifestPath)) | ||
322 | 141 | return manifestPath; | ||
323 | 130 | 142 | ||
324 | 131 | Utils::FileName projectDir = target->project()->projectDirectory(); | 143 | Utils::FileName projectDir = target->project()->projectDirectory(); |
326 | 132 | return projectDir.appendPath(manifestPath.toString()).toString(); | 144 | return projectDir.appendPath(manifestPath).toString(); |
327 | 145 | |||
328 | 133 | } else if (target && target->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID ) { | 146 | } else if (target && target->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID ) { |
329 | 134 | QmakeProjectManager::QmakeProject *qmakeProj = static_cast<QmakeProjectManager::QmakeProject *>(target->project()); | 147 | QmakeProjectManager::QmakeProject *qmakeProj = static_cast<QmakeProjectManager::QmakeProject *>(target->project()); |
330 | 135 | QList<QmakeProjectManager::QmakeProFileNode *> nodes = qmakeProj->allProFiles(); | 148 | QList<QmakeProjectManager::QmakeProFileNode *> nodes = qmakeProj->allProFiles(); |
331 | 136 | 149 | ||
332 | === modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp' | |||
333 | --- src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-07-20 14:56:52 +0000 | |||
334 | +++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-09-05 17:16:02 +0000 | |||
335 | @@ -27,6 +27,7 @@ | |||
336 | 27 | #include <utils/qtcassert.h> | 27 | #include <utils/qtcassert.h> |
337 | 28 | #include <utils/pathchooser.h> | 28 | #include <utils/pathchooser.h> |
338 | 29 | #include <utils/mimetypes/mimedatabase.h> | 29 | #include <utils/mimetypes/mimedatabase.h> |
339 | 30 | #include <utils/algorithm.h> | ||
340 | 30 | #include <qtsupport/qtkitinformation.h> | 31 | #include <qtsupport/qtkitinformation.h> |
341 | 31 | #include <qtsupport/qtsupportconstants.h> | 32 | #include <qtsupport/qtsupportconstants.h> |
342 | 32 | #include <projectexplorer/kitmanager.h> | 33 | #include <projectexplorer/kitmanager.h> |
343 | @@ -171,39 +172,37 @@ | |||
344 | 171 | delete m_targetSetupPage; | 172 | delete m_targetSetupPage; |
345 | 172 | } | 173 | } |
346 | 173 | 174 | ||
348 | 174 | bool UbuntuProjectApplicationWizardDialog::writeUserFile(const QString &projectFileName) const | 175 | void UbuntuProjectApplicationWizardDialog::writeUserFile(const QString &projectFileName) const |
349 | 175 | { | 176 | { |
350 | 176 | if (!m_targetSetupPage) | 177 | if (!m_targetSetupPage) |
352 | 177 | return false; | 178 | return; |
353 | 178 | 179 | ||
354 | 179 | QFileInfo fi = QFileInfo(projectFileName); | 180 | QFileInfo fi = QFileInfo(projectFileName); |
355 | 180 | if (!fi.exists()) | 181 | if (!fi.exists()) |
357 | 181 | return false; | 182 | return; |
358 | 182 | 183 | ||
359 | 183 | QString filePath = fi.canonicalFilePath(); | 184 | QString filePath = fi.canonicalFilePath(); |
360 | 184 | 185 | ||
361 | 185 | Utils::MimeDatabase mimeDb; | 186 | Utils::MimeDatabase mimeDb; |
362 | 186 | const Utils::MimeType mt = mimeDb.mimeTypeForFile(fi); | 187 | const Utils::MimeType mt = mimeDb.mimeTypeForFile(fi); |
363 | 187 | if (mt.isValid()) { | 188 | if (mt.isValid()) { |
364 | 188 | QList<ProjectExplorer::IProjectManager*> allProjectManagers = ExtensionSystem::PluginManager::getObjects<ProjectExplorer::IProjectManager>(); | ||
365 | 189 | foreach (ProjectExplorer::IProjectManager *manager, allProjectManagers) { | ||
366 | 190 | if (manager->mimeType() == mt.name()) { | ||
367 | 191 | QString tmp; | ||
368 | 192 | if (ProjectExplorer::Project *pro = manager->openProject(filePath, &tmp)) { | ||
369 | 193 | if(debug) qDebug()<<"Storing project type settings: "<<pro->id().toSetting(); | ||
370 | 194 | 189 | ||
379 | 195 | bool success = m_targetSetupPage->setupProject(pro); | 190 | QString tmp; |
380 | 196 | if(success) { | 191 | QList<ProjectExplorer::IProjectManager *> managerList = ExtensionSystem::PluginManager::getObjects<ProjectExplorer::IProjectManager>(); |
381 | 197 | pro->saveSettings(); | 192 | auto manager = Utils::findOrDefault(managerList, Utils::equal(&ProjectExplorer::IProjectManager::mimeType, mt.name())); |
382 | 198 | } | 193 | ProjectExplorer::Project *project = manager ? manager->openProject(filePath, &tmp) : 0; |
383 | 199 | delete pro; | 194 | if(project) { |
384 | 200 | return success; | 195 | if (m_targetSetupPage->setupProject(project)) { |
385 | 201 | } | 196 | if(debug) qDebug()<<"Storing project type settings: "<<project->id().toSetting(); |
386 | 202 | break; | 197 | project->saveSettings(); |
387 | 203 | } | 198 | } |
388 | 199 | delete project; | ||
389 | 200 | project = nullptr; | ||
390 | 204 | } | 201 | } |
391 | 202 | |||
392 | 203 | return; | ||
393 | 205 | } | 204 | } |
395 | 206 | return false; | 205 | return; |
396 | 207 | } | 206 | } |
397 | 208 | 207 | ||
398 | 209 | 208 | ||
399 | 210 | 209 | ||
400 | === modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.h' | |||
401 | --- src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2016-07-20 14:56:52 +0000 | |||
402 | +++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2016-09-05 17:16:02 +0000 | |||
403 | @@ -76,7 +76,7 @@ | |||
404 | 76 | void addTargetSetupPage(int id = -1); | 76 | void addTargetSetupPage(int id = -1); |
405 | 77 | 77 | ||
406 | 78 | QList<Core::Id> selectedKits() const; | 78 | QList<Core::Id> selectedKits() const; |
408 | 79 | bool writeUserFile(const QString &projectFileName) const; | 79 | void writeUserFile(const QString &projectFileName) const; |
409 | 80 | private slots: | 80 | private slots: |
410 | 81 | void generateProfileName(const QString &projectName, const QString &path); | 81 | void generateProfileName(const QString &projectName, const QString &path); |
411 | 82 | private: | 82 | private: |
FAILED: Continuous integration, rev:473 /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/58/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/5777/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/58/ rebuild
https:/