Merge lp:~nik90/ubuntu-weather-app/weather-reboot-fixes into lp:~vthompson/ubuntu-weather-app/build-reboot

Proposed by Nekhelesh Ramananthan
Status: Merged
Merged at revision: 4
Proposed branch: lp:~nik90/ubuntu-weather-app/weather-reboot-fixes
Merge into: lp:~vthompson/ubuntu-weather-app/build-reboot
Diff against target: 435 lines (+189/-125)
12 files modified
CMakeLists.txt (+75/-61)
app/CMakeLists.txt (+14/-3)
app/components/CMakeLists.txt (+3/-0)
app/ubuntu-weather-app.qml (+49/-0)
backend/CMakeLists.txt (+7/-5)
click/CMakeLists.txt (+0/-15)
manifest.json.in (+3/-3)
po/com.ubuntu.weather.pot (+32/-0)
tests/CMakeLists.txt (+3/-1)
ubuntu-weather-app.apparmor (+3/-2)
ubuntu-weather-app.in (+0/-3)
ubuntu-weather-app.qmlproject (+0/-32)
To merge this branch: bzr merge lp:~nik90/ubuntu-weather-app/weather-reboot-fixes
Reviewer Review Type Date Requested Status
Victor Thompson Pending
Review via email: mp+247495@code.launchpad.net

Commit message

- Can be built and run on the phone
- Cmake command is now more verbal by providing logs like "Configuring manifest file, install intltool package (if missing) etc etc...
- Removed qmlproject file as this is a pure cmake project
- Removed unnecessary ubuntu-weather-app.in file
- Removed "click" folder and moved manifest.json.in file to the root directory as recommended by bzoltan.
- Added ubuntu-weather-app.qml which shows a blank page at the moment as a starting point
- Moved "tests" folder to the root directory
- Fixed CMakelists.txt file to work with the above folder structure changes (mostly copied from the clock app)

Description of the change

This MP fixes the following,

- Can be built and run on the phone
- Cmake command is now more verbal by providing logs like "Configuring manifest file, install intltool package (if missing) etc etc...
- Removed qmlproject file as this is a pure cmake project
- Removed unnecessary ubuntu-weather-app.in file
- Removed "click" folder and moved manifest.json.in file to the root directory as recommended by bzoltan.
- Added ubuntu-weather-app.qml which shows a blank page at the moment as a starting point
- Moved "tests" folder to the root directory
- Fixed CMakelists.txt file to work with the above folder structure changes (mostly copied from the clock app)

Note: This branch can be built and run on the phone :) .. At the moment it shows a blank page with the page title "Weather" as a starting point.

http://imgur.com/Jfao7gV

To post a comment you must log in.
7. By Nekhelesh Ramananthan

Removed unnecessary ubuntu-weather-app.in file

8. By Nekhelesh Ramananthan

Minor fixes

9. By Nekhelesh Ramananthan

