Merge lp:~flscogna/ubuntu-weather-app/reorganization-and-native-launcher into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Filippo Scognamiglio
Status: Rejected
Rejected by: Daniel Holbach
Proposed branch: lp:~flscogna/ubuntu-weather-app/reorganization-and-native-launcher
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 300 lines (+127/-40)
9 files modified
CMakeLists.txt (+21/-18)
debian/control (+7/-6)
debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install (+1/-1)
src/CMakeLists.txt (+2/-0)
src/app/CMakeLists.txt (+24/-0)
src/app/main.cpp (+66/-0)
src/plugins/CMakeLists.txt (+6/-2)
ubuntu-weather-app.desktop (+0/-10)
ubuntu-weather-app.in (+0/-3)
To merge this branch: bzr merge lp:~flscogna/ubuntu-weather-app/reorganization-and-native-launcher
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Daniel Holbach (community) Needs Fixing
Nicholas Skaggs (community) Needs Fixing
Alan Pope 🍺🐧🐱 πŸ¦„ Pending
Review via email: mp+241351@code.launchpad.net

Commit message

Project reorganization and migration to native launcher.

Description of the change

The project has been reorganized following the terminal as a guideline. The program is now launched from a binary executable (instead of relying on qmlscene) I tested it both on the phone and on the desktop. I really hope everything is in place.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Martin Borho (martin-borho) wrote :

Getting the following tracebacks when running the autopilot tests:

http://paste.ubuntu.com/8944971/

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

It's not currently building; dpkg-buildpackage -rfakeroot -D -us -uc failed

review: Needs Fixing
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

I'm sorry I completely forgot about this. I will take a look at it soon.

Revision history for this message
Daniel Holbach (dholbach) wrote :

