Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/runhtml into lp:qtcreator-plugin-ubuntu

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 214
Merged at revision: 212
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/runhtml
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 2667 lines (+1248/-571)
35 files modified
debian/control (+1/-0)
share/qtcreator/templates/wizards/ubuntu/html5-simple/wizard.xml (+1/-1)
share/qtcreator/templates/wizards/ubuntu/simple/wizard.xml (+1/-1)
share/qtcreator/templates/wizards/ubuntu/tabs/wizard.xml (+1/-1)
share/qtcreator/templates/wizards/ubuntu/webapp/wizard.xml (+1/-1)
share/qtcreator/ubuntu/menu.json (+21/-17)
src/plugin.pri (+1/-0)
src/ubuntu/ubuntu.pro (+8/-2)
src/ubuntu/ubuntuclickmanifest.cpp (+7/-4)
src/ubuntu/ubuntuclicktool.cpp (+139/-37)
src/ubuntu/ubuntuclicktool.h (+3/-2)
src/ubuntu/ubuntucmakemakestep.cpp (+3/-29)
src/ubuntu/ubuntuconstants.h (+2/-1)
src/ubuntu/ubuntudeploystepfactory.cpp (+138/-0)
src/ubuntu/ubuntudeploystepfactory.h (+29/-0)
src/ubuntu/ubuntudirectuploadstep.cpp (+134/-0)
src/ubuntu/ubuntudirectuploadstep.h (+46/-0)
src/ubuntu/ubuntuhtmlbuildconfiguration.cpp (+202/-0)
src/ubuntu/ubuntuhtmlbuildconfiguration.h (+71/-0)
src/ubuntu/ubuntulocalrunconfiguration.cpp (+17/-1)
src/ubuntu/ubuntulocalrunconfigurationfactory.cpp (+45/-67)
src/ubuntu/ubuntupackagestep.cpp (+126/-47)
src/ubuntu/ubuntupackagestep.h (+1/-0)
src/ubuntu/ubuntupackagingwidget.cpp (+88/-37)
src/ubuntu/ubuntupackagingwidget.h (+9/-2)
src/ubuntu/ubuntuplugin.cpp (+9/-3)
src/ubuntu/ubuntuproject.cpp (+67/-13)
src/ubuntu/ubuntuproject.h (+16/-1)
src/ubuntu/ubuntuprojectapplicationwizard.cpp (+14/-1)
src/ubuntu/ubuntuprojectapplicationwizard.h (+2/-1)
src/ubuntu/ubunturemotedeployconfiguration.cpp (+13/-240)
src/ubuntu/ubunturemotedeployconfiguration.h (+0/-54)
src/ubuntu/ubunturemoterunconfiguration.cpp (+29/-8)
src/ubuntu/ubunturemoterunconfiguration.h (+2/-0)
tests/manifest/manifest.pro (+1/-0)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/runhtml
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+226821@code.launchpad.net

Commit message

- Adding run support for HTML and webcontainer projects
- Refactored some code to make the project easier to maintain
- Remove MenuItems for HTML projects
- Fix packaging widget to work correctly for the new HTML configurations
- Adding UbuntuHtmlBuildConfiguration
- Add TargetSetupPage to the new htmlproject wizard
- Make sure trusty users get a list of available frameworks based on the
Toolchain they use
- Hardcode list of frameworks for now since click chroots are broken

Description of the change

- Adding run support for HTML and webcontainer projects
- Refactored some code to make the project easier to maintain
- Remove MenuItems for HTML projects
- Fix packaging widget to work correctly for the new HTML configurations
- Adding UbuntuHtmlBuildConfiguration
- Add TargetSetupPage to the new htmlproject wizard

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve
215. By Benjamin Zeller

Merge branch: https://code.launchpad.net/~zeller-benjamin/qtcreator-plugin-ubuntu/fixfwlist/+merge/227518

216. By Benjamin Zeller

