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