<dholbach> dh_install: qtdeclarative5-ubuntuweather-timezone-plugin1.0 missing files (usr/lib/*/qt5/), aborting
<swordfish90> balloons, dholbach Ok thanks. There is probably an issue with the timezone plugin.
<dholbach> looks like stuff gets installed into:
 /tmp/buildd/ubuntu-weather-app-1.8.3ubuntu1/debian/tmp/usr/lib/x86_64-linux-gnu/TimeZone/*
 so qt5 <-> TimeZone
 that's the mismatch
 I don't know where you want things installed
 either you need to change things in CMakeLists.txt
 or in debian/*.install
<dholbach> I would suggest to have a look at where other app store their plugins
 so it's nice and consistent

Let me know if you need any help.

review: Needs Fixing
389. By Filippo Scognamiglio

Fix a couple of issues in desktop building.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
390. By Filippo Scognamiglio

Fix names and removes unused files.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel Holbach (dholbach) wrote :
391. By Filippo Scognamiglio

Merge changes from dholbach.

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Ok, I just merged the branch by Daniel (thank you very very much), and it seems to work fine. Please give it another go.

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Ok, I just merged the branch by Daniel (thank you very very much), and it seems to work fine. Please give it another go.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel Holbach (dholbach) wrote :

Is anyone looking after this? Maybe somebody from the touch team can help make this work?

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Daniel, it seems the build still fails; not sure why.

dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -b ubuntu-weather-app-1.8.3ubuntu1 gave error exit status 1
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc failed
bzr: ERROR: The build failed.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Right... I think we need a landing team expert to get on the case.

Unmerged revisions

391. By Filippo Scognamiglio

Merge changes from dholbach.

390. By Filippo Scognamiglio

Fix names and removes unused files.

389. By Filippo Scognamiglio

Fix a couple of issues in desktop building.

388. By Filippo Scognamiglio

Project reorganization and migration to native launcher.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-09-20 20:05:02 +0000
3+++ CMakeLists.txt 2014-12-09 18:21:47 +0000
4@@ -6,7 +6,9 @@
5 find_package(Qt5Core REQUIRED)
6 find_package(Qt5Qml REQUIRED)
7 find_package(Qt5Quick REQUIRED)
8+
9 set(CMAKE_AUTOMOC ON)
10+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra -fPIC")
11
12 # Standard install paths
13 include(GNUInstallDirs)
14@@ -14,8 +16,8 @@
15 option(INSTALL_TESTS "Install the tests on make install" on)
16 option(CLICK_MODE "Installs to a contained location" on)
17
18-set(APP_NAME weather)
19-set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
20+set(APP_NAME ubuntu-weather-app)
21+set(DESKTOP_FILE "${PROJECT_NAME}_weather.desktop")
22 set(APP_HARDCODE ubuntu-weather-app)
23 set(MAIN_QML ubuntu-weather-app.qml)
24 set(ICON_FILE weather-app@30.png)
25@@ -35,6 +37,8 @@
26 OUTPUT_STRIP_TRAILING_WHITESPACE
27 )
28
29+set(EXEC "${APP_NAME}")
30+
31 if(CLICK_MODE)
32 if(NOT DEFINED BZR_SOURCE)
33 set(BZR_SOURCE "lp:${APP_HARDCODE}")
34@@ -44,16 +48,15 @@
35 set(CMAKE_INSTALL_BINDIR /)
36 set(DATA_DIR /)
37 set(ICON ${ICON_FILE})
38- set(EXEC "qmlscene $@ ${MAIN_QML}")
39 set(DESKTOP_DIR ${DATA_DIR})
40+ set(BIN_DIR /lib/${ARCH_TRIPLET}/bin)
41 else(CLICK_MODE)
42 set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
43- set(EXEC ${APP_HARDCODE})
44 set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE})
45- configure_file(${APP_HARDCODE}.in
46- ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
47- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
48- DESTINATION ${CMAKE_INSTALL_BINDIR})
49+# configure_file(${APP_HARDCODE}.in
50+# ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
51+# install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
52+# DESTINATION ${CMAKE_INSTALL_BINDIR})
53 set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
54 endif(CLICK_MODE)
55
56@@ -64,13 +67,15 @@
57 list(SORT I18N_SRC_FILES)
58 message("Found ${I18N_SRC_FILES}")
59
60-file(GLOB SRC_FILES
61- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
62- *.qml *.js *.png *.js)
63-install(DIRECTORY components resources DESTINATION ${DATA_DIR})
64-install(FILES key.js DESTINATION ${DATA_DIR})
65-install(FILES ${MAIN_QML} ${ICON_FILE} DESTINATION ${DATA_DIR})
66-
67+#file(GLOB SRC_FILES
68+# RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
69+# *.qml *.js *.png *.js)
70+
71+#install(DIRECTORY components resources DESTINATION ${DATA_DIR})
72+#install(FILES key.js DESTINATION ${DATA_DIR})
73+#install(FILES ${MAIN_QML} ${ICON_FILE} DESTINATION ${DATA_DIR})
74+
75+install(FILES ${ICON_FILE} DESTINATION ${DATA_DIR})
76 configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
77
78 add_custom_target(${DESKTOP_FILE} ALL
79@@ -87,9 +92,7 @@
80 file(GLOB QML_JS_FILES *.qml *.js)
81 add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES})
82
83+add_subdirectory(src)
84 add_subdirectory(click)
85 add_subdirectory(po)
86 add_subdirectory(tests)
87-add_subdirectory(components)
88-add_subdirectory(plugins)
89-
90
91=== modified file 'debian/control'
92--- debian/control 2014-10-01 09:45:07 +0000
93+++ debian/control 2014-12-09 18:21:47 +0000
94@@ -11,27 +11,28 @@
95 qtbase5-dev-tools,
96 qtdeclarative5-dev,
97 qtdeclarative5-dev-tools,
98- qtdeclarative5-ubuntu-ui-toolkit-plugin,
99-Standards-Version: 3.9.5
100+ qtdeclarative5-ubuntu-ui-toolkit-plugin
101+Standards-Version: 3.9.6
102 Section: misc
103 Homepage: https://launchpad.net/ubuntu-weather-app
104 Vcs-Bzr: https://code.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-app/trunk
105
106 Package: ubuntu-weather-app
107-Architecture: all
108+Architecture: any
109 Depends: qmlscene,
110 qtdeclarative5-localstorage-plugin,
111 qtdeclarative5-qtquick2-plugin,
112 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
113+ qtdeclarative5-ubuntuweather-timezone-plugin1.0 (>= ${source:Version}),
114 suru-icon-theme | ubuntu-mobile-icons,
115- qtdeclarative5-ubuntuweather-timezone-plugin1.0 (>= ${source:Version}),
116- ${misc:Depends}
117+ ${misc:Depends},
118+ ${shlibs:Depends}
119 Description: Weather application
120 Core Weather application
121
122 Package: qtdeclarative5-ubuntuweather-timezone-plugin1.0
123 Architecture: any
124-Depends: ${shlibs:Depends}, ${misc:Depends}
125+Depends: ${misc:Depends}, ${shlibs:Depends}
126 Description: Timezone plugin, used by the Ubuntu Weather app
127 This package contains the timezone plugin written for the Ubuntu
128 Weather app.
129
130=== modified file 'debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install'
131--- debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install 2014-10-01 09:45:07 +0000
132+++ debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install 2014-12-09 18:21:47 +0000
133@@ -1,1 +1,1 @@
134-usr/lib/*/qt5/
135+usr/lib/*/TimeZone/*
136
137=== added directory 'src'
138=== added file 'src/CMakeLists.txt'
139--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
140+++ src/CMakeLists.txt 2014-12-09 18:21:47 +0000
141@@ -0,0 +1,2 @@
142+add_subdirectory(plugins)
143+add_subdirectory(app)
144
145=== added directory 'src/app'
146=== added file 'src/app/CMakeLists.txt'
147--- src/app/CMakeLists.txt 1970-01-01 00:00:00 +0000
148+++ src/app/CMakeLists.txt 2014-12-09 18:21:47 +0000
149@@ -0,0 +1,24 @@
150+file(GLOB_RECURSE QML_SRCS *.qml *.js)
151+
152+set(weather_SRCS
153+ main.cpp
154+ ${QML_SRCS}
155+)
156+
157+add_executable(ubuntu-weather-app ${weather_SRCS})
158+
159+qt5_use_modules(ubuntu-weather-app Gui Qml Quick)
160+
161+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
162+add_custom_target(weahter-qmlfiles ALL
163+ COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}
164+ DEPENDS ${QMLFILES}
165+)
166+endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
167+
168+install(DIRECTORY qml DESTINATION ${DATA_DIR})
169+if(CLICK_MODE)
170+ install(TARGETS ubuntu-weather-app DESTINATION ${BIN_DIR})
171+else()
172+ install(TARGETS ubuntu-weather-app RUNTIME DESTINATION bin)
173+endif()
174
175=== added file 'src/app/main.cpp'
176--- src/app/main.cpp 1970-01-01 00:00:00 +0000
177+++ src/app/main.cpp 2014-12-09 18:21:47 +0000
178@@ -0,0 +1,66 @@
179+/*
180+ * Copyright: 2013 - 2014 Canonical, Ltd
181+ *
182+ * This file is part of ubuntu-weather-app
183+ *
184+ * ubuntu-weather-app is free software: you can redistribute it and/or modify
185+ * it under the terms of the GNU General Public License as published by
186+ * the Free Software Foundation, either version 3 of the License, or
187+ * (at your option) any later version.
188+ *
189+ * ubuntu-weather-app is distributed in the hope that it will be useful,
190+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
191+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
192+ * GNU General Public License for more details.
193+ *
194+ * You should have received a copy of the GNU General Public License
195+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
196+ *
197+ * Authors: Filippo Scognamiglio <flscogna@gmail.com>
198+ */
199+
200+#include <QtGui/QGuiApplication>
201+#include <QtQuick/QQuickView>
202+#include <QtQml/QtQml>
203+#include <QLibrary>
204+#include <QDir>
205+
206+#include <QDebug>
207+
208+int main(int argc, char *argv[])
209+{
210+ QGuiApplication a(argc, argv);
211+ QQuickView view;
212+ view.setResizeMode(QQuickView::SizeRootObjectToView);
213+
214+ // Set up import paths. Might be useful to tweak them.
215+ QStringList importPathList = view.engine()->importPathList();
216+ importPathList.prepend(QCoreApplication::applicationDirPath() + "/../plugins/");
217+ view.engine()->setImportPathList(importPathList);
218+
219+ // TODO: Manage command line arguments if needed.
220+ QStringList args = a.arguments();
221+
222+ // Load the main QML file
223+ QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
224+ paths.prepend(QDir::currentPath());
225+ paths.prepend(QCoreApplication::applicationDirPath());
226+
227+ QString qmlfile;
228+
229+ foreach (const QString &path, paths) {
230+ QString filename("/qml/ubuntu-weather-app.qml");
231+ QFileInfo fi(path + filename);
232+ qDebug() << "Trying to load QML from:" << path + filename;
233+ if (fi.exists()) {
234+ qmlfile = path + filename;
235+ break;
236+ }
237+ }
238+
239+ qDebug() << "using main qml file from:" << qmlfile;
240+ view.setSource(QUrl::fromLocalFile(qmlfile));
241+ view.show();
242+
243+ return a.exec();
244+}
245
246=== added directory 'src/app/qml'
247=== renamed directory 'components' => 'src/app/qml/components'
248=== renamed file 'key.js' => 'src/app/qml/key.js'
249=== renamed directory 'resources' => 'src/app/qml/resources'
250=== renamed file 'ubuntu-weather-app.qml' => 'src/app/qml/ubuntu-weather-app.qml'
251=== renamed file 'ubuntu-weather-app.qmlproject' => 'src/app/qml/ubuntu-weather-app.qmlproject'
252=== renamed directory 'plugins' => 'src/plugins'
253=== modified file 'src/plugins/CMakeLists.txt'
254--- plugins/CMakeLists.txt 2014-10-01 09:45:07 +0000
255+++ src/plugins/CMakeLists.txt 2014-12-09 18:21:47 +0000
256@@ -2,9 +2,13 @@
257 ${CMAKE_CURRENT_SOURCE_DIR}
258 )
259
260+set(PLUGIN_DIR TimeZone)
261+
262 set(
263 timeZone_SRCS
264+ TimeZone/timezone.h
265 TimeZone/timezone.cpp
266+ TimeZone/timezone_plugin.h
267 TimeZone/timezone_plugin.cpp
268 )
269
270@@ -23,5 +27,5 @@
271 )
272
273 # Install plugin file
274-install(TARGETS TimeZoneBackend DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/)
275-install(FILES TimeZone/qmldir DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/)
276+install(TARGETS TimeZoneBackend DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})
277+install(FILES TimeZone/qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})
278
279=== removed file 'ubuntu-weather-app.desktop'
280--- ubuntu-weather-app.desktop 2014-04-16 14:42:16 +0000
281+++ ubuntu-weather-app.desktop 1970-01-01 00:00:00 +0000
282@@ -1,10 +0,0 @@
283-[Desktop Entry]
284-Encoding=UTF-8
285-Version=1.0
286-Type=Application
287-Terminal=false
288-Exec=qmlscene -qt5 ubuntu-weather-app.qml
289-Icon=weather64.png
290-Name=Weather
291-X-Ubuntu-Touch=true
292-X-Ubuntu-StageHint=SideStage
293
294=== removed file 'ubuntu-weather-app.in'
295--- ubuntu-weather-app.in 2014-04-16 17:35:03 +0000
296+++ ubuntu-weather-app.in 1970-01-01 00:00:00 +0000
297@@ -1,3 +0,0 @@
298-#!/bin/bash
299-export QT_SELECT=qt5
300-exec qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@

Subscribers

People subscribed via source and target branches