Make sure the correct value is selected when the target is switched

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-07-04 14:22:41 +0000
3+++ debian/control 2014-07-23 14:19:54 +0000
4@@ -43,6 +43,7 @@
5 qtcreator-plugin-cmake (>= 3.1.1~),
6 qtcreator-plugin-remotelinux (>= 3.1.1~),
7 qtdeclarative5-controls-plugin,
8+ webapp-container,
9 # Only for unity8-supported archs
10 unity-scope-tool [i386 amd64 armhf],
11 ${shlibs:Depends},
12
13=== modified file 'share/qtcreator/templates/wizards/ubuntu/html5-simple/wizard.xml'
14--- share/qtcreator/templates/wizards/ubuntu/html5-simple/wizard.xml 2014-07-10 13:20:17 +0000
15+++ share/qtcreator/templates/wizards/ubuntu/html5-simple/wizard.xml 2014-07-23 14:19:54 +0000
16@@ -1,7 +1,7 @@
17 <?xml version="1.0" encoding="UTF-8"?>
18 <wizard version="1" kind="project" firstpage="10" id="UbuntuAppSimpleHtml5'" category="A.UbuntuProject"
19 platformIndependent="true"
20- class="ubuntu-project-plain"
21+ class="ubuntu-project-plain-html"
22 featuresRequired=""
23 >
24 <icon>../share/ubuntu.png</icon>
25
26=== modified file 'share/qtcreator/templates/wizards/ubuntu/simple/wizard.xml'
27--- share/qtcreator/templates/wizards/ubuntu/simple/wizard.xml 2014-07-11 10:10:16 +0000
28+++ share/qtcreator/templates/wizards/ubuntu/simple/wizard.xml 2014-07-23 14:19:54 +0000
29@@ -1,7 +1,7 @@
30 <?xml version="1.0" encoding="UTF-8"?>
31 <wizard version="1" kind="project" firstpage="10" id="UbuntuAppSimple'" category="A.UbuntuProject"
32 platformIndependent="true"
33- class="ubuntu-project-plain"
34+ class="ubuntu-project-plain-qml"
35 featuresRequired=""
36 >
37 <icon>../share/ubuntu.png</icon>
38
39=== modified file 'share/qtcreator/templates/wizards/ubuntu/tabs/wizard.xml'
40--- share/qtcreator/templates/wizards/ubuntu/tabs/wizard.xml 2014-07-10 13:20:17 +0000
41+++ share/qtcreator/templates/wizards/ubuntu/tabs/wizard.xml 2014-07-23 14:19:54 +0000
42@@ -1,7 +1,7 @@
43 <?xml version="1.0" encoding="UTF-8"?>
44 <wizard version="1" kind="project" firstpage="10" id="UbuntuAppTabs'" category="A.UbuntuProject"
45 platformIndependent="true"
46- class="ubuntu-project-plain"
47+ class="ubuntu-project-plain-qml"
48 featuresRequired=""
49 >
50 <icon>../share/ubuntu.png</icon>
51
52=== modified file 'share/qtcreator/templates/wizards/ubuntu/webapp/wizard.xml'
53--- share/qtcreator/templates/wizards/ubuntu/webapp/wizard.xml 2014-07-11 09:55:15 +0000
54+++ share/qtcreator/templates/wizards/ubuntu/webapp/wizard.xml 2014-07-23 14:19:54 +0000
55@@ -1,5 +1,5 @@
56 <?xml version="1.0" encoding="UTF-8"?>
57-<wizard version="1" kind="project" firstpage="10" id="UbuntuWebApp" category="A.UbuntuProject" platformIndependent="true" class="ubuntu-project-plain" featuresRequired="">
58+<wizard version="1" kind="project" firstpage="10" id="UbuntuWebApp" category="A.UbuntuProject" platformIndependent="true" class="ubuntu-project-plain-html" featuresRequired="">
59 <icon>../share/ubuntu.png</icon>
60 <description>Web App template, for converting a web site into a standalone application. Web Apps are restricted to using available W3C APIs only, unlike HTML5 Apps which have full platform access.</description>
61 <displayname>Web App</displayname>
62
63=== modified file 'share/qtcreator/ubuntu/menu.json'
64--- share/qtcreator/ubuntu/menu.json 2014-05-21 15:37:37 +0000
65+++ share/qtcreator/ubuntu/menu.json 2014-07-23 14:19:54 +0000
66@@ -74,20 +74,6 @@
67 ]
68 },
69 {
70- "name": "Run Application on Device",
71- "id": "Ubuntu.Build.RunHtml5",
72- "workingDirectory": "%0/..",
73- "projectRequired": true,
74- "keysequence": "Ctrl+F12",
75- "deviceRequired": true,
76- "ubuntuHtmlProjectRequired": true,
77- "saveRequired": true,
78- "context" : ["UbuntuProject.ProjectContext"],
79- "actions": [
80- "%SCRIPTDIRECTORY%/qtc_device_run_app_click %SERIALNUMBER% %FOLDERNAME% %USERNAME%@%IP% %PORT% /home/%USERNAME%/dev_tmp"
81- ]
82- },
83- {
84 "name": "Close Application on Device",
85 "id": "Ubuntu.Build.CancelRun",
86 "keysequence": "Ctrl+Shift+F12",
87@@ -116,7 +102,7 @@
88 "workingDirectory": "%0/..",
89 "projectRequired": true,
90 "deviceRequired": true,
91- "context": ["QmlProject.ProjectContext","UbuntuProject.ProjectContext"],
92+ "context": ["QmlProject.ProjectContext"],
93 "saveRequired": true,
94 "actions": [
95 "%SCRIPTDIRECTORY%/qtc_project_click_createanddeploy %SERIALNUMBER% %FOLDERNAME% %USERNAME%@%IP% %PORT% /home/%USERNAME%/dev_tmp %USERNAME%"
96@@ -124,6 +110,24 @@
97 },
98 {
99 "name": "Install Application on Device",
100+ "id": "Ubuntu.Build.PackageInstall.Html",
101+ "workingDirectory": "%0/..",
102+ "projectRequired": true,
103+ "deviceRequired": true,
104+ "context": ["UbuntuProject.ProjectContext"],
105+ "saveRequired": true,
106+ "actions": [
107+ {
108+ "metacall": {
109+ "method":"requestBuildAndInstallProject",
110+ "args":[]
111+ }
112+ }
113+ ]
114+ },
115+
116+ {
117+ "name": "Install Application on Device",
118 "id": "Ubuntu.Build.PackageInstall.CMake",
119 "workingDirectory": "%0/..",
120 "projectRequired": true,
121@@ -138,8 +142,8 @@
122 }
123 }
124 ]
125- },
126- {
127+ },
128+ {
129 "name": "Install Application on Device",
130 "id": "Ubuntu.Build.PackageInstall.Go",
131 "workingDirectory": "%0/..",
132
133=== modified file 'src/plugin.pri'
134--- src/plugin.pri 2014-07-01 10:09:49 +0000
135+++ src/plugin.pri 2014-07-23 14:19:54 +0000
136@@ -17,6 +17,7 @@
137 DEFINES += UBUNTU_RESOURCE_PATH_LOCAL=\"$${PATHSTR}\" UBUNTU_BUILD_LOCAL
138
139 #create a link so we get our wizards in the new project wizard
140+ system("rm '$$(HOME)/.config/QtProject/qtcreator/templates'")
141 system("ln -s '$${PWD}/../share/qtcreator/templates' '$$(HOME)/.config/QtProject/qtcreator/templates'")
142 }
143
144
145=== modified file 'src/ubuntu/ubuntu.pro'
146--- src/ubuntu/ubuntu.pro 2014-07-07 06:33:37 +0000
147+++ src/ubuntu/ubuntu.pro 2014-07-23 14:19:54 +0000
148@@ -116,7 +116,10 @@
149 ubunturemoterunner.cpp \
150 abstractremoterunsupport.cpp\
151 ubuntushared.cpp \
152- ubuntupackagestep.cpp
153+ ubuntupackagestep.cpp \
154+ ubuntudeploystepfactory.cpp \
155+ ubuntudirectuploadstep.cpp \
156+ ubuntuhtmlbuildconfiguration.cpp
157
158 HEADERS += \
159 ubuntuplugin.h \
160@@ -182,5 +185,8 @@
161 ubuntudevicesignaloperation.h \
162 ubunturemoterunner.h \
163 abstractremoterunsupport.h \
164- ubuntupackagestep.h
165+ ubuntupackagestep.h \
166+ ubuntudeploystepfactory.h \
167+ ubuntudirectuploadstep.h \
168+ ubuntuhtmlbuildconfiguration.h
169
170
171=== modified file 'src/ubuntu/ubuntuclickmanifest.cpp'
172--- src/ubuntu/ubuntuclickmanifest.cpp 2014-06-17 10:21:20 +0000
173+++ src/ubuntu/ubuntuclickmanifest.cpp 2014-07-23 14:19:54 +0000
174@@ -34,6 +34,7 @@
175 #include <projectexplorer/session.h>
176 #include <projectexplorer/project.h>
177 #include <projectexplorer/iprojectmanager.h>
178+#include <projectexplorer/target.h>
179
180 using namespace Ubuntu::Internal;
181
182@@ -287,20 +288,22 @@
183
184 if (fileName == QLatin1String(":/ubuntu/manifest.json.template")) {
185
186- QString mimeType = ProjectExplorer::SessionManager::startupProject()->projectManager()->mimeType();
187- QString proName = ProjectExplorer::SessionManager::startupProject()->projectFilePath();
188+
189+ ProjectExplorer::Project *proj = ProjectExplorer::SessionManager::startupProject();
190+ QString mimeType = proj->projectManager()->mimeType();
191+ QString proName = proj->projectFilePath();
192
193 bool isUbuntuProject = (mimeType == QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE));
194 bool isUbuntuHtmlProject = proName.endsWith(QLatin1String(Constants::UBUNTUHTMLPROJECT_SUFFIX));
195
196 QString defFramework;
197 if(isUbuntuProject && isUbuntuHtmlProject) {
198- defFramework = UbuntuClickTool::getMostRecentFramework(QLatin1String("html"));
199+ defFramework = UbuntuClickTool::getMostRecentFramework(QLatin1String("html"),UbuntuClickTool::clickTargetFromTarget(proj->activeTarget()));
200
201 if(defFramework.isEmpty())
202 defFramework = QLatin1String(Constants::UBUNTU_DEFAULT_HTML_FRAMEWORK);
203 } else {
204- defFramework = UbuntuClickTool::getMostRecentFramework(QLatin1String("qml"));
205+ defFramework = UbuntuClickTool::getMostRecentFramework(QLatin1String("qml"),UbuntuClickTool::clickTargetFromTarget(proj->activeTarget()));
206
207 if(defFramework.isEmpty())
208 defFramework = QLatin1String(Constants::UBUNTU_DEFAULT_QML_FRAMEWORK);
209
210=== modified file 'src/ubuntu/ubuntuclicktool.cpp'
211--- src/ubuntu/ubuntuclicktool.cpp 2014-07-07 06:56:31 +0000
212+++ src/ubuntu/ubuntuclicktool.cpp 2014-07-23 14:19:54 +0000
213@@ -20,6 +20,7 @@
214 #include "ubuntuclickmanifest.h"
215 #include "ubuntuconstants.h"
216 #include "ubuntushared.h"
217+#include "clicktoolchain.h"
218
219 #include <QRegularExpression>
220 #include <QDir>
221@@ -44,6 +45,7 @@
222 #include <projectexplorer/target.h>
223 #include <projectexplorer/project.h>
224 #include <projectexplorer/buildconfiguration.h>
225+#include <projectexplorer/kitinformation.h>
226 #include <utils/qtcprocess.h>
227 #include <utils/environment.h>
228 #include <utils/consoleprocess.h>
229@@ -96,21 +98,21 @@
230 {
231 QString arguments;
232 switch (mode) {
233- case Upgrade:
234- params->setCommand(QLatin1String(Constants::UBUNTU_CLICK_BINARY));
235- arguments = QString::fromLatin1(Constants::UBUNTU_CLICK_CHROOT_UPGRADE_ARGS)
236- .arg(target.architecture)
237- .arg(target.framework)
238- .arg(target.series);
239- break;
240- case Delete:
241- params->setCommand(QLatin1String(Constants::UBUNTU_SUDO_BINARY));
242- arguments = QString::fromLatin1(Constants::UBUNTU_CLICK_CHROOT_DESTROY_ARGS)
243- .arg(Constants::UBUNTU_SCRIPTPATH)
244- .arg(target.architecture)
245- .arg(target.framework)
246- .arg(target.series);
247- break;
248+ case Upgrade:
249+ params->setCommand(QLatin1String(Constants::UBUNTU_CLICK_BINARY));
250+ arguments = QString::fromLatin1(Constants::UBUNTU_CLICK_CHROOT_UPGRADE_ARGS)
251+ .arg(target.architecture)
252+ .arg(target.framework)
253+ .arg(target.series);
254+ break;
255+ case Delete:
256+ params->setCommand(QLatin1String(Constants::UBUNTU_SUDO_BINARY));
257+ arguments = QString::fromLatin1(Constants::UBUNTU_CLICK_CHROOT_DESTROY_ARGS)
258+ .arg(Constants::UBUNTU_SCRIPTPATH)
259+ .arg(target.architecture)
260+ .arg(target.framework)
261+ .arg(target.series);
262+ break;
263 }
264
265
266@@ -190,27 +192,101 @@
267 * \brief UbuntuClickTool::getSupportedFrameworks
268 * returns all available frameworks on the host system
269 */
270-QStringList UbuntuClickTool::getSupportedFrameworks()
271+QStringList UbuntuClickTool::getSupportedFrameworks(const UbuntuClickTool::Target *target)
272 {
273- QStringList items;
274- QDir frameworksDir(QLatin1String(Constants::UBUNTU_CLICK_FRAMEWORKS_BASEPATH));
275-
276- if(!frameworksDir.exists())
277- return items;
278-
279- QStringList availableFrameworkFiles = frameworksDir.entryList(QStringList()<<QLatin1String("*.framework"),
280- QDir::Files | QDir::NoDotAndDotDot,
281- QDir::Name | QDir::Reversed);
282-
283- QStringList availableFrameworks;
284- foreach(QString fw, availableFrameworkFiles) {
285- fw.replace(QLatin1String(".framework"),QString());
286- availableFrameworks.append(fw);
287- }
288-
289- if(debug) qDebug()<<"Available Frameworks on the host"<<availableFrameworks;
290- return availableFrameworks;
291-
292+#if 0
293+ QProcess proc;
294+ proc.setProgram(QStringLiteral("click"));
295+
296+ QStringList args;
297+ if (target) {
298+ args << QStringLiteral("chroot")
299+ << QStringLiteral("-a")
300+ << target->architecture
301+ << QStringLiteral("-f")
302+ << target->framework
303+ << QStringLiteral("run")
304+ << QStringLiteral("click");
305+ }
306+ args << QStringLiteral("framework")
307+ << QStringLiteral("list");
308+
309+ if(debug) qDebug()<<"click"<<Utils::QtcProcess::joinArgs(args);
310+ proc.setArguments(args);
311+ proc.start();
312+ if (!proc.waitForFinished()) {
313+ proc.kill();
314+ return QStringList();
315+ }
316+
317+ if(proc.exitCode() != 0 || proc.exitStatus() != QProcess::NormalExit)
318+ return QStringList();
319+
320+ QStringList allFws = QString::fromLocal8Bit(proc.readAllStandardOutput()).split(QStringLiteral("\n"),QString::SkipEmptyParts);
321+
322+ //reverse the list
323+ QStringList result;
324+ result.reserve( allFws.size() );
325+ std::reverse_copy( allFws.begin(), allFws.end(), std::back_inserter( result ) );
326+
327+ return result;
328+#endif
329+
330+ if (!target) {
331+ QStringList items;
332+ QDir frameworksDir(QLatin1String(Constants::UBUNTU_CLICK_FRAMEWORKS_BASEPATH));
333+
334+ if(!frameworksDir.exists())
335+ return items;
336+
337+ QStringList availableFrameworkFiles = frameworksDir.entryList(QStringList()<<QLatin1String("*.framework"),
338+ QDir::Files | QDir::NoDotAndDotDot,
339+ QDir::Name | QDir::Reversed);
340+
341+ QStringList availableFrameworks;
342+ foreach(QString fw, availableFrameworkFiles) {
343+ fw.replace(QLatin1String(".framework"),QString());
344+ availableFrameworks.append(fw);
345+ }
346+
347+ if(debug) qDebug()<<"Available Frameworks on the host"<<availableFrameworks;
348+ return availableFrameworks;
349+ } else {
350+ //hardcode for now, click chroots are broken, click is not installed and even if its installed
351+ //it does not show any valid informations
352+ if(target->majorVersion == 14 && target->minorVersion == 10) {
353+ return QStringList() << QStringLiteral("ubuntu-sdk-14.10-qml-dev3")
354+ << QStringLiteral("ubuntu-sdk-14.10-qml-dev2")
355+ << QStringLiteral("ubuntu-sdk-14.10-qml-dev1")
356+ << QStringLiteral("ubuntu-sdk-14.10-papi-dev2")
357+ << QStringLiteral("ubuntu-sdk-14.10-papi-dev1")
358+ << QStringLiteral("ubuntu-sdk-14.10-html-dev2")
359+ << QStringLiteral("ubuntu-sdk-14.10-html-dev1")
360+ << QStringLiteral("ubuntu-sdk-14.10-dev2")
361+ << QStringLiteral("ubuntu-sdk-14.10-dev1")
362+ << QStringLiteral("ubuntu-sdk-14.04")
363+ << QStringLiteral("ubuntu-sdk-14.04-qml")
364+ << QStringLiteral("ubuntu-sdk-14.04-qml-dev1")
365+ << QStringLiteral("ubuntu-sdk-14.04-papi")
366+ << QStringLiteral("ubuntu-sdk-14.04-papi-dev1")
367+ << QStringLiteral("ubuntu-sdk-14.04-html")
368+ << QStringLiteral("ubuntu-sdk-14.04-html-dev1")
369+ << QStringLiteral("ubuntu-sdk-14.04-dev1")
370+ << QStringLiteral("ubuntu-sdk-13.10");
371+ } else if (target->majorVersion == 14 && target->minorVersion == 4){
372+ return QStringList() << QStringLiteral("ubuntu-sdk-14.04")
373+ << QStringLiteral("ubuntu-sdk-14.04-qml")
374+ << QStringLiteral("ubuntu-sdk-14.04-qml-dev1")
375+ << QStringLiteral("ubuntu-sdk-14.04-papi")
376+ << QStringLiteral("ubuntu-sdk-14.04-papi-dev1")
377+ << QStringLiteral("ubuntu-sdk-14.04-html")
378+ << QStringLiteral("ubuntu-sdk-14.04-html-dev1")
379+ << QStringLiteral("ubuntu-sdk-14.04-dev1")
380+ << QStringLiteral("ubuntu-sdk-13.10");
381+ } else {
382+ return QStringList() << QStringLiteral("ubuntu-sdk-13.10");
383+ }
384+ }
385 }
386
387 /*!
388@@ -231,10 +307,10 @@
389 * returns the framework with the highest number supporting the subFramework
390 * or a empty string of no framework with the given \a subFramework was found
391 */
392-QString UbuntuClickTool::getMostRecentFramework(const QString &subFramework)
393+QString UbuntuClickTool::getMostRecentFramework(const QString &subFramework, const Target *target)
394 {
395 //returned list is ordered from newest -> oldest framework
396- QStringList allFws = getSupportedFrameworks();
397+ QStringList allFws = getSupportedFrameworks(target);
398
399 QString currFw;
400 foreach(const QString &framework, allFws) {
401@@ -421,6 +497,32 @@
402 return true;
403 }
404
405+/*!
406+ * \brief UbuntuClickTool::clickTargetFromTarget
407+ * Tries to get the Click target from a projectconfiguration,
408+ * \returns 0 if nothing was found
409+ */
410+const UbuntuClickTool::Target *UbuntuClickTool::clickTargetFromTarget(ProjectExplorer::Target *t)
411+{
412+#ifndef IN_TEST_PROJECT
413+ if(!t)
414+ return 0;
415+
416+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(t->kit());
417+ if(!tc || (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)))
418+ return 0;
419+
420+ ClickToolChain *clickTc = static_cast<ClickToolChain*>(tc);
421+ if(!clickTc)
422+ return 0;
423+
424+ return &clickTc->clickTarget();
425+#else
426+ Q_UNUSED(t);
427+ return 0;
428+#endif
429+}
430+
431 QDebug operator<<(QDebug dbg, const UbuntuClickTool::Target& t)
432 {
433 dbg.nospace() << "("<<"series: "<<t.series<<" "
434
435=== modified file 'src/ubuntu/ubuntuclicktool.h'
436--- src/ubuntu/ubuntuclicktool.h 2014-06-02 09:15:55 +0000
437+++ src/ubuntu/ubuntuclicktool.h 2014-07-23 14:19:54 +0000
438@@ -71,13 +71,14 @@
439
440 static QString targetBasePath (const Target& target);
441 static bool getTargetFromUser (Target* target, const QString &framework=QString());
442- static QStringList getSupportedFrameworks ();
443- static QString getMostRecentFramework ( const QString &subFramework );
444+ static QStringList getSupportedFrameworks (const Target *target);
445+ static QString getMostRecentFramework ( const QString &subFramework, const Target *target );
446
447 static bool targetExists (const Target& target);
448 static QList<Target> listAvailableTargets (const QString &framework=QString());
449 static QPair<int,int> targetVersion (const Target& target);
450 static bool targetFromPath(const QString& targetPath, Target* tg);
451+ static const Target *clickTargetFromTarget(ProjectExplorer::Target *t);
452 };
453
454 QDebug operator<<(QDebug dbg, const UbuntuClickTool::Target& t);
455
456=== modified file 'src/ubuntu/ubuntucmakemakestep.cpp'
457--- src/ubuntu/ubuntucmakemakestep.cpp 2014-06-17 09:25:03 +0000
458+++ src/ubuntu/ubuntucmakemakestep.cpp 2014-07-23 14:19:54 +0000
459@@ -50,11 +50,6 @@
460 if(!canHandle(parent->target()))
461 return QList<Core::Id>();
462
463- if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) {
464- return QList<Core::Id>()
465- << Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID);
466- }
467-
468 return QList<Core::Id>() << Core::Id(Constants::UBUNTU_CLICK_CMAKE_MAKESTEP_ID);
469 }
470
471@@ -83,8 +78,6 @@
472 {
473 if (id == Constants::UBUNTU_CLICK_CMAKE_MAKESTEP_ID)
474 return tr("UbuntuSDK-Make", "Display name for UbuntuCMakeMakeStep id.");
475- if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID)
476- return tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id.");
477 return QString();
478 }
479
480@@ -100,11 +93,6 @@
481 if (!canCreate(parent, id))
482 return 0;
483
484- if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID) {
485- UbuntuPackageStep *step = new UbuntuPackageStep(parent);
486- return step;
487- }
488-
489 UbuntuCMakeMakeStep *step = new UbuntuCMakeMakeStep(parent);
490 if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
491 step->setUseNinja(false);
492@@ -117,11 +105,6 @@
493 bool UbuntuCMakeMakeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
494 {
495 Core::Id toRestore = ProjectExplorer::idFromMap(map);
496-
497- //backwards compatibility to older projects
498- if( toRestore == Constants::UBUNTU_DEPLOY_MAKESTEP_ID )
499- return canHandle(parent->target());
500-
501 return canCreate(parent, toRestore);
502 }
503
504@@ -131,18 +114,11 @@
505 return 0;
506
507 Core::Id toRestore = ProjectExplorer::idFromMap(map);
508-
509- //backwards compatibility to older projects
510- if( toRestore == Constants::UBUNTU_DEPLOY_MAKESTEP_ID ) {
511- UbuntuPackageStep *step = new UbuntuPackageStep(parent);
512+ ProjectExplorer::BuildStep* step = create(parent,toRestore);
513+ if(step->fromMap(map))
514 return step;
515- } else {
516- ProjectExplorer::BuildStep* step = create(parent,toRestore);
517- if(step->fromMap(map))
518- return step;
519
520- delete step;
521- }
522+ delete step;
523 return 0;
524 }
525
526@@ -158,8 +134,6 @@
527
528 if(product->id() == Core::Id(Constants::UBUNTU_CLICK_CMAKE_MAKESTEP_ID))
529 return new UbuntuCMakeMakeStep(parent, static_cast<UbuntuCMakeMakeStep *>(product));
530- else if(product->id() == Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID))
531- return new UbuntuPackageStep(parent, static_cast<UbuntuPackageStep *>(product));
532
533 QTC_ASSERT(false,return 0);
534 }
535
536=== modified file 'src/ubuntu/ubuntuconstants.h'
537--- src/ubuntu/ubuntuconstants.h 2014-06-11 13:50:09 +0000
538+++ src/ubuntu/ubuntuconstants.h 2014-07-23 14:19:54 +0000
539@@ -151,6 +151,7 @@
540 const char UBUNTUPROJECT_RUNCONTROL_ID[] = "UbuntuProjectManager.UbuntuRunConfiguration";
541
542 const char UBUNTUHTML_PROJECT_LAUNCHER_EXE[] = "ubuntu-html5-app-launcher";
543+const char UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE[] = "webapp-container";
544 const char UBUNTUSCOPES_PROJECT_LAUNCHER_EXE[] = "unity-scope-tool";
545
546 const char UBUNTU_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Ubuntu");
547@@ -508,7 +509,7 @@
548 const char UBUNTU_CLICK_CMAKE_WRAPPER[] = "%0/qtc_chroot_cmake2";
549 const char UBUNTU_CLICK_MAKE_WRAPPER[] = "%0/qtc_chroot_make2";
550 const char UBUNTU_CLICK_GCC_WRAPPER[] = "%0/qtc_chroot_gcc";
551-
552+const char UBUNTU_CLICK_HTML_BC_ID[] = "UbuntuProjectManager.UbuntuHTML5.BuildConfiguration";
553 //Devicesupport
554 const char UBUNTU_DEVICE_TYPE_ID[] = "UbuntuProjectManager.DeviceTypeId";
555 const char UBUNTU_DEVICE_SSHIDENTITY[] = "%0/.config/ubuntu-sdk/ubuntudevice_id_rsa";
556
557=== added file 'src/ubuntu/ubuntudeploystepfactory.cpp'
558--- src/ubuntu/ubuntudeploystepfactory.cpp 1970-01-01 00:00:00 +0000
559+++ src/ubuntu/ubuntudeploystepfactory.cpp 2014-07-23 14:19:54 +0000
560@@ -0,0 +1,138 @@
561+#include "ubuntudeploystepfactory.h"
562+#include "ubuntuprojectguesser.h"
563+#include "ubuntuconstants.h"
564+#include "ubuntudirectuploadstep.h"
565+#include "ubuntupackagestep.h"
566+
567+#include <utils/qtcassert.h>
568+
569+#include <projectexplorer/buildstep.h>
570+#include <projectexplorer/buildsteplist.h>
571+#include <projectexplorer/kitinformation.h>
572+#include <projectexplorer/target.h>
573+#include <projectexplorer/project.h>
574+#include <projectexplorer/toolchain.h>
575+#include <projectexplorer/projectexplorerconstants.h>
576+
577+#include <qmlprojectmanager/qmlprojectconstants.h>
578+
579+#include <cmakeprojectmanager/cmakeprojectconstants.h>
580+
581+namespace Ubuntu {
582+namespace Internal {
583+
584+QList<Core::Id> UbuntuDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
585+{
586+ QList<Core::Id> types;
587+
588+ if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
589+ return types;
590+
591+ Core::Id targetDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit());
592+ if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && targetDevice != Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID)
593+ return types;
594+
595+ bool isRemote = targetDevice == Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID;
596+ bool isCMake = parent->target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
597+ bool isHTML = parent->target()->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
598+ //bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
599+
600+ if (isRemote) {
601+ //IF we have a remote device we just support a ubuntu toolchain
602+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->target()->kit());
603+ if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
604+ return types;
605+ }
606+
607+ if(isRemote && isCMake && !UbuntuProjectGuesser::isScopesProject(parent->target()->project()))
608+ types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID
609+ << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;
610+ else if(isRemote && isHTML)
611+ types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID
612+ << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;
613+
614+ return types;
615+}
616+
617+QString UbuntuDeployStepFactory::displayNameForId(const Core::Id id) const
618+{
619+ if (id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
620+ return UbuntuDirectUploadStep::displayName();
621+ else if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID)
622+ return tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id.");
623+ return QString();
624+}
625+
626+bool UbuntuDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
627+{
628+ return availableCreationIds(parent).contains(id);
629+}
630+
631+ProjectExplorer::BuildStep *UbuntuDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
632+{
633+ if (!canCreate(parent, id))
634+ return 0;
635+
636+ if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
637+ return new UbuntuDirectUploadStep(parent);
638+ else if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID) {
639+ UbuntuPackageStep *step = new UbuntuPackageStep(parent);
640+ return step;
641+ }
642+
643+ return 0;
644+}
645+
646+bool UbuntuDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
647+{
648+ Core::Id toRestore = ProjectExplorer::idFromMap(map);
649+
650+ //backwards compatibility to older projects
651+ if( toRestore == Constants::UBUNTU_DEPLOY_MAKESTEP_ID )
652+ return canCreate(parent,Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID));
653+
654+ return canCreate(parent,toRestore);
655+}
656+
657+ProjectExplorer::BuildStep *UbuntuDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
658+{
659+ Core::Id id = ProjectExplorer::idFromMap(map);
660+ if(!canCreate(parent,id))
661+ return 0;
662+
663+ //backwards compatibility to older projects
664+ if( id == Constants::UBUNTU_DEPLOY_MAKESTEP_ID ) {
665+ UbuntuPackageStep *step = new UbuntuPackageStep(parent);
666+ return step;
667+ }
668+
669+ ProjectExplorer::BuildStep* step = create(parent,id);
670+ if (!step->fromMap(map)) {
671+ delete step;
672+ return 0;
673+ }
674+
675+ return step;
676+}
677+
678+bool UbuntuDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
679+{
680+ return canCreate(parent,product->id());
681+}
682+
683+ProjectExplorer::BuildStep *UbuntuDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
684+{
685+ if (!canClone(parent, product))
686+ return 0;
687+
688+ const Core::Id id = product->id();
689+ if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
690+ return new UbuntuDirectUploadStep(parent, static_cast<UbuntuDirectUploadStep *>(product));
691+ else if(id == Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID))
692+ return new UbuntuPackageStep(parent, static_cast<UbuntuPackageStep *>(product));
693+
694+ return 0;
695+}
696+
697+} // namespace Internal
698+} // namespace Ubuntu
699
700=== added file 'src/ubuntu/ubuntudeploystepfactory.h'
701--- src/ubuntu/ubuntudeploystepfactory.h 1970-01-01 00:00:00 +0000
702+++ src/ubuntu/ubuntudeploystepfactory.h 2014-07-23 14:19:54 +0000
703@@ -0,0 +1,29 @@
704+#ifndef UBUNTU_INTERNAL_UBUNTUDEPLOYSTEPFACTORY_H
705+#define UBUNTU_INTERNAL_UBUNTUDEPLOYSTEPFACTORY_H
706+
707+#include <projectexplorer/buildstep.h>
708+#include <projectexplorer/abstractprocessstep.h>
709+
710+namespace Ubuntu {
711+namespace Internal {
712+
713+class UbuntuDeployStepFactory : public ProjectExplorer::IBuildStepFactory
714+{
715+ Q_OBJECT
716+
717+public:
718+ // IBuildStepFactory interface
719+ virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;
720+ virtual QString displayNameForId(const Core::Id id) const override;
721+ virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
722+ virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
723+ virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
724+ virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
725+ virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
726+ virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
727+};
728+
729+} // namespace Internal
730+} // namespace Ubuntu
731+
732+#endif // UBUNTU_INTERNAL_UBUNTUDEPLOYSTEPFACTORY_H
733
734=== added file 'src/ubuntu/ubuntudirectuploadstep.cpp'
735--- src/ubuntu/ubuntudirectuploadstep.cpp 1970-01-01 00:00:00 +0000
736+++ src/ubuntu/ubuntudirectuploadstep.cpp 2014-07-23 14:19:54 +0000
737@@ -0,0 +1,134 @@
738+#include "ubuntudirectuploadstep.h"
739+#include "ubuntupackagestep.h"
740+#include "ubuntuconstants.h"
741+
742+#include <utils/qtcassert.h>
743+#include <projectexplorer/deployablefile.h>
744+#include <projectexplorer/target.h>
745+#include <projectexplorer/project.h>
746+
747+#include <remotelinux/genericdirectuploadservice.h>
748+#include <remotelinux/remotelinuxdeployconfiguration.h>
749+
750+#include <QFileInfo>
751+
752+namespace Ubuntu {
753+namespace Internal {
754+
755+enum {
756+ debug = 0
757+};
758+
759+UbuntuDirectUploadStep::UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl)
760+ : AbstractRemoteLinuxDeployStep(bsl, UbuntuDirectUploadStep::stepId())
761+ , m_deployService(new RemoteLinux::GenericDirectUploadService(this))
762+{
763+ setDefaultDisplayName(displayName());
764+}
765+
766+UbuntuDirectUploadStep::UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl, UbuntuDirectUploadStep *other)
767+ : AbstractRemoteLinuxDeployStep(bsl, other)
768+ , m_deployService(new RemoteLinux::GenericDirectUploadService(this))
769+{
770+ setDefaultDisplayName(displayName());
771+
772+ connect(target()->project(),SIGNAL(displayNameChanged()),this,SLOT(projectNameChanged()));
773+ connect(target(),SIGNAL(applicationTargetsChanged()),this,SLOT(projectNameChanged()));
774+}
775+
776+UbuntuDirectUploadStep::~UbuntuDirectUploadStep()
777+{
778+}
779+
780+void UbuntuDirectUploadStep::run(QFutureInterface<bool> &fi)
781+{
782+ m_foundClickPackage = false;
783+ projectNameChanged();
784+ if(!m_foundClickPackage) {
785+ emit addOutput(tr("Deploy step failed. No click package was created"), ErrorMessageOutput);
786+ fi.reportResult(false);
787+ emit finished();
788+ return;
789+ }
790+
791+
792+ m_deployService->setIncrementalDeployment(false);
793+ m_deployService->setIgnoreMissingFiles(false);
794+
795+ QString whyNot;
796+ if(!deployService()->isDeploymentPossible(&whyNot)) {
797+ emit addOutput(tr("Deploy step failed. %1").arg(whyNot), ErrorMessageOutput);
798+ fi.reportResult(false);
799+ emit finished();
800+ return;
801+ }
802+
803+ AbstractRemoteLinuxDeployStep::run(fi);
804+}
805+
806+ProjectExplorer::BuildStepConfigWidget *UbuntuDirectUploadStep::createConfigWidget()
807+{
808+ return new ProjectExplorer::SimpleBuildStepConfigWidget(this);
809+}
810+
811+bool UbuntuDirectUploadStep::initInternal(QString *error)
812+{
813+ Q_UNUSED(error)
814+ return true;
815+}
816+
817+RemoteLinux::AbstractRemoteLinuxDeployService *UbuntuDirectUploadStep::deployService() const
818+{
819+ return m_deployService;
820+}
821+
822+bool UbuntuDirectUploadStep::fromMap(const QVariantMap &map)
823+{
824+ if (!AbstractRemoteLinuxDeployStep::fromMap(map))
825+ return false;
826+ return true;
827+}
828+
829+QVariantMap UbuntuDirectUploadStep::toMap() const
830+{
831+ return AbstractRemoteLinuxDeployStep::toMap();
832+}
833+
834+
835+Core::Id UbuntuDirectUploadStep::stepId()
836+{
837+ return Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID;
838+}
839+
840+QString UbuntuDirectUploadStep::displayName()
841+{
842+ return tr("Upload files to Ubuntu Device");
843+}
844+
845+void UbuntuDirectUploadStep::projectNameChanged()
846+{
847+ if(debug) qDebug()<<"------------------------ Updating DEPLOYLIST ---------------------------";
848+
849+ ProjectExplorer::BuildStepList *bsList = deployConfiguration()->stepList();
850+
851+ QList<ProjectExplorer::DeployableFile> list;
852+ foreach(ProjectExplorer::BuildStep *currStep ,bsList->steps()) {
853+ UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(currStep);
854+ if(!pckStep)
855+ continue;
856+
857+ QFileInfo info(pckStep->packagePath());
858+ if(info.exists()) {
859+ list.append(ProjectExplorer::DeployableFile(info.filePath(),
860+ QStringLiteral("/tmp")));
861+
862+ list.append(ProjectExplorer::DeployableFile(QStringLiteral("%1/qtc_device_applaunch.py").arg(Constants::UBUNTU_SCRIPTPATH),
863+ QStringLiteral("/tmp")));
864+ m_deployService->setDeployableFiles(list);
865+ m_foundClickPackage = true;
866+ break;
867+ }
868+ }
869+}
870+} // namespace Internal
871+} // namespace Ubuntu
872
873=== added file 'src/ubuntu/ubuntudirectuploadstep.h'
874--- src/ubuntu/ubuntudirectuploadstep.h 1970-01-01 00:00:00 +0000
875+++ src/ubuntu/ubuntudirectuploadstep.h 2014-07-23 14:19:54 +0000
876@@ -0,0 +1,46 @@
877+#ifndef UBUNTU_INTERNAL_UBUNTUDIRECTUPLOADSTEP_H
878+#define UBUNTU_INTERNAL_UBUNTUDIRECTUPLOADSTEP_H
879+
880+#include <remotelinux/abstractremotelinuxdeploystep.h>
881+
882+namespace RemoteLinux {
883+class GenericDirectUploadService;
884+}
885+
886+namespace Ubuntu {
887+namespace Internal {
888+
889+class UbuntuDirectUploadStep : public RemoteLinux::AbstractRemoteLinuxDeployStep
890+{
891+ Q_OBJECT
892+
893+public:
894+ UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl);
895+ UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl, UbuntuDirectUploadStep *other);
896+ ~UbuntuDirectUploadStep();
897+
898+ // BuildStep interface
899+ virtual void run(QFutureInterface<bool> &fi) override;
900+
901+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
902+ bool initInternal(QString *error = 0) override;
903+
904+ RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const override;
905+ bool fromMap(const QVariantMap &map) override;
906+ QVariantMap toMap() const override;
907+
908+ static Core::Id stepId();
909+ static QString displayName();
910+
911+private slots:
912+ void projectNameChanged();
913+
914+private:
915+ RemoteLinux::GenericDirectUploadService *m_deployService;
916+ bool m_foundClickPackage;
917+};
918+
919+} // namespace Internal
920+} // namespace Ubuntu
921+
922+#endif // UBUNTU_INTERNAL_UBUNTUDIRECTUPLOADSTEP_H
923
924=== added file 'src/ubuntu/ubuntuhtmlbuildconfiguration.cpp'
925--- src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 1970-01-01 00:00:00 +0000
926+++ src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 2014-07-23 14:19:54 +0000
927@@ -0,0 +1,202 @@
928+#include "ubuntuhtmlbuildconfiguration.h"
929+#include "ubuntuconstants.h"
930+#include "ubuntuproject.h"
931+
932+#include <coreplugin/mimedatabase.h>
933+
934+#include <projectexplorer/target.h>
935+#include <projectexplorer/project.h>
936+#include <projectexplorer/buildinfo.h>
937+#include <projectexplorer/kit.h>
938+#include <utils/fancylineedit.h>
939+
940+#include <QFormLayout>
941+
942+namespace Ubuntu {
943+namespace Internal {
944+
945+/*!
946+ * \class UbuntuHtmlBuildConfiguration
947+ *
948+ * Even though HTML projects don't need to be built, we need
949+ * that BuildConfiguration to store the Builddirectory (where the click
950+ * package goes) and to enable the Target page to show us some actual
951+ * targets
952+ */
953+
954+UbuntuHtmlBuildConfiguration::UbuntuHtmlBuildConfiguration(ProjectExplorer::Target *target)
955+ : BuildConfiguration(target,Constants::UBUNTU_CLICK_HTML_BC_ID)
956+{
957+}
958+
959+UbuntuHtmlBuildConfiguration::UbuntuHtmlBuildConfiguration(ProjectExplorer::Target *target, UbuntuHtmlBuildConfiguration *source)
960+ : BuildConfiguration(target,source)
961+{
962+
963+}
964+
965+bool UbuntuHtmlBuildConfiguration::fromMap(const QVariantMap &map)
966+{
967+ return BuildConfiguration::fromMap(map);
968+}
969+
970+QVariantMap UbuntuHtmlBuildConfiguration::toMap() const
971+{
972+ return BuildConfiguration::toMap();
973+}
974+
975+ProjectExplorer::NamedWidget *UbuntuHtmlBuildConfiguration::createConfigWidget()
976+{
977+ return new UbuntuHtmlBuildSettingsWidget(this);
978+}
979+
980+ProjectExplorer::BuildConfiguration::BuildType UbuntuHtmlBuildConfiguration::buildType() const
981+{
982+ return Release;
983+}
984+
985+UbuntuHtmlBuildConfigurationFactory::UbuntuHtmlBuildConfigurationFactory(QObject *parent)
986+ : IBuildConfigurationFactory(parent)
987+{
988+
989+}
990+
991+UbuntuHtmlBuildConfigurationFactory::~UbuntuHtmlBuildConfigurationFactory()
992+{
993+
994+}
995+
996+int UbuntuHtmlBuildConfigurationFactory::priority(const ProjectExplorer::Target *parent) const
997+{
998+ if (canHandle(parent))
999+ return 100;
1000+ return -1;
1001+}
1002+
1003+QList<ProjectExplorer::BuildInfo *> UbuntuHtmlBuildConfigurationFactory::availableBuilds(const ProjectExplorer::Target *parent) const
1004+{
1005+ if(!canHandle(parent))
1006+ return QList<ProjectExplorer::BuildInfo *>();
1007+ return createBuildInfos(parent->kit(),parent->project()->projectFilePath());
1008+}
1009+
1010+int UbuntuHtmlBuildConfigurationFactory::priority(const ProjectExplorer::Kit *k, const QString &projectPath) const
1011+{
1012+ return (k && Core::MimeDatabase::findByFile(QFileInfo(projectPath))
1013+ .matchesType(QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE))) ? 100 : -1;
1014+}
1015+
1016+QList<ProjectExplorer::BuildInfo *> UbuntuHtmlBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const
1017+{
1018+ UbuntuKitMatcher m;
1019+ if(priority(k,projectPath) < 0 || !m.matches(k))
1020+ return QList<ProjectExplorer::BuildInfo *>();
1021+
1022+ return createBuildInfos(k,projectPath);
1023+}
1024+
1025+UbuntuHtmlBuildConfiguration *UbuntuHtmlBuildConfigurationFactory::create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const
1026+{
1027+ QTC_ASSERT(info->factory() == this, return 0);
1028+ QTC_ASSERT(info->kitId == parent->kit()->id(), return 0);
1029+ QTC_ASSERT(!info->displayName.isEmpty(), return 0);
1030+
1031+ UbuntuHtmlBuildConfiguration *conf = new UbuntuHtmlBuildConfiguration(parent);
1032+ conf->setBuildDirectory(info->buildDirectory);
1033+ conf->setDefaultDisplayName(info->displayName);
1034+ conf->setDisplayName(info->displayName);
1035+
1036+ return conf;
1037+}
1038+
1039+bool UbuntuHtmlBuildConfigurationFactory::canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const
1040+{
1041+ if (!canHandle(parent))
1042+ return false;
1043+ return ProjectExplorer::idFromMap(map) == Constants::UBUNTU_CLICK_HTML_BC_ID;
1044+}
1045+
1046+UbuntuHtmlBuildConfiguration *UbuntuHtmlBuildConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
1047+{
1048+ if (!canRestore(parent,map) )
1049+ return 0;
1050+
1051+ UbuntuHtmlBuildConfiguration *conf = new UbuntuHtmlBuildConfiguration(parent);
1052+ if (conf->fromMap(map))
1053+ return conf;
1054+
1055+ delete conf;
1056+ return 0;
1057+}
1058+
1059+bool UbuntuHtmlBuildConfigurationFactory::canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const
1060+{
1061+ if (!canHandle(parent))
1062+ return false;
1063+ if (product->id() != Constants::UBUNTU_CLICK_HTML_BC_ID )
1064+ return false;
1065+
1066+ return true;
1067+}
1068+
1069+UbuntuHtmlBuildConfiguration *UbuntuHtmlBuildConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product)
1070+{
1071+ if (!canClone(parent,product))
1072+ return 0;
1073+ return new UbuntuHtmlBuildConfiguration(parent,static_cast<UbuntuHtmlBuildConfiguration*>(product));
1074+}
1075+
1076+bool UbuntuHtmlBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) const
1077+{
1078+ UbuntuKitMatcher m;
1079+ if(!m.matches(t->kit()))
1080+ return false;
1081+
1082+ if (t->project()->projectManager()->mimeType() != QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE))
1083+ return false;
1084+
1085+ return true;
1086+}
1087+
1088+QList<ProjectExplorer::BuildInfo *> UbuntuHtmlBuildConfigurationFactory::createBuildInfos(const ProjectExplorer::Kit *k, const QString &projectDir) const
1089+{
1090+ QList<ProjectExplorer::BuildInfo *> builds;
1091+
1092+ ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
1093+ info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));
1094+ info->typeName = tr("Html5");
1095+ info->kitId = k->id();
1096+ info->supportsShadowBuild = true;
1097+ info->displayName = tr("Default");
1098+
1099+ builds << info;
1100+ return builds;
1101+}
1102+
1103+UbuntuHtmlBuildSettingsWidget::UbuntuHtmlBuildSettingsWidget(UbuntuHtmlBuildConfiguration *conf, QWidget *parent)
1104+ : NamedWidget(parent) ,
1105+ m_buildConfiguration(conf)
1106+{
1107+ QFormLayout *fl = new QFormLayout(this);
1108+ fl->setContentsMargins(20, -1, 0, -1);
1109+ fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
1110+ setLayout(fl);
1111+
1112+ m_pathChooser = new Utils::PathChooser(this);
1113+ m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
1114+ fl->addRow(tr("Build directory:"), m_pathChooser);
1115+
1116+ connect(m_pathChooser->lineEdit(),SIGNAL(editingFinished()),this,SLOT(onBuilddirChanged()));
1117+ connect(m_buildConfiguration,SIGNAL(buildDirectoryChanged()),this,SLOT(updateBuildDirectory()));
1118+}
1119+
1120+void UbuntuHtmlBuildSettingsWidget::updateBuildDirectory() const
1121+{
1122+ m_pathChooser->blockSignals(true);
1123+ m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
1124+ m_pathChooser->blockSignals(false);
1125+}
1126+
1127+
1128+} // namespace Internal
1129+} // namespace Ubuntu
1130
1131=== added file 'src/ubuntu/ubuntuhtmlbuildconfiguration.h'
1132--- src/ubuntu/ubuntuhtmlbuildconfiguration.h 1970-01-01 00:00:00 +0000
1133+++ src/ubuntu/ubuntuhtmlbuildconfiguration.h 2014-07-23 14:19:54 +0000
1134@@ -0,0 +1,71 @@
1135+#ifndef UBUNTU_INTERNAL_UBUNTUHTMLBUILDCONFIGURATION_H
1136+#define UBUNTU_INTERNAL_UBUNTUHTMLBUILDCONFIGURATION_H
1137+
1138+#include <projectexplorer/buildconfiguration.h>
1139+#include <utils/pathchooser.h>
1140+#include <projectexplorer/namedwidget.h>
1141+
1142+namespace Ubuntu {
1143+namespace Internal {
1144+
1145+class UbuntuHtmlBuildConfiguration : public ProjectExplorer::BuildConfiguration
1146+{
1147+ Q_OBJECT
1148+
1149+public:
1150+ UbuntuHtmlBuildConfiguration(ProjectExplorer::Target *target);
1151+ UbuntuHtmlBuildConfiguration(ProjectExplorer::Target *target, UbuntuHtmlBuildConfiguration *source);
1152+
1153+ // ProjectConfiguration interface
1154+ virtual bool fromMap(const QVariantMap &map) override;
1155+ virtual QVariantMap toMap() const override;
1156+
1157+ // BuildConfiguration interface
1158+ virtual ProjectExplorer::NamedWidget *createConfigWidget() override;
1159+ virtual BuildType buildType() const override;
1160+
1161+private:
1162+ friend class UbuntuHtmlBuildConfigurationFactory;
1163+};
1164+
1165+class UbuntuHtmlBuildSettingsWidget : public ProjectExplorer::NamedWidget
1166+{
1167+ Q_OBJECT
1168+
1169+public:
1170+ explicit UbuntuHtmlBuildSettingsWidget(UbuntuHtmlBuildConfiguration *conf, QWidget *parent = 0);
1171+
1172+private slots:
1173+ void updateBuildDirectory () const;
1174+
1175+private:
1176+ Utils::PathChooser *m_pathChooser;
1177+ UbuntuHtmlBuildConfiguration *m_buildConfiguration;
1178+};
1179+
1180+class UbuntuHtmlBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
1181+{
1182+ Q_OBJECT
1183+public:
1184+ UbuntuHtmlBuildConfigurationFactory(QObject *parent = 0);
1185+ ~UbuntuHtmlBuildConfigurationFactory();
1186+
1187+ // IBuildConfigurationFactory interface
1188+ virtual int priority(const ProjectExplorer::Target *parent) const override;
1189+ virtual QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const override;
1190+ virtual int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
1191+ virtual QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
1192+ virtual UbuntuHtmlBuildConfiguration *create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const override;
1193+ virtual bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const override;
1194+ virtual UbuntuHtmlBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map) override;
1195+ virtual bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const override;
1196+ virtual UbuntuHtmlBuildConfiguration*clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) override;
1197+private:
1198+ bool canHandle(const ProjectExplorer::Target *t) const;
1199+ QList<ProjectExplorer::BuildInfo *> createBuildInfos (const ProjectExplorer::Kit *k, const QString &projectDir) const;
1200+};
1201+
1202+} // namespace Internal
1203+} // namespace Ubuntu
1204+
1205+#endif // UBUNTU_INTERNAL_UBUNTUHTMLBUILDCONFIGURATION_H
1206
1207=== modified file 'src/ubuntu/ubuntulocalrunconfiguration.cpp'
1208--- src/ubuntu/ubuntulocalrunconfiguration.cpp 2014-07-08 09:35:23 +0000
1209+++ src/ubuntu/ubuntulocalrunconfiguration.cpp 2014-07-23 14:19:54 +0000
1210@@ -20,6 +20,7 @@
1211 #include "ubuntuproject.h"
1212 #include "ubuntuprojectguesser.h"
1213 #include "ubuntuclickmanifest.h"
1214+#include "ubunturemoterunconfiguration.h"
1215
1216 #include <qtsupport/baseqtversion.h>
1217 #include <qtsupport/qtkitinformation.h>
1218@@ -177,7 +178,15 @@
1219 return desk;
1220 }
1221
1222- QDir package_dir(config->target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR));
1223+
1224+ UbuntuRemoteRunConfiguration *remConf = qobject_cast<UbuntuRemoteRunConfiguration*>(config);
1225+ if (!remConf) {
1226+ if(errorMessage)
1227+ *errorMessage = tr("Invalid configuration type");
1228+ return QString();
1229+ }
1230+
1231+ QDir package_dir(remConf->packageDir());
1232 if(!package_dir.exists()) {
1233 if(errorMessage)
1234 *errorMessage = tr("No packaging directory available, please check if the deploy configuration is correct.");
1235@@ -376,6 +385,13 @@
1236 m_executable = env.searchInPath(QString::fromLatin1(Ubuntu::Constants::UBUNTUHTML_PROJECT_LAUNCHER_EXE));
1237 m_args = QStringList()<<QString::fromLatin1("--www=%0/www").arg(ubuntuProject->projectDirectory())
1238 <<QString::fromLatin1("--inspector");
1239+ } else if (ubuntuProject->mainFile().endsWith(QStringLiteral(".desktop"), Qt::CaseInsensitive)) {
1240+ Utils::Environment env = Utils::Environment::systemEnvironment();
1241+
1242+ if(!readDesktopFile(ubuntuProject->projectDirectory()+QDir::separator()+ubuntuProject->mainFile(),&m_executable,&m_args,errorMessage))
1243+ return false;
1244+
1245+ m_executable = env.searchInPath(QString::fromLatin1(Ubuntu::Constants::UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE));
1246 } else {
1247 m_executable = QtSupport::QtKitInformation::qtVersion(target()->kit())->qmlsceneCommand();
1248 m_args = QStringList()<<QString(QLatin1String("%0.qml")).arg(ubuntuProject->displayName());
1249
1250=== modified file 'src/ubuntu/ubuntulocalrunconfigurationfactory.cpp'
1251--- src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-06-18 07:29:05 +0000
1252+++ src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-07-23 14:19:54 +0000
1253@@ -33,50 +33,59 @@
1254 using namespace Ubuntu;
1255 using namespace Ubuntu::Internal;
1256
1257-QList<Core::Id> UbuntuLocalRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const {
1258- if (!canHandle(parent))
1259- return QList<Core::Id>();
1260-
1261- QList<Core::Id> list;
1262+enum {
1263+ debug = 1
1264+};
1265+
1266+QList<Core::Id> UbuntuLocalRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
1267+{
1268+ QList<Core::Id> types;
1269+
1270+ Core::Id targetDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
1271+ if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && targetDevice != Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID) {
1272+ if(debug) qDebug()<<"Rejecting device type: "<<targetDevice.toString();
1273+ return types;
1274+ }
1275+
1276+ bool isRemote = targetDevice == Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID;
1277+ bool isCMake = parent->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
1278+ bool isHTML = parent->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
1279+ bool isApp = UbuntuProjectGuesser::isClickAppProject(parent->project());
1280+ //bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
1281+
1282+ if (!isCMake && !isHTML)
1283+ return types;
1284+
1285+ if (isRemote) {
1286+ //IF we have a remote device we just support a ubuntu toolchain
1287+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());
1288+ if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
1289+ return types;
1290+ }
1291
1292 QString manifestPath = QStringLiteral("%1/manifest.json").arg(parent->project()->projectDirectory());
1293 UbuntuClickManifest manifest;
1294
1295 //if we have no manifest, we can not query the app id's
1296- if(!manifest.load(manifestPath,parent->project()->displayName()))
1297- return list;
1298+ if(!manifest.load(manifestPath,parent->displayName()))
1299+ return types;
1300
1301 QList<UbuntuClickManifest::Hook> hooks = manifest.hooks();
1302-
1303-
1304- bool isDesktopDevice = ProjectExplorer::DeviceKitInformation::deviceId(parent->kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_ID;
1305-
1306- ProjectExplorer::IDevice::ConstPtr devPtr = ProjectExplorer::DeviceKitInformation::device(parent->kit());
1307- bool isUbuntuDevice = (devPtr.isNull() == false) && (devPtr->type() == Constants::UBUNTU_DEVICE_TYPE_ID);
1308-
1309- if(parent->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) {
1310-
1311- bool isScopes = UbuntuProjectGuesser::isScopesProject(parent->project());
1312- bool isApp = UbuntuProjectGuesser::isClickAppProject(parent->project());
1313-
1314- //the scopes project has no run on device yet, thats why finding a
1315- //scopes project will block creating any runconfigurations for the device
1316- if ( isScopes && !isDesktopDevice)
1317- return list;
1318-
1319+ if (!isRemote) {
1320 foreach (const UbuntuClickManifest::Hook &hook, hooks) {
1321- if (isUbuntuDevice && isApp) {
1322- list << UbuntuRemoteRunConfiguration::typeId().withSuffix(hook.appId);
1323- } else {
1324- list << Core::Id(Constants::UBUNTUPROJECT_RUNCONTROL_ID).withSuffix(hook.appId);
1325+ types << Core::Id(Constants::UBUNTUPROJECT_RUNCONTROL_ID).withSuffix(hook.appId);
1326+ }
1327+ }
1328+ else if (isRemote) {
1329+ //when CMake we only support App projects, scopes have no way to be controlled on the device atm
1330+ if ((isCMake && isApp) || isHTML) {
1331+ foreach (const UbuntuClickManifest::Hook &hook, hooks) {
1332+ types << UbuntuRemoteRunConfiguration::typeId().withSuffix(hook.appId);
1333 }
1334 }
1335- } else {
1336- foreach (const UbuntuClickManifest::Hook &hook, hooks) {
1337- list << Core::Id(Constants::UBUNTUPROJECT_RUNCONTROL_ID).withSuffix(hook.appId);
1338- }
1339 }
1340- return list;
1341+
1342+ return types;
1343 }
1344
1345 QString UbuntuLocalRunConfigurationFactory::displayNameForId(const Core::Id id) const
1346@@ -88,40 +97,9 @@
1347 return QString();
1348 }
1349
1350-bool UbuntuLocalRunConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const {
1351-
1352- if(qobject_cast<CMakeProjectManager::CMakeProject*>(parent->project())) {
1353- if (!parent->project()->supportsKit(parent->kit()))
1354- return false;
1355-
1356- ProjectExplorer::ToolChain *tc
1357- = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());
1358- if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
1359- return false;
1360-
1361- if(tc->type() == QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
1362- return true;
1363-
1364- bool isDesktopDevice = ProjectExplorer::DeviceKitInformation::deviceId(parent->kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_ID;
1365- if(UbuntuProjectGuesser::isScopesProject(parent->project())
1366- && isDesktopDevice)
1367- return true;
1368- else if(isDesktopDevice && UbuntuProjectGuesser::isClickAppProject(parent->project()))
1369- return true;
1370-
1371- return false;
1372- }
1373-
1374- if (!qobject_cast<UbuntuProject *>(parent->project()))
1375- return false;
1376- return true;
1377-}
1378-
1379 bool UbuntuLocalRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent,
1380- const Core::Id id) const {
1381- if (!canHandle(parent))
1382- return false;
1383-
1384+ const Core::Id id) const
1385+{
1386 return availableCreationIds(parent).contains(id);
1387 }
1388
1389@@ -160,7 +138,7 @@
1390 }
1391
1392 ProjectExplorer::RunConfiguration *UbuntuLocalRunConfigurationFactory::clone(ProjectExplorer::Target *parent,
1393- ProjectExplorer::RunConfiguration *source) {
1394+ ProjectExplorer::RunConfiguration *source) {
1395 if (!canClone(parent, source))
1396 return NULL;
1397
1398
1399=== modified file 'src/ubuntu/ubuntupackagestep.cpp'
1400--- src/ubuntu/ubuntupackagestep.cpp 2014-06-17 11:48:05 +0000
1401+++ src/ubuntu/ubuntupackagestep.cpp 2014-07-23 14:19:54 +0000
1402@@ -13,6 +13,7 @@
1403 #include <projectexplorer/deployconfiguration.h>
1404 #include <projectexplorer/ioutputparser.h>
1405 #include <utils/qtcprocess.h>
1406+#include <cmakeprojectmanager/cmakeprojectconstants.h>
1407
1408 #include <QDir>
1409 #include <QTimer>
1410@@ -67,42 +68,117 @@
1411 {
1412 m_tasks.clear();
1413
1414- ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
1415- if (!bc){
1416- ProjectExplorer::Task t(ProjectExplorer::Task::Error
1417- ,tr("No valid BuildConfiguration set for step: %1").arg(displayName())
1418- ,Utils::FileName(),-1
1419- ,ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
1420- m_tasks.append(t);
1421-
1422- //UbuntuClickPackageStep::run will stop if tasks exist
1423- return true;
1424-
1425+ QString projectDir = target()->project()->projectDirectory();
1426+ QString deployDir;
1427+ Utils::Environment env = Utils::Environment::systemEnvironment();
1428+ Utils::AbstractMacroExpander *mExp = 0;
1429+
1430+ {
1431+ ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
1432+ if(bc) {
1433+ m_buildDir = bc->buildDirectory().toString();
1434+ deployDir = bc->buildDirectory().toString()
1435+ + QDir::separator()
1436+ + QString::fromLatin1(Constants::UBUNTU_DEPLOY_DESTDIR);
1437+ env = bc->environment();
1438+ mExp = bc->macroExpander();
1439+ } else {
1440+ //cmake projects NEED a buildconfiguration
1441+ if (target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) {
1442+ ProjectExplorer::Task t(ProjectExplorer::Task::Error
1443+ ,tr("No valid BuildConfiguration set for step: %1").arg(displayName())
1444+ ,Utils::FileName(),-1
1445+ ,ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
1446+ m_tasks.append(t);
1447+
1448+ //UbuntuClickPackageStep::run will stop if tasks exist
1449+ return true;
1450+ } else {
1451+ //backward compatibility, old HTML5 projects did not have a Buildconfiguration
1452+ //this would crash otherwise
1453+
1454+ //ubuntu + qml project types
1455+ QDir pDir(projectDir);
1456+ m_buildDir = QDir::cleanPath(target()->project()->projectDirectory()
1457+ +QDir::separator()+QStringLiteral("..")
1458+ +QDir::separator()+pDir.dirName()+QStringLiteral("_build"));
1459+ deployDir = m_buildDir+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR);
1460+
1461+ //clean up the old "build"
1462+ QDir bd(m_buildDir);
1463+ if(!bd.exists(m_buildDir))
1464+ bd.mkdir(m_buildDir);
1465+ }
1466+ }
1467 }
1468
1469 //build the make process arguments
1470 {
1471- QStringList arguments;
1472- arguments << QStringLiteral("DESTDIR=%1").arg(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR))
1473- << QStringLiteral("install");
1474-
1475- ProjectExplorer::ProcessParameters* params = &m_MakeParam;
1476- params->setMacroExpander(bc->macroExpander());
1477-
1478- //setup process parameters
1479- params->setWorkingDirectory(bc->buildDirectory().toString());
1480- params->setCommand(
1481- makeCommand(ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit()),
1482- bc->environment()));
1483- params->setArguments(Utils::QtcProcess::joinArgs(arguments));
1484-
1485- Utils::Environment env = bc->environment();
1486- // Force output to english for the parsers. Do this here and not in the toolchain's
1487- // addToEnvironment() to not screw up the users run environment.
1488- env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
1489- params->setEnvironment(env);
1490-
1491- params->resolveAll();
1492+ if (target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) {
1493+ QStringList arguments;
1494+ arguments << QStringLiteral("DESTDIR=%1").arg(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR))
1495+ << QStringLiteral("install");
1496+
1497+ ProjectExplorer::ProcessParameters* params = &m_MakeParam;
1498+ params->setMacroExpander(mExp);
1499+
1500+ //setup process parameters
1501+ params->setWorkingDirectory(m_buildDir);
1502+ params->setCommand(
1503+ makeCommand(ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit()),
1504+ env));
1505+ params->setArguments(Utils::QtcProcess::joinArgs(arguments));
1506+
1507+ Utils::Environment tmpenv = env;
1508+ // Force output to english for the parsers. Do this here and not in the toolchain's
1509+ // addToEnvironment() to not screw up the users run environment.
1510+ tmpenv.set(QLatin1String("LC_ALL"), QLatin1String("C"));
1511+ params->setEnvironment(tmpenv);
1512+
1513+ params->resolveAll();
1514+ } else {
1515+ //QML and HTML projects are just rsynced for now
1516+ QStringList arguments;
1517+ arguments << QStringLiteral("-avh")
1518+ << QStringLiteral("--delete")
1519+ << QStringLiteral("--exclude")<<QStringLiteral(".bzr")
1520+ << QStringLiteral("--exclude")<<QStringLiteral(".git")
1521+ << QStringLiteral("--exclude")<<QStringLiteral(".hg")
1522+ << QStringLiteral("--exclude")<<QStringLiteral(".svn")
1523+ << QStringLiteral("--exclude")<<QStringLiteral("*.qmlproject")
1524+ << QStringLiteral("--exclude")<<QStringLiteral("*.user")
1525+ << QStringLiteral("--exclude")<<QStringLiteral("tests")
1526+ << QStringLiteral("--exclude")<<QStringLiteral("Makefile")
1527+ << QStringLiteral("--exclude")<<QStringLiteral(".excludes")
1528+ << QStringLiteral("--exclude")<<QStringLiteral("*.ubuntuhtmlproject");
1529+
1530+ QFile excludes (projectDir+QDir::separator()+QStringLiteral(".excludes"));
1531+ if (excludes.open(QIODevice::ReadOnly)) {
1532+ while (excludes.canReadLine()) {
1533+ arguments << QStringLiteral("--exclude") << QString::fromUtf8(excludes.readLine());
1534+ }
1535+ excludes.close();
1536+ }
1537+
1538+ arguments << projectDir+QDir::separator()
1539+ << deployDir;
1540+
1541+ ProjectExplorer::ProcessParameters* params = &m_MakeParam;
1542+ params->setMacroExpander(mExp);
1543+
1544+ //setup process parameters
1545+ params->setWorkingDirectory(m_buildDir);
1546+ params->setCommand(QStringLiteral("rsync"));
1547+ params->setArguments(Utils::QtcProcess::joinArgs(arguments));
1548+
1549+ Utils::Environment tmpenv = env;
1550+ // Force output to english for the parsers. Do this here and not in the toolchain's
1551+ // addToEnvironment() to not screw up the users run environment.
1552+ tmpenv.set(QLatin1String("LC_ALL"), QLatin1String("C"));
1553+ params->setEnvironment(tmpenv);
1554+
1555+ params->resolveAll();
1556+ }
1557 }
1558
1559
1560@@ -110,23 +186,21 @@
1561 {
1562 QStringList arguments;
1563 arguments << QLatin1String("build")
1564- << bc->buildDirectory().toString()
1565- + QDir::separator()
1566- + QString::fromLatin1(Constants::UBUNTU_DEPLOY_DESTDIR);
1567+ << deployDir;
1568
1569 ProjectExplorer::ProcessParameters* params = &m_ClickParam;
1570- params->setMacroExpander(bc->macroExpander());
1571+ params->setMacroExpander(mExp);
1572
1573 //setup process parameters
1574- params->setWorkingDirectory(bc->buildDirectory().toString());
1575+ params->setWorkingDirectory(m_buildDir);
1576 params->setCommand(QLatin1String("click"));
1577 params->setArguments(Utils::QtcProcess::joinArgs(arguments));
1578
1579- Utils::Environment env = bc->environment();
1580+ Utils::Environment tmpEnv = env;
1581 // Force output to english for the parsers. Do this here and not in the toolchain's
1582 // addToEnvironment() to not screw up the users run environment.
1583- env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
1584- params->setEnvironment(env);
1585+ tmpEnv.set(QLatin1String("LC_ALL"), QLatin1String("C"));
1586+ params->setEnvironment(tmpEnv);
1587
1588 params->resolveAll();
1589 }
1590@@ -198,7 +272,7 @@
1591 {
1592 if(m_clickPackageName.isEmpty())
1593 return QString();
1594- return target()->activeBuildConfiguration()->buildDirectory().toString()
1595+ return m_buildDir
1596 + QDir::separator()
1597 + m_clickPackageName;
1598 }
1599@@ -376,6 +450,11 @@
1600 {
1601 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
1602
1603+ if(!bc) {
1604+ QTimer::singleShot(0,this,SLOT(doNextStep()));
1605+ return;
1606+ }
1607+
1608 bool ubuntuDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit()) == Constants::UBUNTU_DEVICE_TYPE_ID;
1609 bool injectDebugScript = (m_packageMode == EnableDebugScript) ||
1610 (m_packageMode == AutoEnableDebugScript && bc->buildType() == ProjectExplorer::BuildConfiguration::Debug);
1611@@ -400,10 +479,10 @@
1612
1613 UbuntuClickManifest manifest;
1614 if(!manifest.load(bc->buildDirectory()
1615- .appendPath(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR))
1616- .appendPath(QStringLiteral("manifest.json"))
1617- .toString(),
1618- projectName)) {
1619+ .appendPath(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR))
1620+ .appendPath(QStringLiteral("manifest.json"))
1621+ .toString(),
1622+ projectName)) {
1623
1624 emit addOutput(tr("Could not find the manifest.json file in %1.\nPlease check if it is added to the install targets in your project file")
1625 .arg(bc->buildDirectory()
1626@@ -514,7 +593,7 @@
1627
1628 //return to MainLoop to update the progressBar
1629 QTimer::singleShot(0,this,SLOT(injectDebugHelperStep()));
1630- break;
1631+ break;
1632 }
1633 case PreparePackage: {
1634 m_futureInterface->setProgressValueAndText(2,tr("Building click package"));
1635@@ -533,7 +612,7 @@
1636 QRegularExpressionMatch m = exp.match(m_lastLine);
1637 if(m.hasMatch()) {
1638 m_clickPackageName = m.captured(1);
1639- emit addOutput(tr("The click package has been created in %1").arg(target()->activeBuildConfiguration()->buildDirectory().toString()) ,
1640+ emit addOutput(tr("The click package has been created in %1").arg(m_buildDir) ,
1641 ProjectExplorer::BuildStep::MessageOutput);
1642 }
1643
1644
1645=== modified file 'src/ubuntu/ubuntupackagestep.h'
1646--- src/ubuntu/ubuntupackagestep.h 2014-06-17 09:25:03 +0000
1647+++ src/ubuntu/ubuntupackagestep.h 2014-07-23 14:19:54 +0000
1648@@ -81,6 +81,7 @@
1649 State m_state;
1650 QString m_lastLine;
1651 QString m_clickPackageName;
1652+ QString m_buildDir;
1653 QList<ProjectExplorer::Task> m_tasks;
1654 QFutureInterface<bool> *m_futureInterface;
1655
1656
1657=== modified file 'src/ubuntu/ubuntupackagingwidget.cpp'
1658--- src/ubuntu/ubuntupackagingwidget.cpp 2014-07-10 13:20:17 +0000
1659+++ src/ubuntu/ubuntupackagingwidget.cpp 2014-07-23 14:19:54 +0000
1660@@ -26,6 +26,7 @@
1661 #include "ubuntuvalidationresultmodel.h"
1662 #include "ubuntudevice.h"
1663 #include "ubuntupackagestep.h"
1664+#include "ubuntushared.h"
1665
1666 #include <projectexplorer/projectexplorer.h>
1667 #include <projectexplorer/project.h>
1668@@ -98,10 +99,9 @@
1669 connect(m_validationModel,SIGNAL(rowsInserted(QModelIndex,int,int)),this,SLOT(onNewValidationData()));
1670
1671 connect(UbuntuMenu::instance(),SIGNAL(requestBuildAndInstallProject()),this,SLOT(buildAndInstallPackageRequested()));
1672+ connect(ProjectExplorer::SessionManager::instance(),SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),this,SLOT(onStartupProjectChanged()));
1673
1674- ui->comboBoxFramework->blockSignals(true);
1675- ui->comboBoxFramework->addItems(UbuntuClickTool::getSupportedFrameworks());
1676- ui->comboBoxFramework->blockSignals(false);
1677+ updateFrameworkList();
1678
1679 m_reviewToolsInstalled = false;
1680 checkClickReviewerTool();
1681@@ -112,7 +112,7 @@
1682 autoSave();
1683 delete ui;
1684
1685- clearAdditionalBuildSteps();
1686+ clearPackageBuildList();
1687 }
1688
1689 QString UbuntuPackagingWidget::createPackageName(const QString &userName, const QString &projectName)
1690@@ -185,7 +185,9 @@
1691 }
1692 }
1693
1694-void UbuntuPackagingWidget::onMessage(QString msg) {
1695+void UbuntuPackagingWidget::onMessage(QString msg)
1696+{
1697+ if(debug) printToOutputPane(msg);
1698 m_reply.append(msg);
1699 m_inputParser->addRecievedData(msg);
1700 }
1701@@ -280,6 +282,26 @@
1702 m_ubuntuProcess.start(QString(QLatin1String(Constants::UBUNTUPACKAGINGWIDGET_CLICK_REVIEWER_TOOLS_AGAINST_PACKAGE)).arg(clickPackage));
1703 }
1704
1705+void UbuntuPackagingWidget::onStartupProjectChanged()
1706+{
1707+ ProjectExplorer::Project *currProject = ProjectExplorer::SessionManager::startupProject();
1708+ if (currProject == m_currentProject.data())
1709+ return;
1710+
1711+ if(m_currentProject)
1712+ m_currentProject->disconnect(this);
1713+
1714+ m_currentProject = currProject;
1715+ connect(currProject,SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),this,SLOT(onActiveTargetChanged()));
1716+ onActiveTargetChanged();
1717+}
1718+
1719+void UbuntuPackagingWidget::onActiveTargetChanged()
1720+{
1721+ if(this->isVisible())
1722+ reload();
1723+}
1724+
1725 void UbuntuPackagingWidget::autoSave() {
1726 save((ui->tabWidget->currentWidget() == ui->tabSimple));
1727 }
1728@@ -289,6 +311,8 @@
1729 ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject();
1730
1731 if (startupProject) {
1732+ updateFrameworkList();
1733+
1734 m_projectName = startupProject->displayName();
1735 m_projectDir = startupProject->projectDirectory();
1736
1737@@ -511,7 +535,12 @@
1738
1739 if(debug) qDebug()<<"Setting to "<<bzr->whoami();
1740 } else if (i.key() == QStringLiteral("framework")) {
1741- targetObject.insert(i.key(),UbuntuClickTool::getMostRecentFramework( QString() ));
1742+ const UbuntuClickTool::Target *t = 0;
1743+ ProjectExplorer::Project *p = ProjectExplorer::SessionManager::startupProject();
1744+ if (p)
1745+ t = UbuntuClickTool::clickTargetFromTarget(p->activeTarget());
1746+
1747+ targetObject.insert(i.key(),UbuntuClickTool::getMostRecentFramework( QString(), t));
1748 } else {
1749 targetObject.insert(i.key(),i.value());
1750
1751@@ -597,6 +626,7 @@
1752 ui->lineEdit_version->setText(m_manifest.version());
1753 ui->lineEdit_description->setText(m_manifest.description());
1754
1755+ updateFrameworkList();
1756 int idx = ui->comboBoxFramework->findText(m_manifest.frameworkName());
1757
1758 //disable the currentIndexChanged signal, reloading the files
1759@@ -668,7 +698,9 @@
1760 if(!project)
1761 return;
1762
1763- if(project->projectManager()->mimeType() == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE)) {
1764+ QString mimeType = project->projectManager()->mimeType();
1765+ if(mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE)
1766+ || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE) ) {
1767 if(m_reviewToolsInstalled)
1768 m_postPackageTask = Verify;
1769 else
1770@@ -699,13 +731,13 @@
1771 {
1772 disconnect(m_buildManagerConnection);
1773 if (success) {
1774- UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(m_additionalPackagingBuildSteps.last());
1775+ UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(m_packageBuildSteps->steps().last());
1776 if (pckStep && !pckStep->packagePath().isEmpty()) {
1777 m_ubuntuProcess.stop();
1778
1779 QString sClickPackagePath = pckStep->packagePath();
1780 if (sClickPackagePath.isEmpty()) {
1781- clearAdditionalBuildSteps();
1782+ clearPackageBuildList();
1783 return;
1784 }
1785
1786@@ -744,7 +776,7 @@
1787 }
1788 }
1789 }
1790- clearAdditionalBuildSteps();
1791+ clearPackageBuildList();
1792 }
1793
1794 void UbuntuPackagingWidget::buildAndInstallPackageRequested()
1795@@ -769,7 +801,11 @@
1796 if(!project)
1797 return;
1798
1799- if(project->projectManager()->mimeType() == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE)) {
1800+ QString mimeType = project->projectManager()->mimeType();
1801+ bool isCMake = mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE);
1802+ bool isHtml = mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE);
1803+
1804+ if(isCMake || isHtml) {
1805 ProjectExplorer::Target* target = project->activeTarget();
1806 if(!target)
1807 return;
1808@@ -783,9 +819,16 @@
1809 return;
1810 }
1811
1812+ if(ProjectExplorer::BuildManager::isBuilding()) {
1813+ QMessageBox::information(this,tr("Build running"),tr("There is currently a build running, please wait for it to be finished"));
1814+ return;
1815+ }
1816+
1817 ProjectExplorer::BuildConfiguration* bc = target->activeBuildConfiguration();
1818- if(!bc)
1819+ if(!bc) {
1820+ QMessageBox::information(this,tr("Error"),tr("Please add a valid buildconfiguration to your project"));
1821 return;
1822+ }
1823
1824 if(!bc->isEnabled()) {
1825 QString disabledReason = bc->disabledReason();
1826@@ -793,27 +836,22 @@
1827 return;
1828 }
1829
1830- if(ProjectExplorer::BuildManager::isBuilding()) {
1831- QMessageBox::information(this,tr("Build running"),tr("There is currently a build running, please wait for it to be finished"));
1832- return;
1833+ clearPackageBuildList();
1834+
1835+ m_packageBuildSteps = QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(bc,ProjectExplorer::Constants::BUILDSTEPS_BUILD));
1836+ if (isCMake) {
1837+ //add the normal buildsteps
1838+ m_packageBuildSteps->cloneSteps(bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)));
1839 }
1840
1841- clearAdditionalBuildSteps();
1842-
1843- ProjectExplorer::BuildStepList* steps = bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
1844- if(!steps || steps->isEmpty())
1845- return;
1846-
1847- UbuntuPackageStep* package = new UbuntuPackageStep(steps);
1848+ //append the click packaging step
1849+ UbuntuPackageStep* package = new UbuntuPackageStep(m_packageBuildSteps.data());
1850 package->setPackageMode(UbuntuPackageStep::DisableDebugScript);
1851-
1852- m_additionalPackagingBuildSteps.append(package);
1853+ m_packageBuildSteps->appendStep(package);
1854
1855 m_buildManagerConnection = connect(ProjectExplorer::BuildManager::instance(),SIGNAL(buildQueueFinished(bool)),this,SLOT(buildFinished(bool)));
1856
1857- ProjectExplorer::BuildManager::buildList(steps,tr("Build Project"));
1858- ProjectExplorer::BuildManager::appendStep(package ,tr("Creating Click package"));
1859-
1860+ ProjectExplorer::BuildManager::buildList(m_packageBuildSteps.data(),tr("Build Project"));
1861 }
1862 }
1863
1864@@ -823,14 +861,27 @@
1865 * \note This will cancel a current build if its building the ProjectConfiguration
1866 * the BuildSteps belong to!
1867 */
1868-void UbuntuPackagingWidget::clearAdditionalBuildSteps()
1869-{
1870- foreach(QPointer<ProjectExplorer::BuildStep> step,m_additionalPackagingBuildSteps) {
1871- if(step) {
1872- if(ProjectExplorer::BuildManager::isBuilding(step->projectConfiguration()))
1873- ProjectExplorer::BuildManager::cancel();
1874- delete step.data();
1875- }
1876- }
1877- m_additionalPackagingBuildSteps.clear();
1878+void UbuntuPackagingWidget::clearPackageBuildList()
1879+{
1880+ if (!m_packageBuildSteps)
1881+ return;
1882+
1883+ if(ProjectExplorer::BuildManager::isBuilding( static_cast<ProjectExplorer::ProjectConfiguration *>(m_packageBuildSteps->parent())))
1884+ ProjectExplorer::BuildManager::cancel();
1885+
1886+ m_packageBuildSteps->deleteLater();
1887+ m_packageBuildSteps.clear();
1888+}
1889+
1890+void UbuntuPackagingWidget::updateFrameworkList()
1891+{
1892+ const UbuntuClickTool::Target *t = 0;
1893+ ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject();
1894+ if (startupProject)
1895+ t = UbuntuClickTool::clickTargetFromTarget(startupProject->activeTarget());
1896+
1897+ ui->comboBoxFramework->blockSignals(true);
1898+ ui->comboBoxFramework->clear();
1899+ ui->comboBoxFramework->addItems(UbuntuClickTool::getSupportedFrameworks(t));
1900+ ui->comboBoxFramework->blockSignals(false);
1901 }
1902
1903=== modified file 'src/ubuntu/ubuntupackagingwidget.h'
1904--- src/ubuntu/ubuntupackagingwidget.h 2014-07-10 13:20:17 +0000
1905+++ src/ubuntu/ubuntupackagingwidget.h 2014-07-23 14:19:54 +0000
1906@@ -85,6 +85,8 @@
1907 void on_pushButton_addpolicy_clicked();
1908 void on_pushButtonClickPackage_clicked();
1909 void on_pushButtonReviewersTools_clicked();
1910+ void onStartupProjectChanged ();
1911+ void onActiveTargetChanged ();
1912
1913 void on_pushButtonReload_clicked();
1914
1915@@ -110,7 +112,8 @@
1916
1917 private:
1918 void buildClickPackage ();
1919- void clearAdditionalBuildSteps ();
1920+ void clearPackageBuildList ();
1921+ void updateFrameworkList ();
1922
1923 private:
1924 bool m_reviewToolsInstalled;
1925@@ -130,8 +133,12 @@
1926 ClickRunChecksParser* m_inputParser;
1927
1928 //packaging support with buildsteps
1929- QList<QPointer<ProjectExplorer::BuildStep> > m_additionalPackagingBuildSteps;
1930+ QSharedPointer<ProjectExplorer::BuildStepList> m_packageBuildSteps;
1931 QMetaObject::Connection m_buildManagerConnection;
1932 ClickPackageTask m_postPackageTask;
1933+
1934+ //current used startup project and target
1935+ QPointer<ProjectExplorer::Project> m_currentProject;
1936+ QPointer<ProjectExplorer::Target> m_currentTarget;
1937 };
1938 #endif // UBUNTUPACKAGINGWIDGET_H
1939
1940=== modified file 'src/ubuntu/ubuntuplugin.cpp'
1941--- src/ubuntu/ubuntuplugin.cpp 2014-07-07 06:33:37 +0000
1942+++ src/ubuntu/ubuntuplugin.cpp 2014-07-23 14:19:54 +0000
1943@@ -29,12 +29,13 @@
1944 #include "ubuntudevicefactory.h"
1945 #include "clicktoolchain.h"
1946 #include "ubuntucmakebuildconfiguration.h"
1947+#include "ubuntuhtmlbuildconfiguration.h"
1948 #include "ubunturemotedeployconfiguration.h"
1949 #include "ubuntulocaldeployconfiguration.h"
1950 #include "ubuntudevicesmodel.h"
1951 #include "localportsmanager.h"
1952 #include "ubuntubzr.h"
1953-
1954+#include "ubuntudeploystepfactory.h"
1955 #include <coreplugin/modemanager.h>
1956 #include <projectexplorer/kitmanager.h>
1957 #include <coreplugin/featureprovider.h>
1958@@ -134,6 +135,7 @@
1959 addAutoReleasedObject(new UbuntuCMakeToolFactory);
1960 addAutoReleasedObject(new UbuntuCMakeMakeStepFactory);
1961 addAutoReleasedObject(new UbuntuCMakeBuildConfigurationFactory);
1962+ addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory);
1963
1964 //ubuntu device support
1965 addAutoReleasedObject(new UbuntuDeviceFactory);
1966@@ -148,8 +150,12 @@
1967 QStringLiteral("ubuntu-project-cmake"),
1968 Core::IWizard::ProjectWizard));
1969 addAutoReleasedObject(
1970- new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::UbuntuProject>(
1971- QStringLiteral("ubuntu-project-plain"),
1972+ new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::UbuntuHTMLProject>(
1973+ QStringLiteral("ubuntu-project-plain-html"),
1974+ Core::IWizard::ProjectWizard));
1975+ addAutoReleasedObject(
1976+ new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::UbuntuQMLProject>(
1977+ QStringLiteral("ubuntu-project-plain-qml"),
1978 Core::IWizard::ProjectWizard));
1979 addAutoReleasedObject(
1980 new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::GoProject>(
1981
1982=== modified file 'src/ubuntu/ubuntuproject.cpp'
1983--- src/ubuntu/ubuntuproject.cpp 2014-07-03 13:03:47 +0000
1984+++ src/ubuntu/ubuntuproject.cpp 2014-07-23 14:19:54 +0000
1985@@ -20,7 +20,11 @@
1986 #include <coreplugin/modemanager.h>
1987 #include <projectexplorer/projectexplorerconstants.h>
1988 #include <projectexplorer/kitinformation.h>
1989+#include <projectexplorer/toolchain.h>
1990+#include <projectexplorer/projectmacroexpander.h>
1991 #include <qmljs/qmljssimplereader.h>
1992+#include <qtsupport/qtkitinformation.h>
1993+#include <qtsupport/qtsupportconstants.h>
1994
1995
1996 using namespace Ubuntu;
1997@@ -44,19 +48,6 @@
1998 m_rootNode = QSharedPointer<UbuntuProjectNode>(new UbuntuProjectNode(this, m_file.data()));
1999 m_manager->registerProject(this);
2000
2001- QList<ProjectExplorer::Kit *> kits = ProjectExplorer::KitManager::kits();
2002- foreach (ProjectExplorer::Kit *kit, kits) {
2003- //do not spawn invalid configurations
2004- if(ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(kit) != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
2005- continue;
2006-
2007- addTarget(createTarget(kit));
2008- }
2009-
2010- if (needsConfiguration()) {
2011- Core::ModeManager::activateMode(ProjectExplorer::Constants::MODE_SESSION);
2012- }
2013-
2014 extractProjectFileData(fileName);
2015 }
2016
2017@@ -119,3 +110,66 @@
2018 enumChild(projectDir(), files);
2019 return files;
2020 }
2021+
2022+bool UbuntuProject::supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const
2023+{
2024+ UbuntuKitMatcher matcher;
2025+ if (!matcher.matches(k)) {
2026+ if(errorMessage)
2027+ *errorMessage = tr("Only Desktop and Ubuntu Kits are supported");
2028+ return false;
2029+ }
2030+
2031+ return true;
2032+}
2033+
2034+bool UbuntuProject::needsConfiguration() const
2035+{
2036+ return targets().size() == 0;
2037+}
2038+
2039+bool UbuntuProject::supportsNoTargetPanel() const
2040+{
2041+ return true;
2042+}
2043+
2044+ProjectExplorer::KitMatcher *UbuntuProject::createRequiredKitMatcher() const
2045+{
2046+ return new UbuntuKitMatcher();
2047+}
2048+
2049+ProjectExplorer::KitMatcher *UbuntuProject::createPreferredKitMatcher() const
2050+{
2051+ return new QtSupport::QtVersionKitMatcher(Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP));
2052+}
2053+
2054+QString UbuntuProject::shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix)
2055+{
2056+ if (proFilePath.isEmpty())
2057+ return QString();
2058+
2059+ QFileInfo info(proFilePath);
2060+
2061+ QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
2062+ if (version && !version->supportsShadowBuilds())
2063+ return info.absolutePath();
2064+
2065+ const QString projectName = QFileInfo(proFilePath).completeBaseName();
2066+ ProjectExplorer::ProjectMacroExpander expander(proFilePath, projectName, k, suffix);
2067+ QDir projectDir = QDir(projectDirectory(proFilePath));
2068+ QString buildPath = Utils::expandMacros(Core::DocumentManager::buildDirectory(), &expander);
2069+ return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));
2070+}
2071+
2072+
2073+bool UbuntuKitMatcher::matches(const ProjectExplorer::Kit *k) const
2074+{
2075+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
2076+ if (tc->type() == QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2077+ return true;
2078+
2079+ if (ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
2080+ return true;
2081+
2082+ return false;
2083+}
2084
2085=== modified file 'src/ubuntu/ubuntuproject.h'
2086--- src/ubuntu/ubuntuproject.h 2014-06-03 12:04:26 +0000
2087+++ src/ubuntu/ubuntuproject.h 2014-07-23 14:19:54 +0000
2088@@ -50,6 +50,14 @@
2089 class UbuntuProjectManager;
2090 class UbuntuProjectFile;
2091 class UbuntuProjectNode;
2092+
2093+class UbuntuKitMatcher : public ProjectExplorer::KitMatcher
2094+{
2095+public:
2096+ explicit UbuntuKitMatcher() { }
2097+ bool matches(const ProjectExplorer::Kit *k) const override;
2098+};
2099+
2100 class UbuntuProject : public ProjectExplorer::Project
2101 {
2102 Q_OBJECT
2103@@ -76,6 +84,14 @@
2104 return m_mainFile;
2105 }
2106
2107+ // Project interface
2108+ virtual bool supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const override;
2109+ virtual bool needsConfiguration() const override;
2110+ virtual bool supportsNoTargetPanel() const override;
2111+ virtual ProjectExplorer::KitMatcher *createRequiredKitMatcher() const override;
2112+ virtual ProjectExplorer::KitMatcher *createPreferredKitMatcher() const override;
2113+
2114+ static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix = QString());
2115 private:
2116 void extractProjectFileData(const QString& filename);
2117
2118@@ -86,7 +102,6 @@
2119
2120 QString m_fileName;
2121 QSharedPointer<UbuntuProjectNode> m_rootNode;
2122-
2123 };
2124 }
2125 }
2126
2127=== modified file 'src/ubuntu/ubuntuprojectapplicationwizard.cpp'
2128--- src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-07-10 13:20:17 +0000
2129+++ src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-07-23 14:19:54 +0000
2130@@ -32,6 +32,9 @@
2131 #include <extensionsystem/pluginmanager.h>
2132 #include <cmakeprojectmanager/cmakekitinformation.h>
2133
2134+#include <projectexplorer/kitinformation.h>
2135+#include <projectexplorer/toolchain.h>
2136+
2137 #include <QDir>
2138
2139
2140@@ -41,6 +44,7 @@
2141 debug = 0
2142 };
2143
2144+
2145 UbuntuProjectApplicationWizard::UbuntuProjectApplicationWizard(ProjectType type)
2146 : m_type(type)
2147 {
2148@@ -167,7 +171,7 @@
2149 void UbuntuProjectApplicationWizardDialog::addTargetSetupPage(int id)
2150 {
2151 //no target setup page required for basic projects
2152- if(m_type == UbuntuProjectApplicationWizard::UbuntuProject)
2153+ if(m_type == UbuntuProjectApplicationWizard::UbuntuQMLProject)
2154 return;
2155
2156 m_targetSetupPage = new ProjectExplorer::TargetSetupPage;
2157@@ -207,6 +211,10 @@
2158 m_targetSetupPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(features));
2159 break;
2160 }
2161+ case UbuntuProjectApplicationWizard::UbuntuHTMLProject: {
2162+ m_targetSetupPage->setRequiredKitMatcher(new UbuntuKitMatcher());
2163+ break;
2164+ }
2165 default:
2166 break;
2167 }
2168@@ -237,6 +245,11 @@
2169 +projectName
2170 +QDir::separator()
2171 +QString::fromLatin1("%1.goproject").arg(projectName));
2172+ } else if (m_type == UbuntuProjectApplicationWizard::UbuntuHTMLProject) {
2173+ m_targetSetupPage->setProjectPath(path+QDir::separator()
2174+ +projectName
2175+ +QDir::separator()
2176+ +QString::fromLatin1("%1.ubuntuhtmlproject").arg(projectName));
2177 } else {
2178 m_targetSetupPage->setProjectPath(path+QDir::separator()+projectName+QDir::separator()+QLatin1String("CMakeLists.txt"));
2179 }
2180
2181=== modified file 'src/ubuntu/ubuntuprojectapplicationwizard.h'
2182--- src/ubuntu/ubuntuprojectapplicationwizard.h 2014-06-30 15:20:18 +0000
2183+++ src/ubuntu/ubuntuprojectapplicationwizard.h 2014-07-23 14:19:54 +0000
2184@@ -41,7 +41,8 @@
2185 public:
2186
2187 enum ProjectType{
2188- UbuntuProject, //handles Qml, Html basic projects
2189+ UbuntuHTMLProject,
2190+ UbuntuQMLProject,
2191 CMakeProject,
2192 GoProject
2193 };
2194
2195=== modified file 'src/ubuntu/ubunturemotedeployconfiguration.cpp'
2196--- src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-06-17 11:53:03 +0000
2197+++ src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-07-23 14:19:54 +0000
2198@@ -18,8 +18,9 @@
2199 #include "ubunturemotedeployconfiguration.h"
2200 #include "ubuntucmakebuildconfiguration.h"
2201 #include "ubuntucmakemakestep.h"
2202+#include "ubuntudirectuploadstep.h"
2203+#include "ubuntuprojectguesser.h"
2204 #include "ubuntuconstants.h"
2205-#include "ubuntuprojectguesser.h"
2206 #include "ubuntupackagestep.h"
2207
2208 #include <utils/qtcassert.h>
2209@@ -31,13 +32,10 @@
2210 #include <projectexplorer/kitinformation.h>
2211 #include <projectexplorer/abi.h>
2212 #include <projectexplorer/buildstep.h>
2213-#include <projectexplorer/deployablefile.h>
2214-
2215-#include <remotelinux/remotelinuxdeployconfiguration.h>
2216+
2217+#include <cmakeprojectmanager/cmakeprojectconstants.h>
2218+
2219 #include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
2220-#include <remotelinux/genericdirectuploadservice.h>
2221-
2222-#include <cmakeprojectmanager/cmakeprojectconstants.h>
2223
2224 #include <QDir>
2225
2226@@ -65,148 +63,6 @@
2227 return new ProjectExplorer::NamedWidget();
2228 }
2229
2230-UbuntuDirectUploadStep::UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl)
2231- : AbstractRemoteLinuxDeployStep(bsl, UbuntuDirectUploadStep::stepId())
2232- , m_deployService(new RemoteLinux::GenericDirectUploadService(this))
2233-{
2234- setDefaultDisplayName(displayName());
2235-}
2236-
2237-UbuntuDirectUploadStep::UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl, UbuntuDirectUploadStep *other)
2238- : AbstractRemoteLinuxDeployStep(bsl, other)
2239- , m_deployService(new RemoteLinux::GenericDirectUploadService(this))
2240-{
2241- setDefaultDisplayName(displayName());
2242-
2243- connect(target()->project(),SIGNAL(displayNameChanged()),this,SLOT(projectNameChanged()));
2244- connect(target(),SIGNAL(applicationTargetsChanged()),this,SLOT(projectNameChanged()));
2245-}
2246-
2247-UbuntuDirectUploadStep::~UbuntuDirectUploadStep()
2248-{
2249-}
2250-
2251-void UbuntuDirectUploadStep::run(QFutureInterface<bool> &fi)
2252-{
2253- m_foundClickPackage = false;
2254- projectNameChanged();
2255- if(!m_foundClickPackage) {
2256- emit addOutput(tr("Deploy step failed. No click package was created"), ErrorMessageOutput);
2257- fi.reportResult(false);
2258- emit finished();
2259- return;
2260- }
2261-
2262-
2263- m_deployService->setIncrementalDeployment(false);
2264- m_deployService->setIgnoreMissingFiles(false);
2265-
2266- QString whyNot;
2267- if(!deployService()->isDeploymentPossible(&whyNot)) {
2268- emit addOutput(tr("Deploy step failed. %1").arg(whyNot), ErrorMessageOutput);
2269- fi.reportResult(false);
2270- emit finished();
2271- return;
2272- }
2273-
2274- AbstractRemoteLinuxDeployStep::run(fi);
2275-}
2276-
2277-ProjectExplorer::BuildStepConfigWidget *UbuntuDirectUploadStep::createConfigWidget()
2278-{
2279- return new ProjectExplorer::SimpleBuildStepConfigWidget(this);
2280-}
2281-
2282-bool UbuntuDirectUploadStep::initInternal(QString *error)
2283-{
2284- Q_UNUSED(error)
2285- return true;
2286-}
2287-
2288-RemoteLinux::AbstractRemoteLinuxDeployService *UbuntuDirectUploadStep::deployService() const
2289-{
2290- return m_deployService;
2291-}
2292-
2293-bool UbuntuDirectUploadStep::fromMap(const QVariantMap &map)
2294-{
2295- if (!AbstractRemoteLinuxDeployStep::fromMap(map))
2296- return false;
2297- return true;
2298-}
2299-
2300-QVariantMap UbuntuDirectUploadStep::toMap() const
2301-{
2302- return AbstractRemoteLinuxDeployStep::toMap();
2303-}
2304-
2305-
2306-Core::Id UbuntuDirectUploadStep::stepId()
2307-{
2308- return Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID;
2309-}
2310-
2311-QString UbuntuDirectUploadStep::displayName()
2312-{
2313- return tr("Upload files to Ubuntu Device");
2314-}
2315-
2316-static void createFileList(const QDir &rootDir
2317- , const QString& subDir
2318- , const QString& remoteRoot
2319- , QList<ProjectExplorer::DeployableFile>* list)
2320-{
2321- QDir currentDir(rootDir.absolutePath()+subDir);
2322- if(!currentDir.exists())
2323- return;
2324-
2325- QFileInfoList entries = currentDir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
2326- foreach (const QFileInfo &entry, entries) {
2327- if(entry.isDir()) {
2328- QString newSub = (subDir.endsWith(QLatin1String("/"))) ? (QString)(subDir+entry.fileName()) : (QString)(subDir+(QLatin1String("/")+entry.fileName()));
2329- createFileList(rootDir,newSub,remoteRoot,list);
2330- } else {
2331- QString targetPath = QDir::cleanPath(remoteRoot
2332- + subDir
2333- + QLatin1String("/"));
2334-
2335- if(debug) qDebug()<<"Uploading: "<<entry.fileName();
2336- if(debug) qDebug()<<" to "<<targetPath;
2337- list->append(ProjectExplorer::DeployableFile(entry.absoluteFilePath()
2338- , targetPath
2339- , entry.isExecutable() ? ProjectExplorer::DeployableFile::TypeExecutable
2340- : ProjectExplorer::DeployableFile::TypeNormal));
2341- }
2342- }
2343-}
2344-
2345-void UbuntuDirectUploadStep::projectNameChanged()
2346-{
2347- if(debug) qDebug()<<"------------------------ Updating DEPLOYLIST ---------------------------";
2348- //iterate over the .deploy dir and put all files in the list
2349- QDir d(target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR));
2350- ProjectExplorer::BuildStepList *bsList = deployConfiguration()->stepList();
2351-
2352- QList<ProjectExplorer::DeployableFile> list;
2353- foreach(ProjectExplorer::BuildStep *currStep ,bsList->steps()) {
2354- UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(currStep);
2355- if(!pckStep)
2356- continue;
2357-
2358- QFileInfo info(pckStep->packagePath());
2359- if(info.exists()) {
2360- list.append(ProjectExplorer::DeployableFile(info.filePath(),
2361- QStringLiteral("/tmp")));
2362-
2363- list.append(ProjectExplorer::DeployableFile(QStringLiteral("%1/qtc_device_applaunch.py").arg(Constants::UBUNTU_SCRIPTPATH),
2364- QStringLiteral("/tmp")));
2365- m_deployService->setDeployableFiles(list);
2366- m_foundClickPackage = true;
2367- break;
2368- }
2369- }
2370-}
2371-
2372
2373 UbuntuRemoteDeployConfigurationFactory::UbuntuRemoteDeployConfigurationFactory(QObject *parent)
2374 : DeployConfigurationFactory(parent)
2375@@ -225,8 +81,11 @@
2376 if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
2377 return ids;
2378
2379- //for now only support cmake projects
2380- if(parent->project()->id() != CMakeProjectManager::Constants::CMAKEPROJECT_ID)
2381+ Core::Id projectTypeId = parent->project()->id();
2382+
2383+ //for now only support cmake and ubuntu projects
2384+ if(projectTypeId != CMakeProjectManager::Constants::CMAKEPROJECT_ID
2385+ && projectTypeId != Ubuntu::Constants::UBUNTUPROJECT_ID)
2386 return ids;
2387
2388 const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
2389@@ -257,10 +116,9 @@
2390 = new UbuntuRemoteDeployConfiguration(parent);
2391
2392 int step = 0;
2393- if(parent->project()->id() == Core::Id(CMakeProjectManager::Constants::CMAKEPROJECT_ID)){
2394- UbuntuPackageStep *pckStep = new UbuntuPackageStep(dc->stepList());
2395- dc->stepList()->insertStep(0,pckStep);
2396- }
2397+
2398+ UbuntuPackageStep *pckStep = new UbuntuPackageStep(dc->stepList());
2399+ dc->stepList()->insertStep(0,pckStep);
2400
2401 RemoteLinux::RemoteLinuxCheckForFreeDiskSpaceStep *checkSpace = new RemoteLinux::RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList());
2402 checkSpace->setPathToCheck(QStringLiteral("/tmp"));
2403@@ -301,90 +159,5 @@
2404 ,qobject_cast<RemoteLinux::RemoteLinuxDeployConfiguration *>(product));
2405 }
2406
2407-QList<Core::Id> UbuntuDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
2408-{
2409- if(!canHandle(parent->target()))
2410- return QList<Core::Id>();
2411-
2412- return QList<Core::Id>()
2413- <<Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID;
2414-}
2415-
2416-QString UbuntuDeployStepFactory::displayNameForId(const Core::Id id) const
2417-{
2418- if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
2419- return UbuntuDirectUploadStep::displayName();
2420- return QString();
2421-}
2422-
2423-bool UbuntuDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
2424-{
2425- if(!canHandle(parent->target()))
2426- return false;
2427-
2428- return availableCreationIds(parent).contains(id);
2429-}
2430-
2431-ProjectExplorer::BuildStep *UbuntuDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
2432-{
2433- if (!canCreate(parent, id))
2434- return 0;
2435-
2436- if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
2437- return new UbuntuDirectUploadStep(parent);
2438- return 0;
2439-}
2440-
2441-bool UbuntuDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
2442-{
2443- return canCreate(parent,ProjectExplorer::idFromMap(map));
2444-}
2445-
2446-ProjectExplorer::BuildStep *UbuntuDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
2447-{
2448- Core::Id id = ProjectExplorer::idFromMap(map);
2449- if(!canCreate(parent,id))
2450- return 0;
2451-
2452- ProjectExplorer::BuildStep* step = create(parent,id);
2453- if (!step->fromMap(map)) {
2454- delete step;
2455- return 0;
2456- }
2457-
2458- return step;
2459-}
2460-
2461-bool UbuntuDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
2462-{
2463- return canCreate(parent,product->id());
2464-}
2465-
2466-ProjectExplorer::BuildStep *UbuntuDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
2467-{
2468- if (!canClone(parent, product))
2469- return 0;
2470-
2471- const Core::Id id = product->id();
2472- if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
2473- return new UbuntuDirectUploadStep(parent, static_cast<UbuntuDirectUploadStep *>(product));
2474-
2475- return 0;
2476-}
2477-
2478-bool UbuntuDeployStepFactory::canHandle(const ProjectExplorer::Target *t) const
2479-{
2480- QTC_ASSERT(t, return false);
2481- if (!t->project()->supportsKit(t->kit()))
2482- return false;
2483-
2484- ProjectExplorer::ToolChain* tc = ProjectExplorer::ToolChainKitInformation::toolChain(t->kit());
2485- if(!tc || tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2486- return false;
2487-
2488- return (t->project()->id() == Core::Id(CMakeProjectManager::Constants::CMAKEPROJECT_ID)
2489- && !UbuntuProjectGuesser::isScopesProject(t->project()));
2490-}
2491-
2492 } // namespace Internal
2493 } // namespace Ubuntu
2494
2495=== modified file 'src/ubuntu/ubunturemotedeployconfiguration.h'
2496--- src/ubuntu/ubunturemotedeployconfiguration.h 2014-06-16 15:14:09 +0000
2497+++ src/ubuntu/ubunturemotedeployconfiguration.h 2014-07-23 14:19:54 +0000
2498@@ -20,13 +20,8 @@
2499 #define UBUNTU_INTERNAL_UBUNTUDEPLOYCONFIGURATION_H
2500
2501 #include <projectexplorer/deployconfiguration.h>
2502-#include <remotelinux/abstractremotelinuxdeploystep.h>
2503 #include <remotelinux/remotelinuxdeployconfiguration.h>
2504
2505-namespace RemoteLinux {
2506-class GenericDirectUploadService;
2507-}
2508-
2509 namespace Ubuntu {
2510 namespace Internal {
2511
2512@@ -44,55 +39,6 @@
2513
2514 };
2515
2516-class UbuntuDirectUploadStep : public RemoteLinux::AbstractRemoteLinuxDeployStep
2517-{
2518- Q_OBJECT
2519-
2520-public:
2521- UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl);
2522- UbuntuDirectUploadStep(ProjectExplorer::BuildStepList *bsl, UbuntuDirectUploadStep *other);
2523- ~UbuntuDirectUploadStep();
2524-
2525- // BuildStep interface
2526- virtual void run(QFutureInterface<bool> &fi) override;
2527-
2528- ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
2529- bool initInternal(QString *error = 0) override;
2530-
2531- RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const override;
2532- bool fromMap(const QVariantMap &map) override;
2533- QVariantMap toMap() const override;
2534-
2535- static Core::Id stepId();
2536- static QString displayName();
2537-
2538-private slots:
2539- void projectNameChanged();
2540-
2541-private:
2542- RemoteLinux::GenericDirectUploadService *m_deployService;
2543- bool m_foundClickPackage;
2544-};
2545-
2546-class UbuntuDeployStepFactory : public ProjectExplorer::IBuildStepFactory
2547-{
2548- Q_OBJECT
2549-
2550-public:
2551- // IBuildStepFactory interface
2552- virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;
2553- virtual QString displayNameForId(const Core::Id id) const override;
2554- virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
2555- virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
2556- virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
2557- virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
2558- virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
2559- virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
2560-
2561-private:
2562- bool canHandle(const ProjectExplorer::Target *t) const;
2563-};
2564-
2565 class UbuntuRemoteDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
2566 {
2567 Q_OBJECT
2568
2569=== modified file 'src/ubuntu/ubunturemoterunconfiguration.cpp'
2570--- src/ubuntu/ubunturemoterunconfiguration.cpp 2014-06-18 07:29:05 +0000
2571+++ src/ubuntu/ubunturemoterunconfiguration.cpp 2014-07-23 14:19:54 +0000
2572@@ -31,6 +31,7 @@
2573 #include <remotelinux/remotelinuxenvironmentaspect.h>
2574 #include <utils/qtcprocess.h>
2575 #include <cmakeprojectmanager/cmakeproject.h>
2576+#include <cmakeprojectmanager/cmakeprojectconstants.h>
2577
2578 #include <QFile>
2579 #include <QTextStream>
2580@@ -141,7 +142,7 @@
2581 m_appId.clear();
2582 m_clickPackage.clear();
2583
2584- QDir package_dir(target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR));
2585+ QDir package_dir(packageDir());
2586 if(!package_dir.exists()) {
2587 if(errorMessage)
2588 *errorMessage = tr("No packaging directory available, please check if the deploy configuration is correct.");
2589@@ -185,7 +186,8 @@
2590 return false;
2591
2592 QFileInfo commInfo(command);
2593- if(commInfo.completeBaseName().startsWith(QLatin1String("qmlscene"))) {
2594+ QString executor = commInfo.completeBaseName();
2595+ if(executor.startsWith(QStringLiteral("qmlscene"))) {
2596 ProjectExplorer::ToolChain* tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
2597 if(tc->type() != QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
2598 if(errorMessage)
2599@@ -198,12 +200,12 @@
2600 .arg(UbuntuClickTool::targetBasePath(clickTc->clickTarget()))
2601 .arg(clickTc->gnutriplet());
2602
2603- m_remoteExecutable = QLatin1String("/usr/bin/qmlscene");
2604- m_arguments = args;
2605- } else if(commInfo.completeBaseName().startsWith(QLatin1String("ubuntu-html5-app-launcher"))) {
2606- if(errorMessage)
2607- *errorMessage = tr("Run support for remote html projects not available");
2608- return false;
2609+ m_remoteExecutable = QStringLiteral("/usr/bin/qmlscene");
2610+ m_arguments = args;
2611+ } else if(executor.startsWith(QStringLiteral("ubuntu-html5-app-launcher"))
2612+ || executor.startsWith(QStringLiteral("webapp-container"))) {
2613+ m_remoteExecutable = QStringLiteral("");
2614+ m_arguments = args;
2615 } else {
2616 //looks like a application without a launcher
2617 CMakeProjectManager::CMakeProject* pro = static_cast<CMakeProjectManager::CMakeProject*> (target()->project());
2618@@ -261,5 +263,24 @@
2619 m_arguments = args;
2620 }
2621
2622+QString UbuntuRemoteRunConfiguration::packageDir() const
2623+{
2624+ ProjectExplorer::Project *p = target()->project();
2625+ if (p->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID)
2626+ return target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR);
2627+ else if (p->id() == Ubuntu::Constants::UBUNTUPROJECT_ID) {
2628+ if (!target()->activeBuildConfiguration()) {
2629+ //backwards compatibility, try to not crash QtC for old projects
2630+ //they did not create a buildconfiguration back then
2631+ QDir pDir(p->projectDirectory());
2632+ return p->projectDirectory()+QDir::separator()+
2633+ QStringLiteral("..")+QDir::separator()+
2634+ pDir.dirName()+QStringLiteral("_build")+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR);
2635+ } else
2636+ return target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR);
2637+ }
2638+ return QString();
2639+}
2640+
2641 } // namespace Internal
2642 } // namespace Ubuntu
2643
2644=== modified file 'src/ubuntu/ubunturemoterunconfiguration.h'
2645--- src/ubuntu/ubunturemoterunconfiguration.h 2014-06-18 07:29:05 +0000
2646+++ src/ubuntu/ubunturemoterunconfiguration.h 2014-07-23 14:19:54 +0000
2647@@ -59,6 +59,8 @@
2648 static Core::Id typeId ();
2649 void setArguments (const QStringList &args);
2650
2651+ QString packageDir () const;
2652+
2653 private:
2654 QString m_clickPackage;
2655 QString m_appId;
2656
2657=== modified file 'tests/manifest/manifest.pro'
2658--- tests/manifest/manifest.pro 2014-06-25 11:33:20 +0000
2659+++ tests/manifest/manifest.pro 2014-07-23 14:19:54 +0000
2660@@ -10,6 +10,7 @@
2661
2662 INCLUDEPATH += $${PLUGIN_SRC_ROOT}
2663 DEFINES += SRCDIR=\\\"$$PWD/\\\"
2664+DEFINES += IN_TEST_PROJECT
2665
2666 SOURCES += \
2667 tst_manifest.cpp \

Subscribers

People subscribed via source and target branches