Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qmake-support into lp:qtcreator-plugin-ubuntu
- qmake-support
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Zoltan Balogh |
Approved revision: | 314 |
Merged at revision: | 298 |
Proposed branch: | lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qmake-support |
Merge into: | lp:qtcreator-plugin-ubuntu |
Diff against target: |
1865 lines (+815/-245) 40 files modified
debian/qtcreator-plugin-ubuntu-common.install (+1/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.apparmor (+8/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.desktop (+7/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.pro (+21/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.qrc (+5/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.cpp (+14/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.qml (+56/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/deployment.pri (+5/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.json.in (+16/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.pro (+27/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/projectName.pro (+9/-0) share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/wizard.xml (+65/-0) share/qtcreator/ubuntu/scripts/qtc_chroot_qmake_legacy (+6/-4) share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py (+146/-0) share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py (+3/-2) src/ubuntu/clicktoolchain.cpp (+24/-6) src/ubuntu/ubuntu.pro (+3/-3) src/ubuntu/ubuntuclicktool.cpp (+79/-0) src/ubuntu/ubuntuclicktool.h (+6/-0) src/ubuntu/ubuntucmakecache.cpp (+1/-1) src/ubuntu/ubuntucmakemakestep.cpp (+1/-1) src/ubuntu/ubuntuconstants.h (+3/-2) src/ubuntu/ubuntucreatenewchrootdialog.cpp (+1/-0) src/ubuntu/ubuntudeploystepfactory.cpp (+4/-2) src/ubuntu/ubuntukitmanager.cpp (+6/-32) src/ubuntu/ubuntulocaldeployconfiguration.cpp (+1/-1) src/ubuntu/ubuntulocalrunconfiguration.cpp (+76/-45) src/ubuntu/ubuntulocalrunconfigurationfactory.cpp (+13/-8) src/ubuntu/ubuntumanifesteditorwidget.cpp (+13/-51) src/ubuntu/ubuntumanifesteditorwidget.h (+1/-2) src/ubuntu/ubuntupackagestep.cpp (+17/-7) src/ubuntu/ubuntupackagingwidget.cpp (+25/-8) src/ubuntu/ubuntuplugin.cpp (+4/-0) src/ubuntu/ubuntuprojectapplicationwizard.cpp (+33/-17) src/ubuntu/ubuntuprojectapplicationwizard.h (+2/-1) src/ubuntu/ubuntuprojecthelper.cpp (+56/-31) src/ubuntu/ubuntuprojecthelper.h (+5/-4) src/ubuntu/ubuntuqtversion.cpp (+4/-3) src/ubuntu/ubunturemotedeployconfiguration.cpp (+6/-3) src/ubuntu/ubunturemoterunconfiguration.cpp (+42/-11) |
To merge this branch: | bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qmake-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zoltan Balogh | Approve | ||
Review via email: mp+240839@code.launchpad.net |
Commit message
Make use of the new qmake-cross-armhf binary and add support for qmake
projects
Description of the change
Make use of the new qmake-cross-armhf binary and add support for qmake
projects
- 302. By Benjamin Zeller
-
fix legacy script calling
- 303. By Benjamin Zeller
-
Add qmake template and support in the plugin for handling it correctly
- 304. By Benjamin Zeller
-
Merge with trunk
- 305. By Benjamin Zeller
-
- use switch to specify click chroot name
- test if the command is available in the chroot (if cross qmake)
- get correct scriptpath to call legacy script - 306. By Benjamin Zeller
-
- Make desktop qmake target work correctly
- Handle more corner cases of cmake vs qmake
- rename UbuntuProjectGuesser to UbuntuProjectHe lper, since we don't
guess project types anymore - 307. By Benjamin Zeller
-
- Use a better comparation to find out if the gcc wrapper is obsolete
- 308. By Benjamin Zeller
-
Some fixes, correct qmake name
- 309. By Benjamin Zeller
-
Merge
- 310. By Benjamin Zeller
-
Compile error fix
- 311. By Benjamin Zeller
-
Fix packaging
- 312. By Benjamin Zeller
-
Fix launcher
- 313. By Benjamin Zeller
-
Do not ship qmake templates in a seperate category
- 314. By Benjamin Zeller
-
Qmake wizard should use the fw selection box too
Preview Diff
1 | === modified file 'debian/qtcreator-plugin-ubuntu-common.install' |
2 | --- debian/qtcreator-plugin-ubuntu-common.install 2014-10-14 09:33:05 +0000 |
3 | +++ debian/qtcreator-plugin-ubuntu-common.install 2014-11-21 08:06:27 +0000 |
4 | @@ -8,4 +8,5 @@ |
5 | usr/share/qtcreator/templates/wizards/ubuntu/goproject |
6 | usr/share/qtcreator/templates/wizards/ubuntu/share |
7 | usr/share/qtcreator/templates/wizards/ubuntu/simplei18n |
8 | +usr/share/qtcreator/templates/wizards/ubuntu/bin_app-qmake |
9 | usr/share/qtcreator/ubuntu |
10 | |
11 | === added directory 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake' |
12 | === added directory 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName' |
13 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.apparmor' |
14 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.apparmor 1970-01-01 00:00:00 +0000 |
15 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.apparmor 2014-11-21 08:06:27 +0000 |
16 | @@ -0,0 +1,8 @@ |
17 | +{ |
18 | + "policy_groups": [ |
19 | + "networking" |
20 | + ], |
21 | + "policy_version": 1.2 |
22 | +} |
23 | + |
24 | + |
25 | |
26 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.desktop' |
27 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.desktop 1970-01-01 00:00:00 +0000 |
28 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.desktop 2014-11-21 08:06:27 +0000 |
29 | @@ -0,0 +1,7 @@ |
30 | +[Desktop Entry] |
31 | +Name=%ClickHookName% |
32 | +Exec=%ClickHookName% |
33 | +Icon=%ClickHookName%/%ClickHookName%.png |
34 | +Terminal=false |
35 | +Type=Application |
36 | +X-Ubuntu-Touch=true |
37 | |
38 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.png' |
39 | Binary files share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.png 1970-01-01 00:00:00 +0000 and share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.png 2014-11-21 08:06:27 +0000 differ |
40 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.pro' |
41 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.pro 1970-01-01 00:00:00 +0000 |
42 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.pro 2014-11-21 08:06:27 +0000 |
43 | @@ -0,0 +1,21 @@ |
44 | +TEMPLATE = app |
45 | +TARGET = %ClickHookName% |
46 | + |
47 | +QT += qml quick |
48 | + |
49 | +SOURCES += main.cpp |
50 | + |
51 | +RESOURCES += %ClickHookName%.qrc |
52 | + |
53 | +OTHER_FILES += %ClickHookName%.apparmor \ |
54 | + %ClickHookName%.desktop \ |
55 | + %ClickHookName%.png |
56 | + |
57 | +#specify where the config files are installed to |
58 | +config_files.path = /%ClickHookName% |
59 | +config_files.files += $${OTHER_FILES} |
60 | +message($$config_files.files) |
61 | +INSTALLS+=config_files |
62 | + |
63 | +# Default rules for deployment. |
64 | +include(../deployment.pri) |
65 | |
66 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.qrc' |
67 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.qrc 1970-01-01 00:00:00 +0000 |
68 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/appName.qrc 2014-11-21 08:06:27 +0000 |
69 | @@ -0,0 +1,5 @@ |
70 | +<RCC> |
71 | + <qresource prefix="/"> |
72 | + <file>main.qml</file> |
73 | + </qresource> |
74 | +</RCC> |
75 | |
76 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.cpp' |
77 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.cpp 1970-01-01 00:00:00 +0000 |
78 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.cpp 2014-11-21 08:06:27 +0000 |
79 | @@ -0,0 +1,14 @@ |
80 | +#include <QGuiApplication> |
81 | +#include <QQmlApplicationEngine> |
82 | +#include <QQuickView> |
83 | + |
84 | +int main(int argc, char *argv[]) |
85 | +{ |
86 | + QGuiApplication app(argc, argv); |
87 | + |
88 | + QQuickView view; |
89 | + view.setSource(QUrl(QStringLiteral("qrc:///main.qml"))); |
90 | + view.setResizeMode(QQuickView::SizeRootObjectToView); |
91 | + view.show(); |
92 | + return app.exec(); |
93 | +} |
94 | |
95 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.qml' |
96 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.qml 1970-01-01 00:00:00 +0000 |
97 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/appName/main.qml 2014-11-21 08:06:27 +0000 |
98 | @@ -0,0 +1,56 @@ |
99 | +import QtQuick 2.0 |
100 | +import Ubuntu.Components 1.1 |
101 | + |
102 | +/*! |
103 | + \brief MainView with a Label and Button elements. |
104 | +*/ |
105 | + |
106 | +MainView { |
107 | + // objectName for functional testing purposes (autopilot-qt5) |
108 | + objectName: "mainView" |
109 | + |
110 | + // Note! applicationName needs to match the "name" field of the click manifest |
111 | + applicationName: "%ClickDomain:l%.%ProjectName:l%" |
112 | + |
113 | + /* |
114 | + This property enables the application to change orientation |
115 | + when the device is rotated. The default is false. |
116 | + */ |
117 | + //automaticOrientation: true |
118 | + |
119 | + // Removes the old toolbar and enables new features of the new header. |
120 | + useDeprecatedToolbar: false |
121 | + |
122 | + width: units.gu(100) |
123 | + height: units.gu(75) |
124 | + |
125 | + Page { |
126 | + title: i18n.tr("Simple") |
127 | + |
128 | + Column { |
129 | + spacing: units.gu(1) |
130 | + anchors { |
131 | + margins: units.gu(2) |
132 | + fill: parent |
133 | + } |
134 | + |
135 | + Label { |
136 | + id: label |
137 | + objectName: "label" |
138 | + |
139 | + text: i18n.tr("Hello..") |
140 | + } |
141 | + |
142 | + Button { |
143 | + objectName: "button" |
144 | + width: parent.width |
145 | + |
146 | + text: i18n.tr("Tap me!") |
147 | + |
148 | + onClicked: { |
149 | + label.text = i18n.tr("..world!") |
150 | + } |
151 | + } |
152 | + } |
153 | + } |
154 | +} |
155 | |
156 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/deployment.pri' |
157 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/deployment.pri 1970-01-01 00:00:00 +0000 |
158 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/deployment.pri 2014-11-21 08:06:27 +0000 |
159 | @@ -0,0 +1,5 @@ |
160 | +qt_install_libs = $$[QT_INSTALL_LIBS] |
161 | +target.path = /lib/$$basename(qt_install_libs)/bin |
162 | +export(target.path) |
163 | +INSTALLS += target |
164 | + |
165 | |
166 | === added directory 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest' |
167 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.json.in' |
168 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.json.in 1970-01-01 00:00:00 +0000 |
169 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.json.in 2014-11-21 08:06:27 +0000 |
170 | @@ -0,0 +1,16 @@ |
171 | +{ |
172 | + "name": "%ClickDomain:l%.%ProjectName:l%", |
173 | + "description": "description of %ProjectName%", |
174 | + "architecture": "@CLICK_ARCH@", |
175 | + "title": "%ProjectName%", |
176 | + "hooks": { |
177 | + "%ClickHookName%": { |
178 | + "apparmor": "%ClickHookName%/%ClickHookName%.apparmor", |
179 | + "desktop": "%ClickHookName%/%ClickHookName%.desktop" |
180 | + } |
181 | + }, |
182 | + "version": "0.1", |
183 | + "maintainer": "%ClickMaintainer%", |
184 | + "framework" : "%ClickFrameworkVersion%" |
185 | +} |
186 | + |
187 | |
188 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.pro' |
189 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.pro 1970-01-01 00:00:00 +0000 |
190 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/manifest/manifest.pro 2014-11-21 08:06:27 +0000 |
191 | @@ -0,0 +1,27 @@ |
192 | +#This creates the manifest.json file, it is the description file for the |
193 | +#click package. |
194 | + |
195 | +TEMPLATE = aux |
196 | + |
197 | +#figure out the current build architecture |
198 | +CLICK_ARCH=$$system(dpkg-architecture -qDEB_HOST_ARCH) |
199 | + |
200 | + |
201 | +# substitute the architecture in the manifest file |
202 | +manifest_file.output = manifest.json |
203 | +manifest_file.CONFIG += no_link \ |
204 | + add_inputs_as_makefile_deps\ |
205 | + target_predeps |
206 | +manifest_file.commands = sed s/@CLICK_ARCH@/$$CLICK_ARCH/g ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT} |
207 | +manifest_file.input = UBUNTU_MANIFEST_FILE |
208 | +QMAKE_EXTRA_COMPILERS += manifest_file |
209 | + |
210 | +#do not remove this line, it is required by the IDE even if you do |
211 | +#not substitute variables in the manifest file |
212 | +UBUNTU_MANIFEST_FILE = $$PWD/manifest.json.in |
213 | + |
214 | +#installation path of the manifest file |
215 | +mfile.path = / |
216 | +mfile.CONFIG += no_check_exist |
217 | +mfile.files += $$OUT_PWD/manifest.json |
218 | +INSTALLS+=mfile |
219 | |
220 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/projectName.pro' |
221 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/projectName.pro 1970-01-01 00:00:00 +0000 |
222 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/projectName.pro 2014-11-21 08:06:27 +0000 |
223 | @@ -0,0 +1,9 @@ |
224 | +#This is the basic qmake template for the Ubuntu-SDK |
225 | +#Now if you want to get started right click the project |
226 | +#and add the subproject you like (app,scope,helper,backend) |
227 | + |
228 | +TEMPLATE = subdirs |
229 | + |
230 | +SUBDIRS += %ClickHookName% \ |
231 | + manifest |
232 | + |
233 | |
234 | === added file 'share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/wizard.xml' |
235 | --- share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/wizard.xml 1970-01-01 00:00:00 +0000 |
236 | +++ share/qtcreator/templates/wizards/ubuntu/bin_app-qmake/wizard.xml 2014-11-21 08:06:27 +0000 |
237 | @@ -0,0 +1,65 @@ |
238 | +<?xml version="1.0" encoding="UTF-8"?> |
239 | +<wizard version="1" kind="project" firstpage="10" id="UbuntuAppSimpleQmake'" category="A.UbuntuProject" |
240 | + platformIndependent="true" |
241 | + class="ubuntu-project-qmake" |
242 | + featuresRequired="" |
243 | + > |
244 | + <icon>../share/ubuntu.png</icon> |
245 | + <description>Creates a C++ Ubuntu application project with a sample UI containing a Label and a Button. |
246 | + |
247 | +This templates is built using qmake. |
248 | +</description> |
249 | + <displayname>App with Simple UI (QMake)</displayname> |
250 | + <displaycategory>Ubuntu</displaycategory> |
251 | + <files> |
252 | + <file source="projectName.pro" target="%ProjectName%.pro" openproject="true"/> |
253 | + <file source="deployment.pri"/> |
254 | +<!-- MANIFEST PARTS --> |
255 | + <file source="manifest/manifest.json.in" openeditor="true"/> |
256 | + <file source="manifest/manifest.pro" openeditor="false"/> |
257 | +<!-- APP PARTS --> |
258 | + <file source="appName/appName.pro" target="%ClickHookName%/%ClickHookName%.pro" openeditor="false"/> |
259 | + <file source="appName/appName.qrc" target="%ClickHookName%/%ClickHookName%.qrc" openeditor="false"/> |
260 | + <file source="appName/appName.png" target="%ClickHookName%/%ClickHookName%.png" openeditor="false" binary="true"/> |
261 | + <file source="appName/main.qml" target="%ClickHookName%/main.qml" openeditor="true"/> |
262 | + <file source="appName/main.cpp" target="%ClickHookName%/main.cpp" openeditor="true"/> |
263 | + <file source="appName/appName.desktop" target="%ClickHookName%/%ClickHookName%.desktop" openeditor="false"/> |
264 | + <file source="appName/appName.apparmor" target="%ClickHookName%/%ClickHookName%.apparmor" openeditor="false"/> |
265 | + </files> |
266 | + |
267 | + <!-- Create a 2nd wizard page with click package parameters --> |
268 | + <fieldpagetitle>Click package parameters</fieldpagetitle> |
269 | + <fields> |
270 | + <field mandatory="true" name="ClickDomain"> |
271 | + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9.-]+$' |
272 | + defaulttext="" placeholdertext="Domain"/> |
273 | + <fielddescription>Domain:</fielddescription> |
274 | + </field> |
275 | + <field mandatory="true" name="ClickMaintainer"> |
276 | + <fieldcontrol class="QLineEdit" validator='^[^"]+$' |
277 | + defaulttext="" placeholdertext="Maintainer"/> |
278 | + <fielddescription>Maintainer:</fielddescription> |
279 | + </field> |
280 | + <field mandatory="true" name="ClickHookName"> |
281 | + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9.-]+$' |
282 | + defaulttext="app" placeholdertext="app hook name"/> |
283 | + <fielddescription>App name:</fielddescription> |
284 | + </field> |
285 | + <field name="ClickFrameworkVersion"> |
286 | + <fieldcontrol class="QComboBox" defaultindex="0"> |
287 | + <comboentries> |
288 | + <!-- Do not add any other frameworks here, they are populated at runtime, this is just a dummy framework to make sure we can find the combobox --> |
289 | + <comboentry value="ubuntu-sdk-dummy-framework"> |
290 | + <comboentrytext>Dummy Framework</comboentrytext> |
291 | + </comboentry> |
292 | + </comboentries> |
293 | + </fieldcontrol> |
294 | + <fielddescription>Framework:</fielddescription> |
295 | + </field> |
296 | + </fields> |
297 | + <validationrules> |
298 | + <validationrule condition='/^(.*)\s+<(.*@.*)>$/.test("%ClickMaintainer%")'> |
299 | + <message>Invalid format for maintainer (should be like "Joe Bloggs <joe.bloggs@isp.com>")</message> |
300 | + </validationrule> |
301 | + </validationrules> |
302 | +</wizard> |
303 | |
304 | === renamed file 'share/qtcreator/ubuntu/scripts/qtc_chroot_qmake' => 'share/qtcreator/ubuntu/scripts/qtc_chroot_qmake_legacy' |
305 | --- share/qtcreator/ubuntu/scripts/qtc_chroot_qmake 2014-09-29 11:28:19 +0000 |
306 | +++ share/qtcreator/ubuntu/scripts/qtc_chroot_qmake_legacy 2014-11-21 08:06:27 +0000 |
307 | @@ -15,10 +15,12 @@ |
308 | # |
309 | # Author: Zoltán Balogh <zoltan.balogh@canonical.com> |
310 | |
311 | - |
312 | -CLICK_CHROOT_ARCH="%1" |
313 | -CLICK_CHROOT_FW="%2" |
314 | -CLICK_CHROOT_NAME="%3" |
315 | +CLICK_CHROOT_FW=$1 |
316 | +shift |
317 | +CLICK_CHROOT_ARCH=$1 |
318 | +shift |
319 | +CLICK_CHROOT_NAME=$1 |
320 | +shift |
321 | |
322 | if [ -z "$CLICK_CHROOT_ARCH" ]; then |
323 | echo "Need to set CLICK_CHROOT_ARCH" |
324 | |
325 | === added file 'share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py' |
326 | --- share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py 1970-01-01 00:00:00 +0000 |
327 | +++ share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py 2014-11-21 08:06:27 +0000 |
328 | @@ -0,0 +1,146 @@ |
329 | +#!/usr/bin/env python3 |
330 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
331 | +# |
332 | +# QTC device chroot wrapper |
333 | +# Copyright (C) 2014 Canonical |
334 | +# |
335 | +# This program is free software: you can redistribute it and/or modify |
336 | +# it under the terms of the GNU General Public License as published by |
337 | +# the Free Software Foundation, either version 3 of the License, or |
338 | +# (at your option) any later version. |
339 | +# |
340 | +# This program is distributed in the hope that it will be useful, |
341 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
342 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
343 | +# GNU General Public License for more details. |
344 | +# |
345 | +# You should have received a copy of the GNU General Public License |
346 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
347 | +# |
348 | +# Author: Benjamin Zeller <benjamin.zeller@canonical.com> |
349 | + |
350 | +# This script basically starts the tool passed in sys.argv[0] in a chroot |
351 | +# and tries to map all path that are printed to the console to the host |
352 | +# os. It is primarily used to teach qtcreator how to handle the chroots |
353 | +# approach we use in Ubuntu. The tool needs to be in PATH when logged into |
354 | +# the chroot. All arguments are forwarded |
355 | + |
356 | +import sys |
357 | +import os |
358 | +import shutil |
359 | +import subprocess |
360 | +import select |
361 | +import re |
362 | +import fcntl |
363 | +import uuid |
364 | +import signal |
365 | + |
366 | +#find out the directory holding the link |
367 | +dirname = os.path.basename(os.path.dirname(os.path.abspath(sys.argv[0]))) |
368 | +idx = dirname.rfind("-") |
369 | +if(idx is -1): |
370 | + print("The parent directory must contain the click chroot name (e.g ubuntu-sdk-14.10-armhf)") |
371 | + sys.exit(1) |
372 | + |
373 | +#find out the path this script is in, required for local plugin installation |
374 | +scriptpath = os.path.dirname(os.path.realpath(__file__)) |
375 | + |
376 | +#@BUG get this dynamically |
377 | +chroot_name_prefix = "click" |
378 | + |
379 | +architecture = dirname[idx+1:] |
380 | +framework = dirname[0:idx] |
381 | +session_id = str(uuid.uuid4()) |
382 | + |
383 | +args = sys.argv[1:] |
384 | +command = os.path.basename(sys.argv[0]) |
385 | + |
386 | +if (command.startswith("qt5-qmake-cross")): |
387 | + command_path="/var/lib/schroot/chroots/"+chroot_name_prefix+"-"+dirname+"/usr/bin/"+command |
388 | + if (not os.path.isfile(command_path)): |
389 | + legacy_script = scriptpath+"/qtc_chroot_qmake_legacy" |
390 | + success = subprocess.call(["/bin/bash",legacy_script,framework,architecture,chroot_name_prefix]+args,stdout=sys.stdout,stderr=sys.stderr) |
391 | + sys.exit(success) |
392 | + |
393 | +subproc = None |
394 | + |
395 | +click = shutil.which("click") |
396 | + |
397 | +if( click is None ): |
398 | + print("Could not find click in the path, please make sure it is installed") |
399 | + sys.exit(1) |
400 | + |
401 | +def _doMapAllPaths (matchobj): |
402 | + return matchobj.group(1)+"/var/lib/schroot/chroots/"+chroot_name_prefix+"-"+dirname+"/"+matchobj.group(2) |
403 | + |
404 | +def mapPaths (text): |
405 | + paths = ["var","bin","boot","dev","etc","lib","lib64","media","mnt","opt","proc","root","run","sbin","srv","sys","usr"] |
406 | + for path in paths: |
407 | + text = re.sub("(^|[^\w+]|\s+|-\w)\/("+path+")", _doMapAllPaths , text) |
408 | + return text |
409 | + |
410 | +def exit_gracefully(arg1,arg2): |
411 | + if(subproc is not None): |
412 | + subproc.kill() |
413 | + subprocess.call([click, "chroot","-a",architecture,"-f",framework,"-n",chroot_name_prefix,"end-session",session_id],stdout=subprocess.DEVNULL) |
414 | + sys.exit(1) |
415 | + |
416 | +signal.signal(signal.SIGTERM, exit_gracefully) |
417 | +signal.signal(signal.SIGINT , exit_gracefully) |
418 | +signal.signal(signal.SIGHUP , exit_gracefully) |
419 | + |
420 | +success = subprocess.call([click, "chroot","-a",architecture,"-f",framework,"-n",chroot_name_prefix,"begin-session",session_id],stdout=subprocess.DEVNULL) |
421 | +subproc = subprocess.Popen([click, "chroot","-a",architecture,"-f",framework,"-n",chroot_name_prefix,"run","-n",session_id]+[command]+args,stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
422 | + |
423 | +stdout = "" |
424 | +stderr = "" |
425 | + |
426 | +#even though after select a read should never block, it can happen sometimes |
427 | +#so better make them nonblocking |
428 | +stdoutfd = subproc.stdout.fileno() |
429 | +fl = fcntl.fcntl(stdoutfd, fcntl.F_GETFL) |
430 | +fcntl.fcntl(stdoutfd, fcntl.F_SETFL, fl | os.O_NONBLOCK) |
431 | + |
432 | +stderrfd = subproc.stderr.fileno() |
433 | +fl = fcntl.fcntl(stderrfd, fcntl.F_GETFL) |
434 | +fcntl.fcntl(stderrfd, fcntl.F_SETFL, fl | os.O_NONBLOCK) |
435 | + |
436 | +while True: |
437 | + reads = [stdoutfd, stderrfd] |
438 | + ret = select.select(reads, [], []) |
439 | + |
440 | + for fd in ret[0]: |
441 | + if fd == subproc.stdout.fileno(): |
442 | + read = subproc.stdout.read() |
443 | + stdout += read.decode() |
444 | + try: |
445 | + while(True): |
446 | + idx = stdout.index("\n") |
447 | + line = stdout[0:idx+1] |
448 | + stdout = stdout[idx+1:] |
449 | + sys.stdout.write(mapPaths(line)) |
450 | + except ValueError: |
451 | + pass |
452 | + if fd == subproc.stderr.fileno(): |
453 | + read = subproc.stderr.read() |
454 | + stderr += read.decode() |
455 | + try: |
456 | + while(True): |
457 | + idx = stderr.index("\n") |
458 | + line = stderr[0:idx+1] |
459 | + stderr = stderr[idx+1:] |
460 | + sys.stderr.write(mapPaths(line)) |
461 | + except ValueError: |
462 | + pass |
463 | + |
464 | + if subproc.poll() != None: |
465 | + break |
466 | + |
467 | +if(len(stdout) != 0): |
468 | + sys.stdout.write(mapPaths(stdout)) |
469 | + |
470 | +if(len(stderr) != 0): |
471 | + sys.stderr.write(mapPaths(stderr)) |
472 | + |
473 | +subprocess.call([click, "chroot","-a",architecture,"-f",framework,"-n",chroot_name_prefix,"end-session",session_id],stdout=subprocess.DEVNULL) |
474 | +sys.exit(subproc.returncode) |
475 | |
476 | === modified file 'share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py' |
477 | --- share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py 2014-10-06 16:51:53 +0000 |
478 | +++ share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py 2014-11-21 08:06:27 +0000 |
479 | @@ -353,6 +353,7 @@ |
480 | app_id = None |
481 | debug_file_name = None |
482 | app_mode = None |
483 | +powerd = None |
484 | |
485 | loop = GLib.MainLoop() |
486 | runner = None |
487 | @@ -375,7 +376,7 @@ |
488 | print("Sdk-Launcher> Installing application .....",flush=True) |
489 | #we have all informations, now install the click package |
490 | success = subprocess.call( |
491 | - ["pkcon","--allow-untrusted","install-local",options.clickPck,"-p"],stdout=subprocess.DEVNULL) |
492 | + ["pkcon","--allow-untrusted","install-local",options.clickPck,"-p"]) |
493 | if success != 0: |
494 | print("Sdk-Launcher> Installing the application failed",flush=True) |
495 | sys.exit(1) |
496 | @@ -406,7 +407,7 @@ |
497 | debug_file_name = tmp_dir+app_id+"_debug.json" |
498 | |
499 | if(not os.path.exists(tmp_dir)): |
500 | - os.mkdir(tmp_dir) |
501 | + os.makedirs(tmp_dir) |
502 | |
503 | print("Sdk-Launcher> AppId: "+app_id,flush=True) |
504 | print("Sdk-Launcher> Architecture: "+package_arch,flush=True,end="") |
505 | |
506 | === modified file 'src/ubuntu/clicktoolchain.cpp' |
507 | --- src/ubuntu/clicktoolchain.cpp 2014-06-17 09:25:03 +0000 |
508 | +++ src/ubuntu/clicktoolchain.cpp 2014-11-21 08:06:27 +0000 |
509 | @@ -24,6 +24,8 @@ |
510 | #include <QDebug> |
511 | #include <QVariant> |
512 | #include <QVariantMap> |
513 | +#include <QFile> |
514 | +#include <QFileInfo> |
515 | |
516 | namespace Ubuntu { |
517 | namespace Internal { |
518 | @@ -68,7 +70,8 @@ |
519 | |
520 | QList<Utils::FileName> ClickToolChain::suggestedMkspecList() const |
521 | { |
522 | - return QList<Utils::FileName>()<< Utils::FileName::fromString(QLatin1String("linux-g++")); |
523 | + return ProjectExplorer::GccToolChain::suggestedMkspecList(); |
524 | + //return QList<Utils::FileName>()<< Utils::FileName::fromString(QLatin1String("linux-g++")); |
525 | } |
526 | |
527 | Utils::FileName ClickToolChain::suggestedDebugger() const |
528 | @@ -101,8 +104,7 @@ |
529 | |
530 | QString ClickToolChain::makeCommand(const Utils::Environment &) const |
531 | { |
532 | - QString command = QString::fromLatin1(Constants::UBUNTU_CLICK_MAKE_WRAPPER).arg(Constants::UBUNTU_SCRIPTPATH); |
533 | - return command; |
534 | + return UbuntuClickTool::findOrCreateMakeWrapper(clickTarget()); |
535 | } |
536 | |
537 | bool ClickToolChain::operator ==(const ProjectExplorer::ToolChain &tc) const |
538 | @@ -199,8 +201,8 @@ |
539 | , m_clickTarget(target) |
540 | { |
541 | setCompilerCommand(Utils::FileName::fromString( |
542 | - QString::fromLatin1(Constants::UBUNTU_CLICK_GCC_WRAPPER) |
543 | - .arg(Constants::UBUNTU_SCRIPTPATH))); |
544 | + UbuntuClickTool::findOrCreateGccWrapper(target) |
545 | + )); |
546 | |
547 | setDisplayName(QString::fromLatin1("Ubuntu GCC (%1-%2-%3)") |
548 | .arg(ProjectExplorer::Abi::toString(targetAbi().architecture())) |
549 | @@ -238,8 +240,21 @@ |
550 | ProjectExplorer::ToolChain *ClickToolChainFactory::restore(const QVariantMap &data) |
551 | { |
552 | ClickToolChain *tc = new ClickToolChain(); |
553 | - if (tc->fromMap(data)) |
554 | + if (tc->fromMap(data)) { |
555 | + QFileInfo compilerCommand(tc->compilerCommand().toString()); |
556 | + //deprecated wrapper script, update to use the new one |
557 | + if(compilerCommand.fileName() == QString::fromLatin1(Constants::UBUNTU_CLICK_GCC_WRAPPER)) { |
558 | + QString wrapper = UbuntuClickTool::findOrCreateGccWrapper(tc->clickTarget()); |
559 | + |
560 | + //if we cannot create a good wrapper its better to drop the ToolChain |
561 | + if(wrapper.isNull()) { |
562 | + delete tc; |
563 | + return 0; |
564 | + } |
565 | + tc->setCompilerCommand(Utils::FileName::fromString(wrapper)); |
566 | + } |
567 | return tc; |
568 | + } |
569 | |
570 | delete tc; |
571 | return 0; |
572 | @@ -257,6 +272,9 @@ |
573 | || target.maybeBroken) |
574 | continue; |
575 | |
576 | + if(UbuntuClickTool::findOrCreateGccWrapper(target).isEmpty()) |
577 | + continue; |
578 | + |
579 | ClickToolChain* tc = new ClickToolChain(target, ProjectExplorer::ToolChain::AutoDetection); |
580 | toolChains.append(tc); |
581 | } |
582 | |
583 | === modified file 'src/ubuntu/ubuntu.pro' |
584 | --- src/ubuntu/ubuntu.pro 2014-11-07 12:02:15 +0000 |
585 | +++ src/ubuntu/ubuntu.pro 2014-11-21 08:06:27 +0000 |
586 | @@ -103,7 +103,6 @@ |
587 | ubuntucmakemakestep.cpp \ |
588 | ubuntuemulatornotifier.cpp \ |
589 | localportsmanager.cpp \ |
590 | - ubuntuprojectguesser.cpp \ |
591 | ubuntulocaldeployconfiguration.cpp \ |
592 | ubunturemotedeployconfiguration.cpp \ |
593 | ubuntulocalrunconfigurationfactory.cpp \ |
594 | @@ -134,7 +133,8 @@ |
595 | ubuntueditorfactory.cpp \ |
596 | ubuntucmakecache.cpp \ |
597 | ubuntutestcontrol.cpp \ |
598 | - ubuntupackageoutputparser.cpp |
599 | + ubuntupackageoutputparser.cpp \ |
600 | + ubuntuprojecthelper.cpp |
601 | |
602 | HEADERS += \ |
603 | ubuntuplugin.h \ |
604 | @@ -187,7 +187,6 @@ |
605 | ubuntucmakemakestep.h \ |
606 | ubuntuemulatornotifier.h \ |
607 | localportsmanager.h \ |
608 | - ubuntuprojectguesser.h \ |
609 | ubuntulocaldeployconfiguration.h \ |
610 | ubunturemotedeployconfiguration.h \ |
611 | ubuntulocalrunconfigurationfactory.h \ |
612 | @@ -218,5 +217,6 @@ |
613 | ubuntucmakecache.h \ |
614 | ubuntutestcontrol.h \ |
615 | ubuntupackageoutputparser.h \ |
616 | + ubuntuprojecthelper.h \ |
617 | ubuntuscopefinalizer.h |
618 | |
619 | |
620 | === modified file 'src/ubuntu/ubuntuclicktool.cpp' |
621 | --- src/ubuntu/ubuntuclicktool.cpp 2014-11-03 14:18:52 +0000 |
622 | +++ src/ubuntu/ubuntuclicktool.cpp 2014-11-21 08:06:27 +0000 |
623 | @@ -32,6 +32,8 @@ |
624 | #include <QTimer> |
625 | #include <QFile> |
626 | #include <QStandardPaths> |
627 | +#include <QDir> |
628 | +#include <QFile> |
629 | #include <QJsonDocument> |
630 | #include <QJsonObject> |
631 | #include <QJsonParseError> |
632 | @@ -391,6 +393,71 @@ |
633 | #endif |
634 | } |
635 | |
636 | +QString UbuntuClickTool::findOrCreateGccWrapper (const UbuntuClickTool::Target &target) |
637 | +{ |
638 | + QString compiler; |
639 | + |
640 | + if(target.architecture == QStringLiteral("armhf")) |
641 | + compiler = QStringLiteral("arm-linux-gnueabihf-gcc"); |
642 | + else if(target.architecture == QStringLiteral("i386")) |
643 | + compiler = QStringLiteral("i686-linux-gnu-gcc"); |
644 | + else if(target.architecture == QStringLiteral("amd64")) |
645 | + compiler = QStringLiteral("x86_64-linux-gnu-gcc"); |
646 | + else { |
647 | + qWarning()<<"Invalid architecture, can not create gcc wrapper link"; |
648 | + return QString(); |
649 | + } |
650 | + |
651 | + return UbuntuClickTool::findOrCreateToolWrapper(compiler,target); |
652 | +} |
653 | + |
654 | +QString UbuntuClickTool::findOrCreateQMakeWrapper (const UbuntuClickTool::Target &target) |
655 | +{ |
656 | + QString qmake; |
657 | + |
658 | + if(target.architecture == QStringLiteral("armhf")) |
659 | + qmake = QStringLiteral("qt5-qmake-arm-linux-gnueabihf"); |
660 | + else |
661 | + qmake = QStringLiteral("qmake"); |
662 | + |
663 | + return UbuntuClickTool::findOrCreateToolWrapper(qmake,target); |
664 | +} |
665 | + |
666 | +QString UbuntuClickTool::findOrCreateMakeWrapper (const UbuntuClickTool::Target &target) |
667 | +{ |
668 | + return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target); |
669 | +} |
670 | + |
671 | +QString UbuntuClickTool::findOrCreateToolWrapper (const QString &tool, const UbuntuClickTool::Target &target) |
672 | +{ |
673 | + QString baseDir = QStringLiteral("%1/ubuntu-sdk/%2-%3").arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)) |
674 | + .arg(target.framework) |
675 | + .arg(target.architecture); |
676 | + |
677 | + QDir d(baseDir); |
678 | + if(!d.exists()) { |
679 | + if(!d.mkpath(baseDir)){ |
680 | + qWarning()<<"Could not create config directory."; |
681 | + return QString(); |
682 | + } |
683 | + } |
684 | + |
685 | + QString toolWrapper = (Utils::FileName::fromString(baseDir).appendPath(tool).toString()); |
686 | + if(!QFile::exists(toolWrapper)) { |
687 | + //in case of a broken link QFile::exists also will return false |
688 | + //lets try to delete it and ignore the error in case the file |
689 | + //simply does not exist |
690 | + QFile::remove(toolWrapper); |
691 | + if(!QFile::link(QString::fromLatin1(Constants::UBUNTU_CLICK_CHROOT_WRAPPER) |
692 | + .arg(Constants::UBUNTU_SCRIPTPATH),toolWrapper)) { |
693 | + qWarning()<<"Unable to create link for the tool wrapper: "<<toolWrapper; |
694 | + return QString(); |
695 | + } |
696 | + |
697 | + } |
698 | + return toolWrapper; |
699 | +} |
700 | + |
701 | QDebug operator<<(QDebug dbg, const UbuntuClickTool::Target& t) |
702 | { |
703 | dbg.nospace() << "("<<"series: "<<t.series<<" " |
704 | @@ -562,6 +629,18 @@ |
705 | |
706 | QString UbuntuClickFrameworkProvider::frameworkPolicy(const QString &fw) const |
707 | { |
708 | +#if 0 |
709 | + QProcess proc; |
710 | + proc.setProgram(QStringLiteral("aa-clickquery")); |
711 | + proc.setArguments(QStringList{ |
712 | + QStringLiteral("--click-framework=%1").arg(fw), |
713 | + QStringLiteral("--query=policy_version")}); |
714 | + proc.start(); |
715 | + proc.waitForFinished(); |
716 | + if(proc.exitCode() == 0 && proc.exitStatus() == QProcess::NormalExit) { |
717 | + return QString::fromUtf8(proc.readAllStandardOutput(); |
718 | + } |
719 | +#endif |
720 | QString base = getBaseFramework(fw); |
721 | if(m_policyCache.contains(base)) |
722 | return m_policyCache[base]; |
723 | |
724 | === modified file 'src/ubuntu/ubuntuclicktool.h' |
725 | --- src/ubuntu/ubuntuclicktool.h 2014-11-03 14:18:52 +0000 |
726 | +++ src/ubuntu/ubuntuclicktool.h 2014-11-21 08:06:27 +0000 |
727 | @@ -74,6 +74,12 @@ |
728 | |
729 | static QString targetBasePath (const Target& target); |
730 | static bool getTargetFromUser (Target* target, const QString &framework=QString()); |
731 | + static QStringList getSupportedFrameworks (const Target *target); |
732 | + static QString getMostRecentFramework ( const QString &subFramework, const Target *target ); |
733 | + static QString findOrCreateGccWrapper(const UbuntuClickTool::Target &target); |
734 | + static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target); |
735 | + static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target); |
736 | + static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target); |
737 | |
738 | static bool targetExists (const Target& target); |
739 | static QList<Target> listAvailableTargets (const QString &framework=QString()); |
740 | |
741 | === modified file 'src/ubuntu/ubuntucmakecache.cpp' |
742 | --- src/ubuntu/ubuntucmakecache.cpp 2014-08-20 07:38:07 +0000 |
743 | +++ src/ubuntu/ubuntucmakecache.cpp 2014-11-21 08:06:27 +0000 |
744 | @@ -37,7 +37,7 @@ |
745 | QVariant UbuntuCMakeCache::getValue(const QString &key, ProjectExplorer::BuildConfiguration *bc, const QVariant defaultValue) |
746 | { |
747 | UbuntuCMakeCache *inst = instance(); |
748 | - if(!inst) |
749 | + if(!inst || !bc) |
750 | return defaultValue; |
751 | |
752 | Utils::FileName cacheFile = bc->buildDirectory().appendPath(QStringLiteral("CMakeCache.txt")); |
753 | |
754 | === modified file 'src/ubuntu/ubuntucmakemakestep.cpp' |
755 | --- src/ubuntu/ubuntucmakemakestep.cpp 2014-08-21 16:56:53 +0000 |
756 | +++ src/ubuntu/ubuntucmakemakestep.cpp 2014-11-21 08:06:27 +0000 |
757 | @@ -17,7 +17,7 @@ |
758 | */ |
759 | #include "ubuntucmakemakestep.h" |
760 | #include "ubuntuconstants.h" |
761 | -#include "ubuntuprojectguesser.h" |
762 | +#include "ubuntuprojecthelper.h" |
763 | #include "clicktoolchain.h" |
764 | #include "ubuntupackagestep.h" |
765 | |
766 | |
767 | === modified file 'src/ubuntu/ubuntuconstants.h' |
768 | --- src/ubuntu/ubuntuconstants.h 2014-10-31 16:58:14 +0000 |
769 | +++ src/ubuntu/ubuntuconstants.h 2014-11-21 08:06:27 +0000 |
770 | @@ -519,8 +519,9 @@ |
771 | const char UBUNTU_CLICK_CMAKE_BC_ID[] = "UbuntuProjectManager.UbuntuCMake.BuildConfiguration"; |
772 | const char UBUNTU_CLICK_CMAKE_MAKESTEP_ID[] = "UbuntuProjectManager.UbuntuCMake.MakeStep"; |
773 | const char UBUNTU_CLICK_CMAKE_WRAPPER[] = "%0/qtc_chroot_cmake2"; |
774 | -const char UBUNTU_CLICK_MAKE_WRAPPER[] = "%0/qtc_chroot_make2"; |
775 | -const char UBUNTU_CLICK_GCC_WRAPPER[] = "%0/qtc_chroot_gcc"; |
776 | +const char UBUNTU_CLICK_MAKE_WRAPPER[] = "%0/qtc_chroot_make2"; //deprecated |
777 | +const char UBUNTU_CLICK_GCC_WRAPPER[] = "qtc_chroot_gcc"; //deprecated |
778 | +const char UBUNTU_CLICK_CHROOT_WRAPPER[] = "%0/qtc_chroot_wrapper.py"; |
779 | const char UBUNTU_CLICK_HTML_BC_ID[] = "UbuntuProjectManager.UbuntuHTML5.BuildConfiguration"; |
780 | const char UBUNTU_CLICK_QML_BC_ID[] = "UbuntuProjectManager.UbuntuQml.BuildConfiguration"; |
781 | //Devicesupport |
782 | |
783 | === modified file 'src/ubuntu/ubuntucreatenewchrootdialog.cpp' |
784 | --- src/ubuntu/ubuntucreatenewchrootdialog.cpp 2014-07-31 09:41:18 +0000 |
785 | +++ src/ubuntu/ubuntucreatenewchrootdialog.cpp 2014-11-21 08:06:27 +0000 |
786 | @@ -30,6 +30,7 @@ |
787 | //lists all currently supported targets by the plugin |
788 | const char* UBUNTU_CLICK_SUPPORTED_TARGETS[][3] = { |
789 | //Series Framework Displayname |
790 | + {"vivid","ubuntu-sdk-15.04","Framework-15.04"}, |
791 | {"utopic","ubuntu-sdk-14.10","Framework-14.10"}, |
792 | {"trusty","ubuntu-sdk-14.04","Framework-14.04"}, |
793 | {"saucy" ,"ubuntu-sdk-13.10","Framework-13.10"}, |
794 | |
795 | === modified file 'src/ubuntu/ubuntudeploystepfactory.cpp' |
796 | --- src/ubuntu/ubuntudeploystepfactory.cpp 2014-08-21 16:56:53 +0000 |
797 | +++ src/ubuntu/ubuntudeploystepfactory.cpp 2014-11-21 08:06:27 +0000 |
798 | @@ -1,5 +1,5 @@ |
799 | #include "ubuntudeploystepfactory.h" |
800 | -#include "ubuntuprojectguesser.h" |
801 | +#include "ubuntuprojecthelper.h" |
802 | #include "ubuntuconstants.h" |
803 | #include "ubuntudirectuploadstep.h" |
804 | #include "ubuntupackagestep.h" |
805 | @@ -17,6 +17,7 @@ |
806 | #include <qmlprojectmanager/qmlprojectconstants.h> |
807 | |
808 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
809 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
810 | |
811 | namespace Ubuntu { |
812 | namespace Internal { |
813 | @@ -36,6 +37,7 @@ |
814 | bool isCMake = parent->target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID; |
815 | bool isHTML = parent->target()->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID; |
816 | bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject"; |
817 | + bool isQMake = parent->target()->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID; |
818 | |
819 | if (isRemote) { |
820 | //IF we have a remote device we just support a ubuntu toolchain |
821 | @@ -44,7 +46,7 @@ |
822 | return types; |
823 | } |
824 | |
825 | - if(isRemote && ( isHTML || isQML || isCMake) ) |
826 | + if(isRemote && ( isHTML || isQML || isCMake || isQMake ) ) |
827 | types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID |
828 | << Constants::UBUNTU_CLICK_PACKAGESTEP_ID; |
829 | |
830 | |
831 | === modified file 'src/ubuntu/ubuntukitmanager.cpp' |
832 | --- src/ubuntu/ubuntukitmanager.cpp 2014-09-29 11:28:19 +0000 |
833 | +++ src/ubuntu/ubuntukitmanager.cpp 2014-11-21 08:06:27 +0000 |
834 | @@ -22,6 +22,7 @@ |
835 | #include <QMessageBox> |
836 | #include <QRegularExpression> |
837 | #include <QTextStream> |
838 | +#include <QStandardPaths> |
839 | |
840 | namespace Ubuntu { |
841 | namespace Internal { |
842 | @@ -72,43 +73,17 @@ |
843 | UbuntuQtVersion *UbuntuKitManager::createOrFindQtVersion(ClickToolChain *tc) |
844 | { |
845 | |
846 | - QString qmakePath = QStringLiteral("%1/.config/ubuntu-sdk/qmake-%2-%3-%4") |
847 | - .arg(QDir::homePath()) |
848 | - .arg(tc->clickTarget().framework) |
849 | - .arg(tc->clickTarget().architecture) |
850 | - .arg(UbuntuClickTool::clickChrootSuffix()); |
851 | - |
852 | + QString qmakePath = UbuntuClickTool::findOrCreateQMakeWrapper(tc->clickTarget()); |
853 | if(!QFile::exists(qmakePath)) { |
854 | - QFile qmakeTemplate(Constants::UBUNTU_RESOURCE_PATH+QStringLiteral("/ubuntu/scripts/qtc_chroot_qmake")); |
855 | - if(qmakeTemplate.open(QIODevice::ReadOnly)) { |
856 | - |
857 | - QTextStream in(&qmakeTemplate); |
858 | - QString templ = in.readAll(); |
859 | - |
860 | - templ = templ |
861 | - .arg(tc->clickTarget().architecture) |
862 | - .arg(tc->clickTarget().framework) |
863 | - .arg(UbuntuClickTool::clickChrootSuffix()); |
864 | - |
865 | - |
866 | - QFile qmakeScript(qmakePath); |
867 | - |
868 | - qmakeScript.open(QIODevice::WriteOnly); |
869 | - qmakeScript.setPermissions(QFile::ExeUser | QFile::ReadUser | QFile::ReadGroup); |
870 | - |
871 | - { |
872 | - QTextStream out(&qmakeScript); |
873 | - out << templ; |
874 | - } |
875 | - |
876 | - qmakeScript.close(); |
877 | - } |
878 | + return 0; |
879 | } else { |
880 | //try to find a already existing Qt Version for this chroot |
881 | foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) { |
882 | if (qtVersion->type() != QLatin1String(Constants::UBUNTU_QTVERSION_TYPE)) |
883 | continue; |
884 | - if (qtVersion->qmakeCommand().toFileInfo() == QFileInfo(qmakePath)) |
885 | + |
886 | + qDebug()<<qtVersion->qmakeCommand().toFileInfo().absoluteFilePath(); |
887 | + if (qtVersion->qmakeCommand().toFileInfo().absoluteFilePath() == QFileInfo(qmakePath).absoluteFilePath()) |
888 | return static_cast<UbuntuQtVersion*> (qtVersion); |
889 | } |
890 | } |
891 | @@ -197,7 +172,6 @@ |
892 | //we need to remove that QtVersion |
893 | QFile::remove(ver->qmakeCommand().toString()); |
894 | QtSupport::QtVersionManager::removeVersion(ver); |
895 | - |
896 | } |
897 | } |
898 | |
899 | |
900 | === modified file 'src/ubuntu/ubuntulocaldeployconfiguration.cpp' |
901 | --- src/ubuntu/ubuntulocaldeployconfiguration.cpp 2014-08-21 16:56:53 +0000 |
902 | +++ src/ubuntu/ubuntulocaldeployconfiguration.cpp 2014-11-21 08:06:27 +0000 |
903 | @@ -16,7 +16,7 @@ |
904 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> |
905 | */ |
906 | #include "ubuntulocaldeployconfiguration.h" |
907 | -#include "ubuntuprojectguesser.h" |
908 | +#include "ubuntuprojecthelper.h" |
909 | #include "ubuntuconstants.h" |
910 | #include "ubuntucmakemakestep.h" |
911 | #include "ubuntupackagestep.h" |
912 | |
913 | === modified file 'src/ubuntu/ubuntulocalrunconfiguration.cpp' |
914 | --- src/ubuntu/ubuntulocalrunconfiguration.cpp 2014-09-10 06:58:03 +0000 |
915 | +++ src/ubuntu/ubuntulocalrunconfiguration.cpp 2014-11-21 08:06:27 +0000 |
916 | @@ -18,7 +18,7 @@ |
917 | |
918 | #include "ubuntulocalrunconfiguration.h" |
919 | #include "ubuntuproject.h" |
920 | -#include "ubuntuprojectguesser.h" |
921 | +#include "ubuntuprojecthelper.h" |
922 | #include "ubuntuclickmanifest.h" |
923 | #include "ubunturemoterunconfiguration.h" |
924 | #include "ubuntucmakecache.h" |
925 | @@ -32,6 +32,9 @@ |
926 | #include <utils/qtcprocess.h> |
927 | #include <cmakeprojectmanager/cmakeproject.h> |
928 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
929 | +#include <qmakeprojectmanager/qmakeproject.h> |
930 | +#include <qmakeprojectmanager/qmakenodes.h> |
931 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
932 | using namespace Ubuntu::Internal; |
933 | |
934 | enum { |
935 | @@ -143,12 +146,12 @@ |
936 | QRegularExpression desktopFinder = QRegularExpression(QString::fromLatin1("^%1$") |
937 | .arg(desktopFileName)); |
938 | |
939 | - QFileInfo desktopInfo = UbuntuProjectGuesser::findFileRecursive(config->target()->activeBuildConfiguration()->buildDirectory(), |
940 | + QFileInfo desktopInfo = UbuntuProjectHelper::findFileRecursive(config->target()->activeBuildConfiguration()->buildDirectory(), |
941 | desktopFinder).toFileInfo(); |
942 | if (!desktopInfo.exists()) { |
943 | |
944 | //search again in the project directory |
945 | - desktopInfo = UbuntuProjectGuesser::findFileRecursive(Utils::FileName::fromString(config->target()->project()->projectDirectory()), |
946 | + desktopInfo = UbuntuProjectHelper::findFileRecursive(Utils::FileName::fromString(config->target()->project()->projectDirectory()), |
947 | desktopFinder).toFileInfo(); |
948 | |
949 | if(!desktopInfo.exists()) |
950 | @@ -158,16 +161,17 @@ |
951 | }; |
952 | |
953 | //first lets check if the informations in the manifest file are helpful |
954 | - QVariant manifestPath = UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_MANIFEST_PATH"), |
955 | - config->target()->activeBuildConfiguration(), |
956 | - QStringLiteral("manifest.json")); |
957 | + QString manifestPath = UbuntuProjectHelper::getManifestPath(config->target(),QStringLiteral("manifest.json")); |
958 | |
959 | + //make the path relative to the project dir |
960 | + QDir projectDirDir(projectDir.toString()); |
961 | + manifestPath = projectDirDir.relativeFilePath(manifestPath); |
962 | |
963 | //search for the manifest file in the project dir AND in the builddir |
964 | QList<Utils::FileName> searchPaths{ |
965 | - projectDir.appendPath(manifestPath.toString()), |
966 | + projectDir.appendPath(manifestPath), |
967 | config->target()->activeBuildConfiguration()->buildDirectory() |
968 | - .appendPath(QFileInfo(manifestPath.toString()).path()) |
969 | + .appendPath(QFileInfo(manifestPath).path()) |
970 | .appendPath(QStringLiteral("manifest.json")) |
971 | }; |
972 | |
973 | @@ -331,7 +335,7 @@ |
974 | return false; |
975 | } |
976 | |
977 | - QFileInfo mainFileInfo = UbuntuProjectGuesser::findFileRecursive(Utils::FileName::fromString(target()->project()->projectDirectory()), |
978 | + QFileInfo mainFileInfo = UbuntuProjectHelper::findFileRecursive(Utils::FileName::fromString(target()->project()->projectDirectory()), |
979 | QString::fromLatin1("^%1$").arg(mainQml)).toFileInfo(); |
980 | |
981 | if(!mainFileInfo.exists()) { |
982 | @@ -352,25 +356,38 @@ |
983 | */ |
984 | } else { |
985 | //looks like a application without a launcher |
986 | - CMakeProjectManager::CMakeProject* proj = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
987 | - QList<CMakeProjectManager::CMakeBuildTarget> targets = proj->buildTargets(); |
988 | - foreach (const CMakeProjectManager::CMakeBuildTarget& t, targets) { |
989 | - if(t.library) |
990 | - continue; |
991 | - |
992 | - QFileInfo targetInfo(t.executable); |
993 | - if(!targetInfo.exists()) |
994 | - continue; |
995 | - |
996 | - if(targetInfo.fileName() == commInfo.fileName()) { |
997 | - m_executable = targetInfo.absoluteFilePath(); |
998 | - break; |
999 | + if(target()->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID) { |
1000 | + QmakeProjectManager::QmakeProject* pro = static_cast<QmakeProjectManager::QmakeProject*> (target()->project()); |
1001 | + foreach(const QmakeProjectManager::QmakeProFileNode* applPro, pro->applicationProFiles()) { |
1002 | + QmakeProjectManager::TargetInformation info = applPro->targetInformation(); |
1003 | + if(applPro->targetInformation().valid) { |
1004 | + if(info.target == commInfo.fileName()) { |
1005 | + m_executable = info.buildDir + QDir::separator() + info.target; |
1006 | + break; |
1007 | + } |
1008 | + } |
1009 | + } |
1010 | + } else { |
1011 | + CMakeProjectManager::CMakeProject* proj = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
1012 | + QList<CMakeProjectManager::CMakeBuildTarget> targets = proj->buildTargets(); |
1013 | + foreach (const CMakeProjectManager::CMakeBuildTarget& t, targets) { |
1014 | + if(t.library) |
1015 | + continue; |
1016 | + |
1017 | + QFileInfo targetInfo(t.executable); |
1018 | + if(!targetInfo.exists()) |
1019 | + continue; |
1020 | + |
1021 | + if(targetInfo.fileName() == commInfo.fileName()) { |
1022 | + m_executable = targetInfo.absoluteFilePath(); |
1023 | + break; |
1024 | + } |
1025 | } |
1026 | } |
1027 | |
1028 | if (m_executable.isEmpty()) { |
1029 | if(errorMessage) |
1030 | - tr("Could not find executable specified in the desktop file"); |
1031 | + *errorMessage = tr("Could not find executable specified in the desktop file"); |
1032 | return false; |
1033 | } |
1034 | m_args = args; |
1035 | @@ -393,7 +410,7 @@ |
1036 | return false; |
1037 | } |
1038 | |
1039 | - Utils::FileName iniFile = UbuntuProjectGuesser::findScopesIniRecursive(target()->activeBuildConfiguration()->buildDirectory(),appId()); |
1040 | + Utils::FileName iniFile = UbuntuProjectHelper::findScopesIniRecursive(target()->activeBuildConfiguration()->buildDirectory(),appId()); |
1041 | if(iniFile.toFileInfo().exists()) |
1042 | m_args = QStringList()<<QString(iniFile.toFileInfo().absoluteFilePath()); |
1043 | |
1044 | @@ -438,27 +455,41 @@ |
1045 | |
1046 | void UbuntuLocalRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const |
1047 | { |
1048 | - if(id().toString().startsWith(QLatin1String(Constants::UBUNTUPROJECT_RUNCONTROL_APP_ID)) |
1049 | - && target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) { |
1050 | - CMakeProjectManager::CMakeProject* proj = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
1051 | - QList<CMakeProjectManager::CMakeBuildTarget> targets = proj->buildTargets(); |
1052 | - QSet<QString> usedPaths; |
1053 | - foreach (const CMakeProjectManager::CMakeBuildTarget& t, targets) { |
1054 | - if(t.library) { |
1055 | - if(debug) qDebug()<<"Looking at executable "<<t.executable; |
1056 | - QFileInfo inf(t.executable); |
1057 | - if(inf.exists()) { |
1058 | - QDir d = inf.absoluteDir(); |
1059 | - if(debug) qDebug()<<"Looking in the dir: "<<d.absolutePath(); |
1060 | - if(d.exists(QLatin1String("qmldir"))) { |
1061 | - QString path = QDir::cleanPath(d.absolutePath()+QDir::separator()+QLatin1String("..")); |
1062 | - if(usedPaths.contains(path)) |
1063 | - continue; |
1064 | - |
1065 | - env.appendOrSet(QStringLiteral("QML2_IMPORT_PATH"),path,QStringLiteral(":")); |
1066 | - usedPaths.insert(path); |
1067 | - } |
1068 | - } |
1069 | + QSet<QString> usedPaths; |
1070 | + |
1071 | + //lambda checks if the executable is in a qmldir and add its to QML2_IMPORT_PATH if |
1072 | + //required |
1073 | + auto loc_addToImportPath = [&usedPaths,&env] (const QString &executable) { |
1074 | + if(debug) qDebug()<<"Looking at executable "<<executable; |
1075 | + QFileInfo inf(executable); |
1076 | + if(inf.exists()) { |
1077 | + QDir d = inf.absoluteDir(); |
1078 | + if(debug) qDebug()<<"Looking in the dir: "<<d.absolutePath(); |
1079 | + if(d.exists(QLatin1String("qmldir"))) { |
1080 | + QString path = QDir::cleanPath(d.absolutePath()+QDir::separator()+QLatin1String("..")); |
1081 | + if(usedPaths.contains(path)) |
1082 | + return; |
1083 | + |
1084 | + env.appendOrSet(QStringLiteral("QML2_IMPORT_PATH"),path,QStringLiteral(":")); |
1085 | + usedPaths.insert(path); |
1086 | + } |
1087 | + } |
1088 | + }; |
1089 | + |
1090 | + if(id().toString().startsWith(QLatin1String(Constants::UBUNTUPROJECT_RUNCONTROL_APP_ID))) { |
1091 | + if(target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) { |
1092 | + CMakeProjectManager::CMakeProject* proj = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
1093 | + QList<CMakeProjectManager::CMakeBuildTarget> targets = proj->buildTargets(); |
1094 | + foreach (const CMakeProjectManager::CMakeBuildTarget& t, targets) { |
1095 | + if(t.library) |
1096 | + loc_addToImportPath(t.executable); |
1097 | + } |
1098 | + } else if (target()->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID) { |
1099 | + QmakeProjectManager::QmakeProject* pro = static_cast<QmakeProjectManager::QmakeProject*> (target()->project()); |
1100 | + foreach(const QmakeProjectManager::QmakeProFileNode* applPro, pro->applicationProFiles()) { |
1101 | + QmakeProjectManager::TargetInformation info = applPro->targetInformation(); |
1102 | + if(applPro->targetInformation().valid) |
1103 | + loc_addToImportPath(info.buildDir + QDir::separator() + info.target); |
1104 | } |
1105 | } |
1106 | } |
1107 | |
1108 | === modified file 'src/ubuntu/ubuntulocalrunconfigurationfactory.cpp' |
1109 | --- src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-08-21 16:56:53 +0000 |
1110 | +++ src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-11-21 08:06:27 +0000 |
1111 | @@ -18,7 +18,7 @@ |
1112 | |
1113 | #include "ubuntulocalrunconfigurationfactory.h" |
1114 | #include "ubunturemoterunconfiguration.h" |
1115 | -#include "ubuntuprojectguesser.h" |
1116 | +#include "ubuntuprojecthelper.h" |
1117 | #include "ubuntudevice.h" |
1118 | #include "clicktoolchain.h" |
1119 | #include "ubuntuclickmanifest.h" |
1120 | @@ -26,6 +26,7 @@ |
1121 | |
1122 | #include <cmakeprojectmanager/cmakeproject.h> |
1123 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
1124 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1125 | |
1126 | #include <projectexplorer/toolchain.h> |
1127 | #include <projectexplorer/kitinformation.h> |
1128 | @@ -53,8 +54,9 @@ |
1129 | bool isCMake = parent->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID; |
1130 | bool isHTML = parent->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID; |
1131 | bool isQML = parent->project()->id() == "QmlProjectManager.QmlProject"; |
1132 | + bool isQMake = parent->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID; |
1133 | |
1134 | - if (!isCMake && !isHTML &&!isQML) |
1135 | + if (!isCMake && !isHTML &&!isQML &&!isQMake) |
1136 | return types; |
1137 | |
1138 | if (isRemote) { |
1139 | @@ -64,11 +66,14 @@ |
1140 | return types; |
1141 | } |
1142 | |
1143 | - QString manifestPath = QDir::cleanPath(parent->project()->projectDirectory() |
1144 | - +QDir::separator() |
1145 | - +UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_MANIFEST_PATH"), |
1146 | - parent->activeBuildConfiguration(), |
1147 | - QStringLiteral("manifest.json")).toString()); |
1148 | + QString defaultPath = QDir::cleanPath(parent->project()->projectDirectory() |
1149 | + +QDir::separator() |
1150 | + +QStringLiteral("manifest.json")); |
1151 | + |
1152 | + QString manifestPath = UbuntuProjectHelper::getManifestPath(parent,defaultPath); |
1153 | + |
1154 | + qDebug()<<"Using the manifest path: "<<manifestPath; |
1155 | + |
1156 | UbuntuClickManifest manifest; |
1157 | |
1158 | //if we have no manifest, we can not query the app id's |
1159 | @@ -85,7 +90,7 @@ |
1160 | } |
1161 | } |
1162 | else if (isRemote) { |
1163 | - if (isCMake || isHTML || isQML) { |
1164 | + if (isCMake || isHTML || isQML || isQMake) { |
1165 | foreach (const UbuntuClickManifest::Hook &hook, hooks) { |
1166 | if(hook.type() == UbuntuClickManifest::Hook::Application) |
1167 | types << Core::Id(Constants::UBUNTUPROJECT_REMOTE_RUNCONTROL_APP_ID).withSuffix(hook.appId); |
1168 | |
1169 | === modified file 'src/ubuntu/ubuntumanifesteditorwidget.cpp' |
1170 | --- src/ubuntu/ubuntumanifesteditorwidget.cpp 2014-10-31 16:58:14 +0000 |
1171 | +++ src/ubuntu/ubuntumanifesteditorwidget.cpp 2014-11-21 08:06:27 +0000 |
1172 | @@ -328,7 +328,7 @@ |
1173 | m_ui->comboBoxFramework->removeItem(idx); |
1174 | } |
1175 | |
1176 | - QString v = policyForFramework(m_ui->comboBoxFramework->currentText()); |
1177 | + QString v = UbuntuClickFrameworkProvider::instance()->frameworkPolicy(m_ui->comboBoxFramework->currentText()); |
1178 | if(v.isEmpty()) |
1179 | return; |
1180 | |
1181 | @@ -336,8 +336,18 @@ |
1182 | foreach(const UbuntuClickManifest::Hook &hook, hooks){ |
1183 | QFileInfo mFile(textEditorWidget()->baseTextDocument()->filePath()); |
1184 | QString aaFile = mFile.absolutePath()+QDir::separator()+hook.appArmorFile; |
1185 | - if(!QFile::exists(aaFile)) |
1186 | - continue; |
1187 | + if(!QFile::exists(aaFile)) { |
1188 | + |
1189 | + ProjectExplorer::Project *p = ubuntuProject(mFile.absolutePath()); |
1190 | + if(!p) |
1191 | + continue; |
1192 | + |
1193 | + //the aa file does not live in the same directory as the manifest file |
1194 | + //try if we can use the project root directory to find the file |
1195 | + aaFile = p->projectDirectory()+QDir::separator()+hook.appArmorFile; |
1196 | + if(!QFile::exists(aaFile)) |
1197 | + continue; |
1198 | + } |
1199 | |
1200 | QList<Core::IEditor*> editors = model->editorsForFilePath(aaFile); |
1201 | if(editors.size()) { |
1202 | @@ -494,53 +504,5 @@ |
1203 | } |
1204 | } |
1205 | |
1206 | - |
1207 | -QString UbuntuManifestEditorWidget::policyForFramework(const QString &fw) |
1208 | -{ |
1209 | - if(fw.isEmpty()) |
1210 | - return QString(); |
1211 | - |
1212 | -#if 0 |
1213 | - QProcess proc; |
1214 | - proc.setProgram(QStringLiteral("aa-clickquery")); |
1215 | - proc.setArguments(QStringList{ |
1216 | - QStringLiteral("--click-framework=%1").arg(fw), |
1217 | - QStringLiteral("--query=policy_version")}); |
1218 | - proc.start(); |
1219 | - proc.waitForFinished(); |
1220 | - if(proc.exitCode() == 0 && proc.exitStatus() == QProcess::NormalExit) { |
1221 | - m_apparmor.setPolicyVersion(QString::fromUtf8(proc.readAllStandardOutput())); |
1222 | - m_apparmor.save(); |
1223 | - } |
1224 | -#else |
1225 | - static const QMap<QString,QString> policy { |
1226 | - {QStringLiteral("ubuntu-sdk-13.10"),QStringLiteral("1.0")}, |
1227 | - {QStringLiteral("ubuntu-sdk-14.04-dev1"),QStringLiteral("1.1")}, |
1228 | - {QStringLiteral("ubuntu-sdk-14.04-html-dev1"),QStringLiteral("1.1")}, |
1229 | - {QStringLiteral("ubuntu-sdk-14.04-html"),QStringLiteral("1.1")}, |
1230 | - {QStringLiteral("ubuntu-sdk-14.04-papi-dev1"),QStringLiteral("1.1")}, |
1231 | - {QStringLiteral("ubuntu-sdk-14.04-papi"),QStringLiteral("1.1")}, |
1232 | - {QStringLiteral("ubuntu-sdk-14.04-qml-dev1"),QStringLiteral("1.1")}, |
1233 | - {QStringLiteral("ubuntu-sdk-14.04-qml"),QStringLiteral("1.1")}, |
1234 | - {QStringLiteral("ubuntu-sdk-14.04"),QStringLiteral("1.1")}, |
1235 | - {QStringLiteral("ubuntu-sdk-14.10-dev1"),QStringLiteral("1.2")}, |
1236 | - {QStringLiteral("ubuntu-sdk-14.10-dev2"),QStringLiteral("1.2")}, |
1237 | - {QStringLiteral("ubuntu-sdk-14.10-html-dev1"),QStringLiteral("1.2")}, |
1238 | - {QStringLiteral("ubuntu-sdk-14.10-html-dev2"),QStringLiteral("1.2")}, |
1239 | - {QStringLiteral("ubuntu-sdk-14.10-papi-dev1"),QStringLiteral("1.2")}, |
1240 | - {QStringLiteral("ubuntu-sdk-14.10-papi-dev2"),QStringLiteral("1.2")}, |
1241 | - {QStringLiteral("ubuntu-sdk-14.10-qml-dev1"),QStringLiteral("1.2")}, |
1242 | - {QStringLiteral("ubuntu-sdk-14.10-qml-dev2"),QStringLiteral("1.2")}, |
1243 | - {QStringLiteral("ubuntu-sdk-14.10-qml-dev3"),QStringLiteral("1.2")} |
1244 | - }; |
1245 | - |
1246 | - if(policy.contains(fw)) { |
1247 | - return policy[fw]; |
1248 | - } |
1249 | - return QString(); |
1250 | -#endif |
1251 | -} |
1252 | - |
1253 | - |
1254 | } // namespace Internal |
1255 | } // namespace Ubuntu |
1256 | |
1257 | === modified file 'src/ubuntu/ubuntumanifesteditorwidget.h' |
1258 | --- src/ubuntu/ubuntumanifesteditorwidget.h 2014-10-31 16:58:14 +0000 |
1259 | +++ src/ubuntu/ubuntumanifesteditorwidget.h 2014-11-21 08:06:27 +0000 |
1260 | @@ -55,8 +55,7 @@ |
1261 | bool syncToWidgets (UbuntuClickManifest *source); |
1262 | void syncToSource (); |
1263 | QWidget *createMainWidget(); |
1264 | - void addMissingFieldsToManifest(QString fileName); |
1265 | - QString policyForFramework(const QString &fw); |
1266 | + void addMissingFieldsToManifest(QString fileName); |
1267 | |
1268 | protected slots: |
1269 | void bzrChanged (); |
1270 | |
1271 | === modified file 'src/ubuntu/ubuntupackagestep.cpp' |
1272 | --- src/ubuntu/ubuntupackagestep.cpp 2014-10-01 11:48:41 +0000 |
1273 | +++ src/ubuntu/ubuntupackagestep.cpp 2014-11-21 08:06:27 +0000 |
1274 | @@ -2,7 +2,7 @@ |
1275 | #include "ui_ubuntupackagestepconfigwidget.h" |
1276 | #include "ubuntuconstants.h" |
1277 | #include "clicktoolchain.h" |
1278 | -#include "ubuntuprojectguesser.h" |
1279 | +#include "ubuntuprojecthelper.h" |
1280 | #include "ubuntuclickmanifest.h" |
1281 | #include "ubuntupackageoutputparser.h" |
1282 | |
1283 | @@ -15,6 +15,7 @@ |
1284 | #include <projectexplorer/ioutputparser.h> |
1285 | #include <utils/qtcprocess.h> |
1286 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
1287 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1288 | |
1289 | #include <QDir> |
1290 | #include <QTimer> |
1291 | @@ -75,6 +76,9 @@ |
1292 | Utils::Environment env = Utils::Environment::systemEnvironment(); |
1293 | Utils::AbstractMacroExpander *mExp = 0; |
1294 | |
1295 | + bool isCMake = target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID; |
1296 | + bool isQMake = target()->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID; |
1297 | + |
1298 | { |
1299 | ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration(); |
1300 | if(bc) { |
1301 | @@ -85,8 +89,8 @@ |
1302 | env = bc->environment(); |
1303 | mExp = bc->macroExpander(); |
1304 | } else { |
1305 | - //cmake projects NEED a buildconfiguration |
1306 | - if (target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) { |
1307 | + //cmake and qmake projects NEED a buildconfiguration |
1308 | + if (isCMake || isQMake) { |
1309 | ProjectExplorer::Task t(ProjectExplorer::Task::Error |
1310 | ,tr("No valid BuildConfiguration set for step: %1").arg(displayName()) |
1311 | ,Utils::FileName(),-1 |
1312 | @@ -116,10 +120,16 @@ |
1313 | |
1314 | //build the make process arguments |
1315 | { |
1316 | - if (target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) { |
1317 | + if (isCMake || isQMake) { |
1318 | QStringList arguments; |
1319 | - arguments << QStringLiteral("DESTDIR=%1").arg(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR)) |
1320 | - << QStringLiteral("install"); |
1321 | + |
1322 | + if(isCMake) { |
1323 | + arguments << QStringLiteral("DESTDIR=%1").arg(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR)) |
1324 | + << QStringLiteral("install"); |
1325 | + } else { |
1326 | + arguments << QStringLiteral("INSTALL_ROOT=%1").arg(m_buildDir + QDir::separator() + QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR)) |
1327 | + << QStringLiteral("install"); |
1328 | + } |
1329 | |
1330 | ProjectExplorer::ProcessParameters* params = &m_MakeParam; |
1331 | params->setMacroExpander(mExp); |
1332 | @@ -487,7 +497,7 @@ |
1333 | { |
1334 | if (tc) |
1335 | return tc->makeCommand(env); |
1336 | - return QString::fromLatin1(Constants::UBUNTU_CLICK_MAKE_WRAPPER).arg(Constants::UBUNTU_SCRIPTPATH); |
1337 | + return QString(); |
1338 | } |
1339 | |
1340 | /*! |
1341 | |
1342 | === modified file 'src/ubuntu/ubuntupackagingwidget.cpp' |
1343 | --- src/ubuntu/ubuntupackagingwidget.cpp 2014-10-14 09:31:18 +0000 |
1344 | +++ src/ubuntu/ubuntupackagingwidget.cpp 2014-11-21 08:06:27 +0000 |
1345 | @@ -28,6 +28,7 @@ |
1346 | #include "ubuntupackagestep.h" |
1347 | #include "ubuntushared.h" |
1348 | #include "ubuntucmakecache.h" |
1349 | +#include "ubuntuprojecthelper.h" |
1350 | |
1351 | #include <projectexplorer/projectexplorer.h> |
1352 | #include <projectexplorer/project.h> |
1353 | @@ -45,7 +46,7 @@ |
1354 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
1355 | #include <ssh/sshconnection.h> |
1356 | #include <qmlprojectmanager/qmlprojectconstants.h> |
1357 | - |
1358 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1359 | |
1360 | #include <QFileDialog> |
1361 | #include <QJsonDocument> |
1362 | @@ -117,11 +118,25 @@ |
1363 | |
1364 | ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject(); |
1365 | |
1366 | - QVariant manifestPath = UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_MANIFEST_PATH"), |
1367 | - startupProject->activeTarget()->activeBuildConfiguration(), |
1368 | - QStringLiteral("manifest.json")); |
1369 | + //first try to use the version in the deploy directory. It is always in the root of the click package |
1370 | + QString manifestPath; |
1371 | + |
1372 | + if(startupProject->activeTarget() && startupProject->activeTarget()->activeBuildConfiguration()) { |
1373 | + manifestPath = startupProject->activeTarget()->activeBuildConfiguration()->buildDirectory() |
1374 | + .appendPath(QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR)) |
1375 | + .appendPath(QStringLiteral("manifest.json")) |
1376 | + .toString(); |
1377 | + } |
1378 | + |
1379 | + if(!QFile::exists(manifestPath)) { |
1380 | + //fall back to the project directory |
1381 | + manifestPath = UbuntuProjectHelper::getManifestPath(startupProject->activeTarget(), |
1382 | + Utils::FileName::fromString(startupProject->projectDirectory()) |
1383 | + .appendPath(QStringLiteral("manifest.json")).toString()); |
1384 | + } |
1385 | + |
1386 | UbuntuClickManifest manifest; |
1387 | - if(!manifest.load(startupProject->projectDirectory()+QDir::separator()+manifestPath.toString())) |
1388 | + if(!manifest.load(manifestPath)) |
1389 | return; |
1390 | |
1391 | QString sClickPackageName; |
1392 | @@ -259,7 +274,8 @@ |
1393 | QString mimeType = project->projectManager()->mimeType(); |
1394 | if(mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE) |
1395 | || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE) |
1396 | - || mimeType == QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE)) { |
1397 | + || mimeType == QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE) |
1398 | + || mimeType == QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE)) { |
1399 | if(m_reviewToolsInstalled) |
1400 | m_postPackageTask = Verify; |
1401 | else |
1402 | @@ -385,8 +401,9 @@ |
1403 | bool isCMake = mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE); |
1404 | bool isHtml = mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE); |
1405 | bool isQml = mimeType == QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE); |
1406 | + bool isQmake = mimeType == QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE); |
1407 | |
1408 | - if(isCMake || isHtml || isQml) { |
1409 | + if(isCMake || isHtml || isQml || isQmake) { |
1410 | ProjectExplorer::Target* target = project->activeTarget(); |
1411 | if(!target) |
1412 | return; |
1413 | @@ -420,7 +437,7 @@ |
1414 | clearPackageBuildList(); |
1415 | |
1416 | m_packageBuildSteps = QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(bc,ProjectExplorer::Constants::BUILDSTEPS_BUILD)); |
1417 | - if (isCMake) { |
1418 | + if (isCMake || isQmake) { |
1419 | //add the normal buildsteps |
1420 | m_packageBuildSteps->cloneSteps(bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD))); |
1421 | } |
1422 | |
1423 | === modified file 'src/ubuntu/ubuntuplugin.cpp' |
1424 | --- src/ubuntu/ubuntuplugin.cpp 2014-10-31 16:58:14 +0000 |
1425 | +++ src/ubuntu/ubuntuplugin.cpp 2014-11-21 08:06:27 +0000 |
1426 | @@ -175,6 +175,10 @@ |
1427 | QStringLiteral("ubuntu-project-cmake"), |
1428 | Core::IWizard::ProjectWizard)); |
1429 | addAutoReleasedObject( |
1430 | + new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::QMakeProject>( |
1431 | + QStringLiteral("ubuntu-project-qmake"), |
1432 | + Core::IWizard::ProjectWizard)); |
1433 | + addAutoReleasedObject( |
1434 | new UbuntuWizardFactory<UbuntuProjectApplicationWizard,UbuntuProjectApplicationWizard::UbuntuHTMLProject>( |
1435 | QStringLiteral("ubuntu-project-plain-html"), |
1436 | Core::IWizard::ProjectWizard)); |
1437 | |
1438 | === modified file 'src/ubuntu/ubuntuprojectapplicationwizard.cpp' |
1439 | --- src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-11-17 14:24:59 +0000 |
1440 | +++ src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-11-21 08:06:27 +0000 |
1441 | @@ -271,6 +271,7 @@ |
1442 | m_targetSetupPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(features)); |
1443 | break; |
1444 | } |
1445 | + case UbuntuProjectApplicationWizard::QMakeProject: |
1446 | case UbuntuProjectApplicationWizard::UbuntuQMLProject: |
1447 | case UbuntuProjectApplicationWizard::UbuntuHTMLProject: { |
1448 | m_targetSetupPage->setRequiredKitMatcher(new UbuntuKitMatcher()); |
1449 | @@ -301,22 +302,37 @@ |
1450 | if(!m_targetSetupPage) |
1451 | return; |
1452 | |
1453 | - if(m_type == UbuntuProjectApplicationWizard::GoProject) { |
1454 | - m_targetSetupPage->setProjectPath(path+QDir::separator() |
1455 | - +projectName |
1456 | - +QDir::separator() |
1457 | - +QString::fromLatin1("%1.goproject").arg(projectName)); |
1458 | - } else if (m_type == UbuntuProjectApplicationWizard::UbuntuHTMLProject) { |
1459 | - m_targetSetupPage->setProjectPath(path+QDir::separator() |
1460 | - +projectName |
1461 | - +QDir::separator() |
1462 | - +QString::fromLatin1("%1.ubuntuhtmlproject").arg(projectName)); |
1463 | - } else if (m_type == UbuntuProjectApplicationWizard::UbuntuQMLProject) { |
1464 | - m_targetSetupPage->setProjectPath(path+QDir::separator() |
1465 | - +projectName |
1466 | - +QDir::separator() |
1467 | - +QString::fromLatin1("%1.qmlproject").arg(projectName)); |
1468 | - } else { |
1469 | - m_targetSetupPage->setProjectPath(path+QDir::separator()+projectName+QDir::separator()+QLatin1String("CMakeLists.txt")); |
1470 | + switch(m_type) { |
1471 | + case UbuntuProjectApplicationWizard::QMakeProject: { |
1472 | + m_targetSetupPage->setProjectPath(path+QDir::separator() |
1473 | + +projectName |
1474 | + +QDir::separator() |
1475 | + +QString::fromLatin1("%1.pro").arg(projectName)); |
1476 | + break; |
1477 | + } |
1478 | + case UbuntuProjectApplicationWizard::GoProject: { |
1479 | + m_targetSetupPage->setProjectPath(path+QDir::separator() |
1480 | + +projectName |
1481 | + +QDir::separator() |
1482 | + +QString::fromLatin1("%1.goproject").arg(projectName)); |
1483 | + break; |
1484 | + } |
1485 | + case UbuntuProjectApplicationWizard::UbuntuHTMLProject: { |
1486 | + m_targetSetupPage->setProjectPath(path+QDir::separator() |
1487 | + +projectName |
1488 | + +QDir::separator() |
1489 | + +QString::fromLatin1("%1.ubuntuhtmlproject").arg(projectName)); |
1490 | + break; |
1491 | + } |
1492 | + case UbuntuProjectApplicationWizard::UbuntuQMLProject: { |
1493 | + m_targetSetupPage->setProjectPath(path+QDir::separator() |
1494 | + +projectName |
1495 | + +QDir::separator() |
1496 | + +QString::fromLatin1("%1.qmlproject").arg(projectName)); |
1497 | + break; |
1498 | + } |
1499 | + default: { |
1500 | + m_targetSetupPage->setProjectPath(path+QDir::separator()+projectName+QDir::separator()+QLatin1String("CMakeLists.txt")); |
1501 | + } |
1502 | } |
1503 | } |
1504 | |
1505 | === modified file 'src/ubuntu/ubuntuprojectapplicationwizard.h' |
1506 | --- src/ubuntu/ubuntuprojectapplicationwizard.h 2014-11-17 14:24:59 +0000 |
1507 | +++ src/ubuntu/ubuntuprojectapplicationwizard.h 2014-11-21 08:06:27 +0000 |
1508 | @@ -44,7 +44,8 @@ |
1509 | UbuntuHTMLProject, |
1510 | UbuntuQMLProject, |
1511 | CMakeProject, |
1512 | - GoProject |
1513 | + GoProject, |
1514 | + QMakeProject |
1515 | }; |
1516 | |
1517 | UbuntuProjectApplicationWizard(ProjectType type); |
1518 | |
1519 | === renamed file 'src/ubuntu/ubuntuprojectguesser.cpp' => 'src/ubuntu/ubuntuprojecthelper.cpp' |
1520 | --- src/ubuntu/ubuntuprojectguesser.cpp 2014-09-02 15:06:34 +0000 |
1521 | +++ src/ubuntu/ubuntuprojecthelper.cpp 2014-11-21 08:06:27 +0000 |
1522 | @@ -15,13 +15,21 @@ |
1523 | * |
1524 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> |
1525 | */ |
1526 | -#include "ubuntuprojectguesser.h" |
1527 | +#include "ubuntuprojecthelper.h" |
1528 | #include "ubuntucmakecache.h" |
1529 | |
1530 | #include <projectexplorer/project.h> |
1531 | #include <projectexplorer/target.h> |
1532 | #include <projectexplorer/buildconfiguration.h> |
1533 | + |
1534 | #include <cmakeprojectmanager/cmakeproject.h> |
1535 | +#include <cmakeprojectmanager/cmakeprojectconstants.h> |
1536 | + |
1537 | +#include <qmakeprojectmanager/qmakeproject.h> |
1538 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1539 | +#include <qmakeprojectmanager/qmakeproject.h> |
1540 | +#include <qmakeprojectmanager/qmakenodes.h> |
1541 | + |
1542 | #include <QDebug> |
1543 | |
1544 | #include <QFile> |
1545 | @@ -36,26 +44,22 @@ |
1546 | debug = 0 |
1547 | }; |
1548 | |
1549 | -const char SCOPES_TYPE_CACHE_PROPERTY[] = "__ubuntu_sdk_is_scopes_project_property"; |
1550 | -const char SCOPES_INIFILE_CACHE_PROPERTY[] = "__ubuntu_sdk_scopes_project_inifile_property"; |
1551 | -const char CLICK_TYPE_CACHE_PROPERTY[] = "__ubuntu_sdk_is_click_project_property"; |
1552 | - |
1553 | -UbuntuProjectGuesser::UbuntuProjectGuesser() |
1554 | +UbuntuProjectHelper::UbuntuProjectHelper() |
1555 | { |
1556 | } |
1557 | |
1558 | -Utils::FileName UbuntuProjectGuesser::findScopesIniRecursive(const Utils::FileName &searchdir, const QString &appid) |
1559 | +Utils::FileName UbuntuProjectHelper::findScopesIniRecursive(const Utils::FileName &searchdir, const QString &appid) |
1560 | { |
1561 | return findFileRecursive(searchdir,QStringLiteral("^.*_%1\\.ini.*$").arg(appid)); |
1562 | } |
1563 | |
1564 | -Utils::FileName UbuntuProjectGuesser::findFileRecursive(const Utils::FileName &searchdir, const QString ®exp) |
1565 | +Utils::FileName UbuntuProjectHelper::findFileRecursive(const Utils::FileName &searchdir, const QString ®exp) |
1566 | { |
1567 | QRegularExpression regex(regexp); |
1568 | return findFileRecursive(searchdir,regex); |
1569 | } |
1570 | |
1571 | -Utils::FileName UbuntuProjectGuesser::findFileRecursive(const Utils::FileName &searchdir, const QRegularExpression ®exp) |
1572 | +Utils::FileName UbuntuProjectHelper::findFileRecursive(const Utils::FileName &searchdir, const QRegularExpression ®exp) |
1573 | { |
1574 | QFileInfo dirInfo = searchdir.toFileInfo(); |
1575 | if(!dirInfo.exists()) |
1576 | @@ -65,7 +69,7 @@ |
1577 | return Utils::FileName(); |
1578 | |
1579 | QDir dir(dirInfo.absoluteFilePath()); |
1580 | - QStringList entries = dir.entryList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files); |
1581 | + QStringList entries = dir.entryList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::Hidden); |
1582 | |
1583 | foreach (const QString& entry, entries) { |
1584 | QFileInfo info(dir.absoluteFilePath(entry)); |
1585 | @@ -86,7 +90,7 @@ |
1586 | return Utils::FileName(); |
1587 | } |
1588 | |
1589 | -QList<Utils::FileName> UbuntuProjectGuesser::findFilesRecursive(const Utils::FileName &searchdir, const QRegularExpression ®exp) |
1590 | +QList<Utils::FileName> UbuntuProjectHelper::findFilesRecursive(const Utils::FileName &searchdir, const QRegularExpression ®exp) |
1591 | { |
1592 | QList<Utils::FileName> result; |
1593 | QFileInfo dirInfo = searchdir.toFileInfo(); |
1594 | @@ -115,30 +119,51 @@ |
1595 | return result; |
1596 | } |
1597 | |
1598 | -QString UbuntuProjectGuesser::projectTypeFromCacheOrProject(ProjectExplorer::Project *project) |
1599 | +QString UbuntuProjectHelper::getManifestPath(ProjectExplorer::Target *target, const QString &defaultValue) |
1600 | { |
1601 | - //First try to get the variable from the Cache file |
1602 | - if(project->activeTarget() |
1603 | - && project->activeTarget()->activeBuildConfiguration()) |
1604 | - { |
1605 | - QVariant val = UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_PROJECT_TYPE"),project->activeTarget()->activeBuildConfiguration()); |
1606 | - if(val.isValid()) |
1607 | - return val.toString(); |
1608 | - } |
1609 | - |
1610 | - QFile projectFile(project->projectFilePath()); |
1611 | - if (projectFile.exists() && projectFile.open(QIODevice::ReadOnly)) { |
1612 | - QRegularExpression regExp(QLatin1String("^\\s*SET\\s*\\(\\s*UBUNTU_PROJECT_TYPE\\s*\"?(\\S*)\"?")); |
1613 | - QTextStream in(&projectFile); |
1614 | - while (!in.atEnd()) { |
1615 | - QString contents = in.readLine(); |
1616 | - QRegularExpressionMatch m = regExp.match(contents); |
1617 | - if(m.hasMatch()) { |
1618 | - return m.captured(1); |
1619 | + if(target && target->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID ) { |
1620 | + QVariant manifestPath = UbuntuCMakeCache::getValue(QStringLiteral("UBUNTU_MANIFEST_PATH"), |
1621 | + target->activeBuildConfiguration(), |
1622 | + defaultValue); |
1623 | + |
1624 | + Utils::FileName projectDir = Utils::FileName::fromString(target->project()->projectDirectory()); |
1625 | + return projectDir.appendPath(manifestPath.toString()).toString(); |
1626 | + } else if (target && target->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID ) { |
1627 | + QmakeProjectManager::QmakeProject *qmakeProj = static_cast<QmakeProjectManager::QmakeProject *>(target->project()); |
1628 | + QList<QmakeProjectManager::QmakeProFileNode *> nodes = qmakeProj->allProFiles(); |
1629 | + |
1630 | + QString manifestFilePath; //empty |
1631 | + foreach (QmakeProjectManager::QmakeProFileNode *node, nodes) { |
1632 | + if(!node) |
1633 | + continue; |
1634 | + |
1635 | + manifestFilePath = node->singleVariableValue(QmakeProjectManager::UbuntuManifestFile); |
1636 | + if(manifestFilePath.isEmpty()) { |
1637 | + continue; |
1638 | + } else if(QDir::isRelativePath(manifestFilePath)) { |
1639 | + manifestFilePath = QDir::cleanPath(node->sourceDir() |
1640 | + +QDir::separator() |
1641 | + +manifestFilePath); |
1642 | + break; |
1643 | + } else { |
1644 | + manifestFilePath = QDir::cleanPath(manifestFilePath); |
1645 | + break; |
1646 | } |
1647 | } |
1648 | + |
1649 | + if(manifestFilePath.isEmpty()) |
1650 | + return defaultValue; |
1651 | + return manifestFilePath; |
1652 | } |
1653 | - return QString(); |
1654 | + return defaultValue; |
1655 | +} |
1656 | + |
1657 | +QString UbuntuProjectHelper::getManifestPath(ProjectExplorer::Project *p, const QString &defaultValue) |
1658 | +{ |
1659 | + if(!p) |
1660 | + return defaultValue; |
1661 | + |
1662 | + return getManifestPath(p->activeTarget(),defaultValue); |
1663 | } |
1664 | |
1665 | } // namespace Internal |
1666 | |
1667 | === renamed file 'src/ubuntu/ubuntuprojectguesser.h' => 'src/ubuntu/ubuntuprojecthelper.h' |
1668 | --- src/ubuntu/ubuntuprojectguesser.h 2014-09-02 15:06:34 +0000 |
1669 | +++ src/ubuntu/ubuntuprojecthelper.h 2014-11-21 08:06:27 +0000 |
1670 | @@ -25,21 +25,22 @@ |
1671 | |
1672 | namespace ProjectExplorer { |
1673 | class Project; |
1674 | + class Target; |
1675 | } |
1676 | |
1677 | namespace Ubuntu { |
1678 | namespace Internal { |
1679 | |
1680 | -class UbuntuProjectGuesser |
1681 | +class UbuntuProjectHelper |
1682 | { |
1683 | public: |
1684 | - UbuntuProjectGuesser(); |
1685 | + UbuntuProjectHelper(); |
1686 | static Utils::FileName findScopesIniRecursive (const Utils::FileName &searchdir, const QString &appid); |
1687 | static Utils::FileName findFileRecursive (const Utils::FileName &searchdir, const QString ®exp); |
1688 | static Utils::FileName findFileRecursive (const Utils::FileName &searchdir, const QRegularExpression ®exp); |
1689 | static QList<Utils::FileName> findFilesRecursive(const Utils::FileName &searchdir, const QRegularExpression ®exp); |
1690 | - static QString projectTypeFromCacheOrProject (ProjectExplorer::Project* project); |
1691 | - |
1692 | + static QString getManifestPath (ProjectExplorer::Project * p, const QString &defaultValue); |
1693 | + static QString getManifestPath(ProjectExplorer::Target *target, const QString &defaultValue); |
1694 | }; |
1695 | |
1696 | } // namespace Internal |
1697 | |
1698 | === modified file 'src/ubuntu/ubuntuqtversion.cpp' |
1699 | --- src/ubuntu/ubuntuqtversion.cpp 2014-09-29 11:28:19 +0000 |
1700 | +++ src/ubuntu/ubuntuqtversion.cpp 2014-11-21 08:06:27 +0000 |
1701 | @@ -5,6 +5,7 @@ |
1702 | |
1703 | #include <QCoreApplication> |
1704 | #include <QFileInfo> |
1705 | +#include <QDebug> |
1706 | |
1707 | namespace Ubuntu { |
1708 | namespace Internal { |
1709 | @@ -16,7 +17,7 @@ |
1710 | * Increment this version if all qmake scripts in ~/.config/ubuntu-sdk |
1711 | * need to be recreated |
1712 | */ |
1713 | -const int MIN_SCRIPT_VERSION = 1; |
1714 | +const int MIN_SCRIPT_VERSION = 2; |
1715 | |
1716 | UbuntuQtVersion::UbuntuQtVersion() |
1717 | : BaseQtVersion(), |
1718 | @@ -31,7 +32,7 @@ |
1719 | } |
1720 | |
1721 | UbuntuQtVersion::~UbuntuQtVersion() |
1722 | -{ } |
1723 | +{} |
1724 | |
1725 | void UbuntuQtVersion::fromMap(const QVariantMap &map) |
1726 | { |
1727 | @@ -115,7 +116,7 @@ |
1728 | { |
1729 | Q_UNUSED(evaluator); |
1730 | //we only care about our qmakes |
1731 | - if(!qmakePath.toFileInfo().absolutePath().endsWith(QStringLiteral(".config/ubuntu-sdk"))) |
1732 | + if(!qmakePath.toFileInfo().absolutePath().contains(QStringLiteral(".config/ubuntu-sdk"))) |
1733 | return 0; |
1734 | |
1735 | return new UbuntuQtVersion(qmakePath,isAutoDetected,autoDetectionSource); |
1736 | |
1737 | === modified file 'src/ubuntu/ubunturemotedeployconfiguration.cpp' |
1738 | --- src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-08-21 16:56:53 +0000 |
1739 | +++ src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-11-21 08:06:27 +0000 |
1740 | @@ -19,7 +19,7 @@ |
1741 | #include "ubuntucmakebuildconfiguration.h" |
1742 | #include "ubuntucmakemakestep.h" |
1743 | #include "ubuntudirectuploadstep.h" |
1744 | -#include "ubuntuprojectguesser.h" |
1745 | +#include "ubuntuprojecthelper.h" |
1746 | #include "ubuntuconstants.h" |
1747 | #include "ubuntupackagestep.h" |
1748 | |
1749 | @@ -35,6 +35,7 @@ |
1750 | #include <projectexplorer/buildsteplist.h> |
1751 | |
1752 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
1753 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1754 | |
1755 | #include <QDir> |
1756 | #include <QObject> |
1757 | @@ -82,11 +83,13 @@ |
1758 | return ids; |
1759 | |
1760 | Core::Id projectTypeId = parent->project()->id(); |
1761 | + qDebug()<<"Project ID: "<<projectTypeId.toString(); |
1762 | |
1763 | - //for now only support cmake and ubuntu projects |
1764 | + //for now only support cmake, qmake and ubuntu projects |
1765 | if(projectTypeId != CMakeProjectManager::Constants::CMAKEPROJECT_ID |
1766 | && projectTypeId != Ubuntu::Constants::UBUNTUPROJECT_ID |
1767 | - && projectTypeId != "QmlProjectManager.QmlProject") |
1768 | + && projectTypeId != "QmlProjectManager.QmlProject" |
1769 | + && projectTypeId != QmakeProjectManager::Constants::QMAKEPROJECT_ID) |
1770 | return ids; |
1771 | |
1772 | const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit()); |
1773 | |
1774 | === modified file 'src/ubuntu/ubunturemoterunconfiguration.cpp' |
1775 | --- src/ubuntu/ubunturemoterunconfiguration.cpp 2014-09-24 14:31:46 +0000 |
1776 | +++ src/ubuntu/ubunturemoterunconfiguration.cpp 2014-11-21 08:06:27 +0000 |
1777 | @@ -34,6 +34,9 @@ |
1778 | #include <utils/qtcprocess.h> |
1779 | #include <cmakeprojectmanager/cmakeproject.h> |
1780 | #include <cmakeprojectmanager/cmakeprojectconstants.h> |
1781 | +#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> |
1782 | +#include <qmakeprojectmanager/qmakeproject.h> |
1783 | +#include <qmakeprojectmanager/qmakenodes.h> |
1784 | |
1785 | #include <QFile> |
1786 | #include <QTextStream> |
1787 | @@ -115,7 +118,23 @@ |
1788 | paths << binary.absolutePath(); |
1789 | } |
1790 | } |
1791 | + } else { |
1792 | + QmakeProjectManager::QmakeProject* qmakeProj = |
1793 | + qobject_cast<QmakeProjectManager::QmakeProject *>(target()->project()); |
1794 | + if(qmakeProj) { |
1795 | + foreach (const QmakeProjectManager::QmakeProFileNode* pro, qmakeProj->allProFiles()) { |
1796 | + if(pro->projectType() == QmakeProjectManager::ApplicationTemplate |
1797 | + || pro->projectType() == QmakeProjectManager::LibraryTemplate) { |
1798 | + QmakeProjectManager::TargetInformation info = pro->targetInformation(); |
1799 | + if(!info.valid) |
1800 | + continue; |
1801 | + if(debug) qDebug()<<"Adding path "<<info.buildDir<<" to solib-search-paths"; |
1802 | + paths << info.buildDir; |
1803 | + } |
1804 | + } |
1805 | + } |
1806 | } |
1807 | + |
1808 | return paths; |
1809 | } |
1810 | |
1811 | @@ -236,15 +255,28 @@ |
1812 | m_arguments = args; |
1813 | } else { |
1814 | //looks like a application without a launcher |
1815 | - CMakeProjectManager::CMakeProject* pro = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
1816 | - foreach(const CMakeProjectManager::CMakeBuildTarget &t, pro->buildTargets()) { |
1817 | - if(t.library || t.executable.isEmpty()) |
1818 | - continue; |
1819 | - |
1820 | - QFileInfo execInfo(t.executable); |
1821 | - |
1822 | - if(execInfo.fileName() == commInfo.fileName()) |
1823 | - m_localExecutable = t.executable; |
1824 | + if(target()->project()->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID) { |
1825 | + QmakeProjectManager::QmakeProject* pro = static_cast<QmakeProjectManager::QmakeProject*> (target()->project()); |
1826 | + foreach(const QmakeProjectManager::QmakeProFileNode* applPro, pro->applicationProFiles()) { |
1827 | + QmakeProjectManager::TargetInformation info = applPro->targetInformation(); |
1828 | + if(applPro->targetInformation().valid) { |
1829 | + if(info.target == commInfo.fileName()) { |
1830 | + m_localExecutable = info.buildDir + QDir::separator() + info.target; |
1831 | + break; |
1832 | + } |
1833 | + } |
1834 | + } |
1835 | + } else { |
1836 | + CMakeProjectManager::CMakeProject* pro = static_cast<CMakeProjectManager::CMakeProject*> (target()->project()); |
1837 | + foreach(const CMakeProjectManager::CMakeBuildTarget &t, pro->buildTargets()) { |
1838 | + if(t.library || t.executable.isEmpty()) |
1839 | + continue; |
1840 | + |
1841 | + QFileInfo execInfo(t.executable); |
1842 | + |
1843 | + if(execInfo.fileName() == commInfo.fileName()) |
1844 | + m_localExecutable = t.executable; |
1845 | + } |
1846 | } |
1847 | |
1848 | if (m_localExecutable.isEmpty()) { |
1849 | @@ -252,7 +284,6 @@ |
1850 | *errorMessage = tr("Could not find %1 in the project targets").arg(command); |
1851 | return false; |
1852 | } |
1853 | - |
1854 | m_remoteExecutable = command; |
1855 | } |
1856 | return true; |
1857 | @@ -390,7 +421,7 @@ |
1858 | QString UbuntuRemoteRunConfiguration::packageDir() const |
1859 | { |
1860 | ProjectExplorer::Project *p = target()->project(); |
1861 | - if (p->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID) |
1862 | + if (p->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID || p->id() == QmakeProjectManager::Constants::QMAKEPROJECT_ID) |
1863 | return target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR); |
1864 | else if (p->id() == Ubuntu::Constants::UBUNTUPROJECT_ID || p->id() == "QmlProjectManager.QmlProject") { |
1865 | if (!target()->activeBuildConfiguration()) { |
let's push it