Removed references to clock app

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 2015-01-23 13:30:46 +0000
3+++ CMakeLists.txt 2015-01-23 23:36:13 +0000
4@@ -1,94 +1,108 @@
5 project(com.ubuntu.weather)
6 cmake_minimum_required(VERSION 2.8.9)
7+
8 find_program(INTLTOOL_MERGE intltool-merge)
9+if(NOT INTLTOOL_MERGE)
10+ message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
11+endif()
12 find_program(INTLTOOL_EXTRACT intltool-extract)
13+if(NOT INTLTOOL_EXTRACT)
14+ message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
15+endif()
16+
17+set (UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
18+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
19
20 find_package(Qt5Core REQUIRED)
21 find_package(Qt5Qml REQUIRED)
22 find_package(Qt5Quick REQUIRED)
23+
24+# Automatically create moc files
25 set(CMAKE_AUTOMOC ON)
26
27+option(INSTALL_TESTS "Install the tests on make install" on)
28+option(CLICK_MODE "Build as a click package" on)
29+
30+# Tests
31+enable_testing()
32+
33 # Standard install paths
34 include(GNUInstallDirs)
35
36-option(INSTALL_TESTS "Install the tests on make install" on)
37-option(CLICK_MODE "Installs to a contained location" on)
38-
39 set(APP_NAME weather)
40-set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
41 set(APP_HARDCODE ubuntu-weather-app)
42-set(MAIN_QML ubuntu-weather-app.qml)
43-set(ICON_FILE weather-app@30.png)
44+set(MAIN_QML ${APP_HARDCODE}.qml)
45+set(DESKTOP_FILE "${APP_HARDCODE}.desktop")
46+set(ICON weather-app@30.png)
47 set(AUTOPILOT_DIR ubuntu_weather_app)
48-set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
49-
50-# components PATH
51-execute_process(
52- COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
53- OUTPUT_VARIABLE ARCH_TRIPLET
54- OUTPUT_STRIP_TRAILING_WHITESPACE
55-)
56-set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
57-execute_process(
58- COMMAND dpkg-architecture -qDEB_HOST_ARCH
59- OUTPUT_VARIABLE CLICK_ARCH
60- OUTPUT_STRIP_TRAILING_WHITESPACE
61-)
62-
63+
64+# Set install paths
65 if(CLICK_MODE)
66- if(NOT DEFINED BZR_SOURCE)
67- set(BZR_SOURCE "lp:${APP_HARDCODE}")
68- message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
69- endif(NOT DEFINED BZR_SOURCE)
70- set(CMAKE_INSTALL_PREFIX /)
71- set(CMAKE_INSTALL_BINDIR /)
72- set(DATA_DIR /)
73- set(ICON ${ICON_FILE})
74- set(EXEC "qmlscene $@ ${MAIN_QML}")
75- set(DESKTOP_DIR ${DATA_DIR})
76+ set(CMAKE_INSTALL_PREFIX "/")
77+ set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/qml")
78+
79+ set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}")
80+ set(EXEC "qmlscene $@ ${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}")
81+ set(MODULE_PATH ${QT_IMPORTS_DIR})
82+ if(NOT BZR_REVNO)
83+ execute_process(
84+ COMMAND bzr revno
85+ OUTPUT_VARIABLE BZR_REVNO
86+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
87+ OUTPUT_STRIP_TRAILING_WHITESPACE
88+ )
89+ endif(NOT BZR_REVNO)
90+ if(NOT BZR_SOURCE)
91+ set(BZR_SOURCE "lp:${APP_HARDCODE}/reboot")
92+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
93+ endif(NOT BZR_SOURCE)
94 else(CLICK_MODE)
95- set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
96- set(EXEC ${APP_HARDCODE})
97- set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE})
98- configure_file(${APP_HARDCODE}.in
99- ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
100- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
101- DESTINATION ${CMAKE_INSTALL_BINDIR})
102- set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
103+ set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/ubuntu-weather-app")
104+ execute_process(
105+ COMMAND qmake -query QT_INSTALL_QML
106+ OUTPUT_VARIABLE QT_IMPORTS_DIR
107+ OUTPUT_STRIP_TRAILING_WHITESPACE
108+ )
109+ set(MODULE_PATH ${QT_IMPORTS_DIR}/WeatherApp)
110 endif(CLICK_MODE)
111
112+if(${CLICK_MODE})
113+ message("-- Configuring manifest.json")
114+
115+ execute_process(
116+ COMMAND dpkg-architecture -qDEB_HOST_ARCH
117+ OUTPUT_VARIABLE CLICK_ARCH
118+ OUTPUT_STRIP_TRAILING_WHITESPACE
119+ )
120+
121+ configure_file(${UBUNTU_MANIFEST_PATH} ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
122+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
123+ install(FILES "${APP_HARDCODE}.apparmor" DESTINATION ${CMAKE_INSTALL_PREFIX})
124+else(CLICK_MODE)
125+ set(EXEC "qmlscene $@ -I ${MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}")
126+endif()
127+
128+
129 file(GLOB_RECURSE I18N_SRC_FILES
130- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
131- components/*.qml components/*.js *.qml)
132+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
133+ *.qml *.js)
134 list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h)
135 list(SORT I18N_SRC_FILES)
136-message("Found ${I18N_SRC_FILES}")
137-
138-file(GLOB SRC_FILES
139- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
140- *.qml *.js *.png *.js)
141-install(DIRECTORY components resources DESTINATION ${DATA_DIR})
142-install(FILES key.js DESTINATION ${DATA_DIR})
143-install(FILES ${MAIN_QML} ${ICON_FILE} DESTINATION ${DATA_DIR})
144
145 configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
146
147 add_custom_target(${DESKTOP_FILE} ALL
148- COMMENT "Merging translations into ${DESKTOP_FILE}"
149- COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} >/dev/null
150+ COMMENT "Merging translations into ${DESKTOP_FILE}..."
151+ COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE}
152 )
153
154 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
155- DESTINATION ${DESKTOP_DIR})
156-
157-# Tests
158-enable_testing()
159-
160-file(GLOB QML_JS_FILES *.qml *.js)
161-add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES})
162-
163-add_subdirectory(click)
164-add_subdirectory(po)
165+ DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
166+
167 add_subdirectory(app)
168 add_subdirectory(backend)
169+add_subdirectory(po)
170+add_subdirectory(tests)
171+
172+# TODO: Add custom target for autopilot and run.
173
174
175=== modified file 'app/CMakeLists.txt'
176--- app/CMakeLists.txt 2015-01-23 13:30:46 +0000
177+++ app/CMakeLists.txt 2015-01-23 23:36:13 +0000
178@@ -1,4 +1,15 @@
179-file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js)
180-add_custom_target(ubuntu-weather-app_app_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES})
181+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
182+ file(GLOB QML_JS_FILES *.qml *.js)
183+ add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES})
184+endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
185+
186+
187+if(CLICK_MODE)
188+ set(ICON ${ICON})
189+ install(FILES ${ICON} DESTINATION ${CMAKE_INSTALL_PREFIX})
190+endif(CLICK_MODE)
191+
192+install(FILES ${MAIN_QML} DESTINATION ${UBUNTU-WEATHER_APP_DIR})
193+
194 add_subdirectory(components)
195-add_subdirectory(tests)
196+
197
198=== modified file 'app/components/CMakeLists.txt'
199--- app/components/CMakeLists.txt 2015-01-23 02:25:35 +0000
200+++ app/components/CMakeLists.txt 2015-01-23 23:36:13 +0000
201@@ -1,2 +1,5 @@
202 file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js)
203+
204 add_custom_target(ubuntu-weather-app_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES})
205+
206+install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/components)
207
208=== added file 'app/ubuntu-weather-app.qml'
209--- app/ubuntu-weather-app.qml 1970-01-01 00:00:00 +0000
210+++ app/ubuntu-weather-app.qml 2015-01-23 23:36:13 +0000
211@@ -0,0 +1,49 @@
212+/*
213+ * Copyright (C) 2015 Canonical Ltd
214+ *
215+ * This file is part of Ubuntu Weather App
216+ *
217+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
218+ * it under the terms of the GNU General Public License version 3 as
219+ * published by the Free Software Foundation.
220+ *
221+ * Ubuntu Clock App is distributed in the hope that it will be useful,
222+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
223+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
224+ * GNU General Public License for more details.
225+ *
226+ * You should have received a copy of the GNU General Public License
227+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
228+ */
229+
230+import QtQuick 2.3
231+import Ubuntu.Components 1.1
232+
233+MainView {
234+ id: weatherApp
235+
236+ objectName: "weather"
237+
238+ applicationName: "com.ubuntu.weather"
239+
240+ automaticOrientation: false
241+
242+ width: units.gu(40)
243+ height: units.gu(70)
244+
245+ backgroundColor: "#F5F5F5"
246+
247+ useDeprecatedToolbar: false
248+ anchorToKeyboard: true
249+
250+
251+ Page {
252+ title: "Weather Reboot"
253+
254+ Label {
255+ anchors.centerIn: parent
256+ text: "Let the awesomeness begin :)"
257+ }
258+
259+ }
260+}
261
262=== renamed file 'weather-app@30.png' => 'app/weather-app@30.png'
263=== modified file 'backend/CMakeLists.txt'
264--- backend/CMakeLists.txt 2015-01-23 02:25:35 +0000
265+++ backend/CMakeLists.txt 2015-01-23 23:36:13 +0000
266@@ -1,12 +1,14 @@
267+project(backend)
268+
269 include_directories(
270 ${CMAKE_CURRENT_SOURCE_DIR}
271 )
272
273-set(
274- timeZone_SRCS
275- TimeZone/timezone.cpp
276- TimeZone/timezone_plugin.cpp
277-)
278+#set(
279+# timeZone_SRCS
280+# TimeZone/timezone.cpp
281+# TimeZone/timezone_plugin.cpp
282+#)
283
284 #add_library(TimeZoneBackend MODULE
285 # ${timeZone_SRCS}
286
287=== removed directory 'click'
288=== removed file 'click/CMakeLists.txt'
289--- click/CMakeLists.txt 2015-01-22 21:56:55 +0000
290+++ click/CMakeLists.txt 1970-01-01 00:00:00 +0000
291@@ -1,15 +0,0 @@
292-if(CLICK_MODE)
293- if(NOT BZR_REVNO)
294- set(BZR_REVNO "latest")
295- endif(NOT BZR_REVNO)
296- configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
297- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json weather.apparmor
298- DESTINATION ${CMAKE_INSTALL_PREFIX})
299-
300- # make the click files visible in qtcreator
301- file(GLOB CLICK_FILES
302- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
303- *.json *.json.in *.apparmor)
304-
305- add_custom_target(com_ubuntu_weather_CLICKFiles ALL SOURCES ${CLICK_FILES})
306-endif(CLICK_MODE)
307
308=== renamed file 'click/manifest.json.in' => 'manifest.json.in'
309--- click/manifest.json.in 2015-01-22 21:56:55 +0000
310+++ manifest.json.in 2015-01-23 23:36:13 +0000
311@@ -4,15 +4,15 @@
312 "framework": "ubuntu-sdk-14.10",
313 "hooks": {
314 "weather": {
315- "apparmor": "weather.apparmor",
316- "desktop": "@DESKTOP_FILE@"
317+ "apparmor": "ubuntu-weather-app.apparmor",
318+ "desktop": "@CMAKE_INSTALL_DATADIR@/applications/ubuntu-weather-app.desktop"
319 }
320 },
321 "icon": "@ICON@",
322 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
323 "name": "@PROJECT_NAME@",
324 "title": "Weather",
325- "version": "2.0.@BZR_REVNO@",
326+ "version": "3.0.@BZR_REVNO@",
327 "x-source": {
328 "vcs-bzr": "@BZR_SOURCE@",
329 "vcs-bzr-revno": "@BZR_REVNO@"
330
331=== added file 'po/com.ubuntu.weather.pot'
332--- po/com.ubuntu.weather.pot 1970-01-01 00:00:00 +0000
333+++ po/com.ubuntu.weather.pot 2015-01-23 23:36:13 +0000
334@@ -0,0 +1,32 @@
335+# SOME DESCRIPTIVE TITLE.
336+# Copyright (C) YEAR Canonical Ltd.
337+# This file is distributed under the same license as the PACKAGE package.
338+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
339+#
340+#, fuzzy
341+msgid ""
342+msgstr ""
343+"Project-Id-Version: ubuntu-weather-app\n"
344+"Report-Msgid-Bugs-To: \n"
345+"POT-Creation-Date: 2015-01-24 00:26+0100\n"
346+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
347+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
348+"Language-Team: LANGUAGE <LL@li.org>\n"
349+"Language: \n"
350+"MIME-Version: 1.0\n"
351+"Content-Type: text/plain; charset=CHARSET\n"
352+"Content-Transfer-Encoding: 8bit\n"
353+
354+#: ubuntu-weather-app.desktop.in.in.h:1
355+msgid "Weather"
356+msgstr ""
357+
358+#: ubuntu-weather-app.desktop.in.in.h:2
359+msgid ""
360+"A weather forecast application for Ubuntu with support for multiple online "
361+"weather data sources"
362+msgstr ""
363+
364+#: ubuntu-weather-app.desktop.in.in.h:3
365+msgid "weather;forecast;twc;openweathermap;the weather channel;"
366+msgstr ""
367
368=== renamed directory 'app/tests' => 'tests'
369=== modified file 'tests/CMakeLists.txt'
370--- app/tests/CMakeLists.txt 2015-01-23 02:25:35 +0000
371+++ tests/CMakeLists.txt 2015-01-23 23:36:13 +0000
372@@ -1,1 +1,3 @@
373-add_subdirectory(autopilot)
374+if(NOT CLICK_MODE)
375+ add_subdirectory(autopilot)
376+endif(NOT CLICK_MODE)
377
378=== renamed file 'click/weather.apparmor' => 'ubuntu-weather-app.apparmor'
379--- click/weather.apparmor 2015-01-22 21:56:55 +0000
380+++ ubuntu-weather-app.apparmor 2015-01-23 23:36:13 +0000
381@@ -1,5 +1,6 @@
382 {
383- "policy_groups": ["networking"
384- ],
385+ "policy_groups": [
386+ "networking"
387+ ],
388 "policy_version": 1.2
389 }
390
391=== renamed file 'com.ubuntu.weather_weather.desktop.in.in' => 'ubuntu-weather-app.desktop.in.in'
392=== removed file 'ubuntu-weather-app.in'
393--- ubuntu-weather-app.in 2015-01-22 21:56:55 +0000
394+++ ubuntu-weather-app.in 1970-01-01 00:00:00 +0000
395@@ -1,3 +0,0 @@
396-#!/bin/bash
397-export QT_SELECT=qt5
398-exec qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@
399
400=== removed file 'ubuntu-weather-app.qmlproject'
401--- ubuntu-weather-app.qmlproject 2015-01-22 21:56:55 +0000
402+++ ubuntu-weather-app.qmlproject 1970-01-01 00:00:00 +0000
403@@ -1,32 +0,0 @@
404-/* File generated by Qt Creator, version 2.6.1 */
405-
406-import QmlProject 1.1
407-
408-Project {
409- mainFile: "ubuntu-weather-app.qml"
410-
411- /* Include .qml, .js, and image files from current directory and subdirectories */
412- QmlFiles {
413- directory: "."
414- }
415- JavaScriptFiles {
416- directory: "."
417- }
418- ImageFiles {
419- directory: "."
420- }
421- /* Shows the README files in the project view */
422- Files {
423- filter: "README*"
424- }
425- /* Shows the translation files and the .pro file used to generate the .pot template */
426- Files {
427- filter: "*.po*"
428- }
429- /* Shows the CMake files */
430- Files {
431- filter: "CMakeLists.txt"
432- }
433- /* List of plugin directories passed to QML runtime */
434- importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]
435-}

Subscribers

People subscribed via source and target branches