Merge lp:~marcustomlinson/unity-js-scopes/tool-setup into lp:unity-js-scopes
- tool-setup
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 88 |
Proposed branch: | lp:~marcustomlinson/unity-js-scopes/tool-setup |
Merge into: | lp:unity-js-scopes |
Diff against target: |
794 lines (+615/-36) 16 files modified
.bzrignore (+2/-0) CMakeLists.txt (+4/-1) debian/control (+12/-9) debian/unity-js-scopes-dev.install (+1/-0) qtc-templates/scope-js/.bzrignore (+5/-0) qtc-templates/scope-js/CMakeLists.txt (+57/-0) qtc-templates/scope-js/displayName.apparmor (+6/-0) qtc-templates/scope-js/manifest.json.in (+15/-0) qtc-templates/scope-js/po/CMakeLists.txt (+14/-0) qtc-templates/scope-js/po/POTFILES.in.in (+3/-0) qtc-templates/scope-js/src/CMakeLists.txt (+61/-0) qtc-templates/scope-js/src/data/displayName-settings.ini.in (+21/-0) qtc-templates/scope-js/src/data/displayName.ini.in (+9/-0) qtc-templates/scope-js/src/displayName.js.in (+224/-0) qtc-templates/scope-js/wizard.xml (+96/-0) src/tool/main.cc (+85/-26) |
To merge this branch: | bzr merge lp:~marcustomlinson/unity-js-scopes/tool-setup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Abreu (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+275493@code.launchpad.net |
This proposal supersedes a proposal from 2015-10-22.
Commit message
* Added a "setup" option to unity-js-
* Added qtc templates to be installed with unity-js-scopes-dev
Description of the change
* Added a "setup" option to unity-js-
* Added qtc templates to be installed with unity-js-scopes-dev
With these changes we make setup for js scope development much easier.
3 easy steps to get everything ready:
1. sudo add-apt-repository ppa:ubuntu-
2. sudo apt update && sudo apt install unity-js-scopes-dev
3. unity-js-
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Alexandre Abreu (abreu-alexandre) wrote : Posted in a previous version of this proposal | # |
a few comments, inline
Marcus Tomlinson (marcustomlinson) wrote : Posted in a previous version of this proposal | # |
> a few comments, inline
fixed
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:95
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
K, I've removed my dependancy on the /doc branch. Please could you review and merge this branch independent of that one. Thanks
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:93
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandre Abreu (abreu-alexandre) : | # |
Preview Diff
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2015-09-14 09:28:53 +0000 | |||
3 | +++ .bzrignore 2015-10-23 07:30:32 +0000 | |||
4 | @@ -2,3 +2,5 @@ | |||
5 | 2 | ./deps/v8-cpp | 2 | ./deps/v8-cpp |
6 | 3 | ./CMakeLists.txt.user | 3 | ./CMakeLists.txt.user |
7 | 4 | ./examples/simple-click/CMakeLists.txt.user | 4 | ./examples/simple-click/CMakeLists.txt.user |
8 | 5 | ./examples/simple-click/src/etc | ||
9 | 6 | ./examples/simple-click/src/node_modules | ||
10 | 5 | 7 | ||
11 | === modified file 'CMakeLists.txt' | |||
12 | --- CMakeLists.txt 2015-10-01 14:46:56 +0000 | |||
13 | +++ CMakeLists.txt 2015-10-23 07:30:32 +0000 | |||
14 | @@ -61,5 +61,8 @@ | |||
15 | 61 | 61 | ||
16 | 62 | add_subdirectory(src) | 62 | add_subdirectory(src) |
17 | 63 | 63 | ||
19 | 64 | install(DIRECTORY examples | 64 | install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/examples |
20 | 65 | DESTINATION ${CMAKE_INSTALL_DATADIR}/unity-js-scopes) | 65 | DESTINATION ${CMAKE_INSTALL_DATADIR}/unity-js-scopes) |
21 | 66 | |||
22 | 67 | install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/qtc-templates/scope-js | ||
23 | 68 | DESTINATION /usr/share/qtcreator/templates/wizards/ubuntu) | ||
24 | 66 | 69 | ||
25 | === modified file 'debian/control' | |||
26 | --- debian/control 2015-10-13 13:07:02 +0000 | |||
27 | +++ debian/control 2015-10-23 07:30:32 +0000 | |||
28 | @@ -22,8 +22,8 @@ | |||
29 | 22 | Multi-Arch: foreign | 22 | Multi-Arch: foreign |
30 | 23 | Depends: ${misc:Depends}, | 23 | Depends: ${misc:Depends}, |
31 | 24 | ${shlibs:Depends}, | 24 | ${shlibs:Depends}, |
34 | 25 | Description: Javascript bindings to unity scopes library | 25 | Description: JavaScript bindings to Unity Scopes API |
35 | 26 | Provides a means for developers to develop Ubuntu Scopes in Javascript | 26 | Provides a means for developers to develop Ubuntu Scopes in JavaScript |
36 | 27 | by providing bindings to the Unity Scopes API. | 27 | by providing bindings to the Unity Scopes API. |
37 | 28 | 28 | ||
38 | 29 | Package: unity-js-scopes-launcher | 29 | Package: unity-js-scopes-launcher |
39 | @@ -32,8 +32,8 @@ | |||
40 | 32 | Depends: ${misc:Depends}, | 32 | Depends: ${misc:Depends}, |
41 | 33 | ${shlibs:Depends}, | 33 | ${shlibs:Depends}, |
42 | 34 | unity-js-scopes-bindings (= ${binary:Version}), | 34 | unity-js-scopes-bindings (= ${binary:Version}), |
45 | 35 | Description: Scope launcher for unity javascript scopes | 35 | Description: Scope launcher for Unity JavaScript Scopes |
46 | 36 | Provides a means for developers to launch their Javascript Ubuntu Scopes. | 36 | Provides a means for developers to launch their JavaScript Ubuntu Scopes. |
47 | 37 | 37 | ||
48 | 38 | Package: unity-js-scopes-tool | 38 | Package: unity-js-scopes-tool |
49 | 39 | Architecture: any | 39 | Architecture: any |
50 | @@ -42,14 +42,17 @@ | |||
51 | 42 | ${shlibs:Depends}, | 42 | ${shlibs:Depends}, |
52 | 43 | unity-js-scopes-bindings (= ${binary:Version}), | 43 | unity-js-scopes-bindings (= ${binary:Version}), |
53 | 44 | unity-js-scopes-launcher (= ${binary:Version}), | 44 | unity-js-scopes-launcher (= ${binary:Version}), |
56 | 45 | Description: Scope tool for unity javascript scopes | 45 | Description: Scope tool for Unity JavaScript Scopes |
57 | 46 | Provides a means for developers to configure their Javascript Ubuntu Scopes. | 46 | Provides a means for developers to configure their JavaScript Ubuntu Scopes. |
58 | 47 | 47 | ||
60 | 48 | Package: unity-js-scopes-examples | 48 | Package: unity-js-scopes-dev |
61 | 49 | Architecture: any | 49 | Architecture: any |
62 | 50 | Multi-Arch: foreign | 50 | Multi-Arch: foreign |
63 | 51 | Depends: ${misc:Depends}, | 51 | Depends: ${misc:Depends}, |
64 | 52 | ${shlibs:Depends}, | 52 | ${shlibs:Depends}, |
65 | 53 | unity-js-scopes-bindings (= ${binary:Version}), | 53 | unity-js-scopes-bindings (= ${binary:Version}), |
68 | 54 | Description: Examples for javascript unity scopes | 54 | unity-js-scopes-launcher (= ${binary:Version}), |
69 | 55 | Provides a set of examples for unity scopes written in javascript. | 55 | unity-js-scopes-tool (= ${binary:Version}), |
70 | 56 | Description: Development files for Unity JavaScript Scopes | ||
71 | 57 | Provides a set of Qt Creator templates and examples for Ubuntu Scopes | ||
72 | 58 | written in JavaScript. | ||
73 | 56 | 59 | ||
74 | === renamed file 'debian/unity-js-scopes-examples.install' => 'debian/unity-js-scopes-dev.install' | |||
75 | --- debian/unity-js-scopes-examples.install 2015-09-30 19:54:57 +0000 | |||
76 | +++ debian/unity-js-scopes-dev.install 2015-10-23 07:30:32 +0000 | |||
77 | @@ -1,1 +1,2 @@ | |||
78 | 1 | usr/share/unity-js-scopes/examples/ | 1 | usr/share/unity-js-scopes/examples/ |
79 | 2 | usr/share/qtcreator/templates/wizards/ubuntu/ | ||
80 | 2 | 3 | ||
81 | === added directory 'qtc-templates' | |||
82 | === added directory 'qtc-templates/scope-js' | |||
83 | === added file 'qtc-templates/scope-js/.bzrignore' | |||
84 | --- qtc-templates/scope-js/.bzrignore 1970-01-01 00:00:00 +0000 | |||
85 | +++ qtc-templates/scope-js/.bzrignore 2015-10-23 07:30:32 +0000 | |||
86 | @@ -0,0 +1,5 @@ | |||
87 | 1 | ./CMakeLists.txt.user | ||
88 | 2 | ./po/Makefile.in.in | ||
89 | 3 | ./po/POTFILES.in | ||
90 | 4 | ./src/etc | ||
91 | 5 | ./src/node_modules | ||
92 | 0 | 6 | ||
93 | === added file 'qtc-templates/scope-js/CMakeLists.txt' | |||
94 | --- qtc-templates/scope-js/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
95 | +++ qtc-templates/scope-js/CMakeLists.txt 2015-10-23 07:30:32 +0000 | |||
96 | @@ -0,0 +1,57 @@ | |||
97 | 1 | project(%ProjectName:l%) | ||
98 | 2 | cmake_minimum_required(VERSION 2.8.10) | ||
99 | 3 | |||
100 | 4 | # This is required to ensure the correct node modules are included in the project | ||
101 | 5 | execute_process(COMMAND unity-js-scopes-tool install ${CMAKE_SOURCE_DIR}/src/node_modules unity-js-scopes) | ||
102 | 6 | @if "%ContentType%" == "http+xml" | ||
103 | 7 | execute_process(COMMAND unity-js-scopes-tool install ${CMAKE_SOURCE_DIR}/src/node_modules pixl-xml) | ||
104 | 8 | @endif | ||
105 | 9 | add_custom_target(build_modules ALL COMMAND unity-js-scopes-tool build ${CMAKE_SOURCE_DIR}/src/node_modules) | ||
106 | 10 | |||
107 | 11 | # Do not remove this, its required for the correct functionality of the Ubuntu-SDK | ||
108 | 12 | set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") | ||
109 | 13 | set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project") | ||
110 | 14 | |||
111 | 15 | # Important project paths | ||
112 | 16 | set(CMAKE_INSTALL_PREFIX /) | ||
113 | 17 | set(SCOPE_INSTALL_DIR "/%ClickHookName:l%") | ||
114 | 18 | set(GETTEXT_PACKAGE "%ProjectName:l%") | ||
115 | 19 | set(PACKAGE_NAME "%ProjectName:l%.%ClickDomain:l%") | ||
116 | 20 | set(SCOPE_NAME "${PACKAGE_NAME}_%ClickHookName:l%") | ||
117 | 21 | |||
118 | 22 | # This command figures out the target architecture and puts it into the manifest file | ||
119 | 23 | execute_process( | ||
120 | 24 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
121 | 25 | OUTPUT_VARIABLE CLICK_ARCH | ||
122 | 26 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
123 | 27 | ) | ||
124 | 28 | |||
125 | 29 | # Install the manifest and apparmor files | ||
126 | 30 | configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | ||
127 | 31 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION "/") | ||
128 | 32 | install(FILES "%ClickHookName:l%.apparmor" DESTINATION "/") | ||
129 | 33 | |||
130 | 34 | # Make these files show up in QtCreator | ||
131 | 35 | file(GLOB_RECURSE | ||
132 | 36 | _PO_JS_FILES | ||
133 | 37 | "po/*.po" | ||
134 | 38 | "*.js" | ||
135 | 39 | ) | ||
136 | 40 | add_custom_target(hidden_files | ||
137 | 41 | ALL | ||
138 | 42 | SOURCES | ||
139 | 43 | manifest.json.in | ||
140 | 44 | %ClickHookName:l%.apparmor | ||
141 | 45 | src/data/%ClickHookName:l%.ini.in | ||
142 | 46 | src/data/%ClickHookName:l%-settings.ini.in | ||
143 | 47 | po/POTFILES.in.in | ||
144 | 48 | po/${GETTEXT_PACKAGE}.pot | ||
145 | 49 | ${_PO_JS_FILES} | ||
146 | 50 | ) | ||
147 | 51 | |||
148 | 52 | # Search for our dependencies | ||
149 | 53 | find_package(Intltool) | ||
150 | 54 | |||
151 | 55 | # Add our main directories | ||
152 | 56 | add_subdirectory(po) | ||
153 | 57 | add_subdirectory(src) | ||
154 | 0 | 58 | ||
155 | === added file 'qtc-templates/scope-js/displayName.apparmor' | |||
156 | --- qtc-templates/scope-js/displayName.apparmor 1970-01-01 00:00:00 +0000 | |||
157 | +++ qtc-templates/scope-js/displayName.apparmor 2015-10-23 07:30:32 +0000 | |||
158 | @@ -0,0 +1,6 @@ | |||
159 | 1 | { | ||
160 | 2 | "template": "%ConfinementType%", | ||
161 | 3 | "policy_groups": [], | ||
162 | 4 | "policy_version": %ClickAAPolicyVersion% | ||
163 | 5 | } | ||
164 | 6 | |||
165 | 0 | 7 | ||
166 | === added file 'qtc-templates/scope-js/manifest.json.in' | |||
167 | --- qtc-templates/scope-js/manifest.json.in 1970-01-01 00:00:00 +0000 | |||
168 | +++ qtc-templates/scope-js/manifest.json.in 2015-10-23 07:30:32 +0000 | |||
169 | @@ -0,0 +1,15 @@ | |||
170 | 1 | { | ||
171 | 2 | "description": "A simple Unity scope written in JavaScript", | ||
172 | 3 | "maintainer": "%ClickMaintainer%", | ||
173 | 4 | "architecture": "@CLICK_ARCH@", | ||
174 | 5 | "name": "%ProjectName:l%.%ClickDomain:l%", | ||
175 | 6 | "title": "%ProjectName:l%", | ||
176 | 7 | "framework" : "%ClickFrameworkVersion%", | ||
177 | 8 | "hooks": { | ||
178 | 9 | "%ClickHookName:l%": { | ||
179 | 10 | "scope": "%ClickHookName:l%", | ||
180 | 11 | "apparmor": "%ClickHookName:l%.apparmor" | ||
181 | 12 | } | ||
182 | 13 | } | ||
183 | 14 | } | ||
184 | 15 | |||
185 | 0 | 16 | ||
186 | === added directory 'qtc-templates/scope-js/po' | |||
187 | === added file 'qtc-templates/scope-js/po/CMakeLists.txt' | |||
188 | --- qtc-templates/scope-js/po/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
189 | +++ qtc-templates/scope-js/po/CMakeLists.txt 2015-10-23 07:30:32 +0000 | |||
190 | @@ -0,0 +1,14 @@ | |||
191 | 1 | intltool_update_potfile( | ||
192 | 2 | ALL | ||
193 | 3 | KEYWORDS "tr" "tr:1,2" "dtr:2" "dtr:2,3" "N_" | ||
194 | 4 | COPYRIGHT_HOLDER "" | ||
195 | 5 | POTFILES_TEMPLATE "POTFILES.in.in" | ||
196 | 6 | GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
197 | 7 | ) | ||
198 | 8 | |||
199 | 9 | intltool_install_translations( | ||
200 | 10 | ALL | ||
201 | 11 | GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
202 | 12 | ) | ||
203 | 13 | |||
204 | 14 | |||
205 | 0 | 15 | ||
206 | === added file 'qtc-templates/scope-js/po/POTFILES.in.in' | |||
207 | --- qtc-templates/scope-js/po/POTFILES.in.in 1970-01-01 00:00:00 +0000 | |||
208 | +++ qtc-templates/scope-js/po/POTFILES.in.in 2015-10-23 07:30:32 +0000 | |||
209 | @@ -0,0 +1,3 @@ | |||
210 | 1 | [type: gettext/ini] src/data/%ClickHookName:l%.ini.in | ||
211 | 2 | [type: gettext/ini] src/data/%ClickHookName:l%-settings.ini.in | ||
212 | 3 | @GENERATED_POTFILES@ | ||
213 | 0 | 4 | ||
214 | === added file 'qtc-templates/scope-js/po/displayName.pot' | |||
215 | === added directory 'qtc-templates/scope-js/src' | |||
216 | === added file 'qtc-templates/scope-js/src/CMakeLists.txt' | |||
217 | --- qtc-templates/scope-js/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
218 | +++ qtc-templates/scope-js/src/CMakeLists.txt 2015-10-23 07:30:32 +0000 | |||
219 | @@ -0,0 +1,61 @@ | |||
220 | 1 | # Put the ini, image, and js files in the build directory next | ||
221 | 2 | # to the scope .so file so test tools can find them easily. | ||
222 | 3 | intltool_merge_translations( | ||
223 | 4 | "data/%ClickHookName:l%.ini.in" | ||
224 | 5 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | ||
225 | 6 | ALL UTF8 | ||
226 | 7 | ) | ||
227 | 8 | intltool_merge_translations( | ||
228 | 9 | "data/%ClickHookName:l%-settings.ini.in" | ||
229 | 10 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
230 | 11 | ALL UTF8 | ||
231 | 12 | ) | ||
232 | 13 | |||
233 | 14 | configure_file( | ||
234 | 15 | "data/icon.png" | ||
235 | 16 | "${CMAKE_CURRENT_BINARY_DIR}/icon.png" | ||
236 | 17 | @ONLY COPYONLY | ||
237 | 18 | ) | ||
238 | 19 | configure_file( | ||
239 | 20 | "data/logo.png" | ||
240 | 21 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" | ||
241 | 22 | @ONLY COPYONLY | ||
242 | 23 | ) | ||
243 | 24 | |||
244 | 25 | configure_file( | ||
245 | 26 | "%ClickHookName:l%.js" | ||
246 | 27 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.js" | ||
247 | 28 | @ONLY COPYONLY | ||
248 | 29 | ) | ||
249 | 30 | |||
250 | 31 | add_custom_target( | ||
251 | 32 | copy_modules ALL | ||
252 | 33 | COMMAND ${CMAKE_COMMAND} -E create_symlink | ||
253 | 34 | "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" | ||
254 | 35 | "${CMAKE_CURRENT_BINARY_DIR}/node_modules" | ||
255 | 36 | ) | ||
256 | 37 | |||
257 | 38 | # Install the scope ini, image, and js files | ||
258 | 39 | install( | ||
259 | 40 | FILES | ||
260 | 41 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | ||
261 | 42 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
262 | 43 | "${CMAKE_CURRENT_BINARY_DIR}/icon.png" | ||
263 | 44 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" | ||
264 | 45 | DESTINATION | ||
265 | 46 | ${SCOPE_INSTALL_DIR} | ||
266 | 47 | ) | ||
267 | 48 | |||
268 | 49 | install( | ||
269 | 50 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
270 | 51 | DESTINATION ${SCOPE_INSTALL_DIR} | ||
271 | 52 | FILES_MATCHING PATTERN "*.js" | ||
272 | 53 | ) | ||
273 | 54 | |||
274 | 55 | install( | ||
275 | 56 | DIRECTORY | ||
276 | 57 | "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" | ||
277 | 58 | DESTINATION | ||
278 | 59 | ${SCOPE_INSTALL_DIR} | ||
279 | 60 | USE_SOURCE_PERMISSIONS | ||
280 | 61 | ) | ||
281 | 0 | 62 | ||
282 | === added directory 'qtc-templates/scope-js/src/data' | |||
283 | === added file 'qtc-templates/scope-js/src/data/displayName-settings.ini.in' | |||
284 | --- qtc-templates/scope-js/src/data/displayName-settings.ini.in 1970-01-01 00:00:00 +0000 | |||
285 | +++ qtc-templates/scope-js/src/data/displayName-settings.ini.in 2015-10-23 07:30:32 +0000 | |||
286 | @@ -0,0 +1,21 @@ | |||
287 | 1 | @if "%ContentType%" != "empty" | ||
288 | 2 | # Below are some example settings. You can access your scope's | ||
289 | 3 | # settings by calling settings() from the Query::run() method. | ||
290 | 4 | # E.g. auto location = settings().at("location").get_string(); | ||
291 | 5 | |||
292 | 6 | #[location] | ||
293 | 7 | #type = string | ||
294 | 8 | #defaultValue = London,uk | ||
295 | 9 | #_displayName = Default Location | ||
296 | 10 | |||
297 | 11 | #[units] | ||
298 | 12 | #type = list | ||
299 | 13 | #_displayName = Temperature Units | ||
300 | 14 | #_displayValues = Metric;Imperial | ||
301 | 15 | #defaultValue = 0 | ||
302 | 16 | |||
303 | 17 | #[forecast] | ||
304 | 18 | #type = boolean | ||
305 | 19 | #defaultValue = true | ||
306 | 20 | #_displayName = Show Forecast | ||
307 | 21 | @endif | ||
308 | 0 | 22 | ||
309 | === added file 'qtc-templates/scope-js/src/data/displayName.ini.in' | |||
310 | --- qtc-templates/scope-js/src/data/displayName.ini.in 1970-01-01 00:00:00 +0000 | |||
311 | +++ qtc-templates/scope-js/src/data/displayName.ini.in 2015-10-23 07:30:32 +0000 | |||
312 | @@ -0,0 +1,9 @@ | |||
313 | 1 | [ScopeConfig] | ||
314 | 2 | ScopeRunner=./node_modules/unity-js-scopes/bin/unity-js-scopes-launcher %S %R | ||
315 | 3 | _DisplayName=%ProjectName:c% Scope | ||
316 | 4 | _Description=This is a %ProjectName:c% scope | ||
317 | 5 | Author = %ClickMaintainer% | ||
318 | 6 | Icon = icon.png | ||
319 | 7 | |||
320 | 8 | [Appearance] | ||
321 | 9 | PageHeader.Logo = logo.png | ||
322 | 0 | 10 | ||
323 | === added file 'qtc-templates/scope-js/src/data/icon.png' | |||
324 | 1 | Binary files qtc-templates/scope-js/src/data/icon.png 1970-01-01 00:00:00 +0000 and qtc-templates/scope-js/src/data/icon.png 2015-10-23 07:30:32 +0000 differ | 11 | Binary files qtc-templates/scope-js/src/data/icon.png 1970-01-01 00:00:00 +0000 and qtc-templates/scope-js/src/data/icon.png 2015-10-23 07:30:32 +0000 differ |
325 | === added file 'qtc-templates/scope-js/src/data/logo.png' | |||
326 | 2 | Binary files qtc-templates/scope-js/src/data/logo.png 1970-01-01 00:00:00 +0000 and qtc-templates/scope-js/src/data/logo.png 2015-10-23 07:30:32 +0000 differ | 12 | Binary files qtc-templates/scope-js/src/data/logo.png 1970-01-01 00:00:00 +0000 and qtc-templates/scope-js/src/data/logo.png 2015-10-23 07:30:32 +0000 differ |
327 | === added file 'qtc-templates/scope-js/src/displayName.js.in' | |||
328 | --- qtc-templates/scope-js/src/displayName.js.in 1970-01-01 00:00:00 +0000 | |||
329 | +++ qtc-templates/scope-js/src/displayName.js.in 2015-10-23 07:30:32 +0000 | |||
330 | @@ -0,0 +1,224 @@ | |||
331 | 1 | var scopes = require('unity-js-scopes') | ||
332 | 2 | @if "%ContentType%" != "empty" | ||
333 | 3 | var http = require('http'); | ||
334 | 4 | @if "%ContentType%" == "http+xml" | ||
335 | 5 | var XML = require('pixl-xml'); | ||
336 | 6 | @endif | ||
337 | 7 | |||
338 | 8 | var query_host = "api.openweathermap.org" | ||
339 | 9 | @if "%ContentType%" == "http+xml" | ||
340 | 10 | var current_weather_path = "/data/2.5/weather?units=metric&APPID=2b12bf09b4e0ab0c1aa5e32a9a3f0cdc&mode=xml&q=" | ||
341 | 11 | var forecast_weather_path = "/data/2.5/forecast/daily/?units=metric&cnt=7&APPID=2b12bf09b4e0ab0c1aa5e32a9a3f0cdc&mode=xml&q=" | ||
342 | 12 | @elsif "%ContentType%" == "http+json" | ||
343 | 13 | var current_weather_path = "/data/2.5/weather?units=metric&APPID=2b12bf09b4e0ab0c1aa5e32a9a3f0cdc&q=" | ||
344 | 14 | var forecast_weather_path = "/data/2.5/forecast/daily/?units=metric&cnt=7&APPID=2b12bf09b4e0ab0c1aa5e32a9a3f0cdc&q=" | ||
345 | 15 | @endif | ||
346 | 16 | |||
347 | 17 | var CURRENT_TEMPLATE = | ||
348 | 18 | { | ||
349 | 19 | "schema-version": 1, | ||
350 | 20 | "template": { | ||
351 | 21 | "category-layout": "grid", | ||
352 | 22 | "card-size": "medium" | ||
353 | 23 | }, | ||
354 | 24 | "components": { | ||
355 | 25 | "title": "title", | ||
356 | 26 | "art": { | ||
357 | 27 | "field": "art" | ||
358 | 28 | }, | ||
359 | 29 | "subtitle": "subtitle" | ||
360 | 30 | } | ||
361 | 31 | } | ||
362 | 32 | |||
363 | 33 | var FORECAST_TEMPLATE = | ||
364 | 34 | { | ||
365 | 35 | "schema-version": 1, | ||
366 | 36 | "template": { | ||
367 | 37 | "category-layout": "grid", | ||
368 | 38 | "card-layout": "horizontal", | ||
369 | 39 | "card-size": "small" | ||
370 | 40 | }, | ||
371 | 41 | "components": { | ||
372 | 42 | "title": "title", | ||
373 | 43 | "art" : { | ||
374 | 44 | "field": "art" | ||
375 | 45 | }, | ||
376 | 46 | "subtitle": "subtitle" | ||
377 | 47 | } | ||
378 | 48 | } | ||
379 | 49 | @endif | ||
380 | 50 | |||
381 | 51 | scopes.self.initialize( | ||
382 | 52 | {} | ||
383 | 53 | , | ||
384 | 54 | { | ||
385 | 55 | run: function() { | ||
386 | 56 | console.log('Running...') | ||
387 | 57 | }, | ||
388 | 58 | start: function(scope_id) { | ||
389 | 59 | console.log('Starting scope id: ' | ||
390 | 60 | + scope_id | ||
391 | 61 | + ', ' | ||
392 | 62 | + scopes.self.scope_config) | ||
393 | 63 | }, | ||
394 | 64 | search: function(canned_query, metadata) { | ||
395 | 65 | return new scopes.lib.search_query( | ||
396 | 66 | canned_query, | ||
397 | 67 | metadata, | ||
398 | 68 | // run | ||
399 | 69 | function(search_reply) { | ||
400 | 70 | @if "%ContentType%" != "empty" | ||
401 | 71 | var qs = canned_query.query_string(); | ||
402 | 72 | if (!qs) { | ||
403 | 73 | qs = "London,uk" | ||
404 | 74 | } | ||
405 | 75 | |||
406 | 76 | var current_weather_cb = function(response) { | ||
407 | 77 | var res = ''; | ||
408 | 78 | |||
409 | 79 | // Another chunk of data has been recieved, so append it to res | ||
410 | 80 | response.on('data', function(chunk) { | ||
411 | 81 | res += chunk; | ||
412 | 82 | }); | ||
413 | 83 | |||
414 | 84 | // The whole response has been recieved | ||
415 | 85 | response.on('end', function() { | ||
416 | 86 | @if "%ContentType%" == "http+xml" | ||
417 | 87 | r = XML.parse(res); | ||
418 | 88 | |||
419 | 89 | var category_renderer = new scopes.lib.category_renderer(JSON.stringify(CURRENT_TEMPLATE)); | ||
420 | 90 | var category = search_reply.register_category("current", r.city.name + ", " + r.city.country, "", category_renderer); | ||
421 | 91 | |||
422 | 92 | var categorised_result = new scopes.lib.categorised_result(category); | ||
423 | 93 | categorised_result.set_uri(r.city.id.toString()); | ||
424 | 94 | categorised_result.set_title(r.temperature.value.toString() + "°C"); | ||
425 | 95 | categorised_result.set_art("http://openweathermap.org/img/w/" + r.weather.icon + ".png"); | ||
426 | 96 | categorised_result.set("subtitle", r.weather.value); | ||
427 | 97 | categorised_result.set("description", "A description of the result"); | ||
428 | 98 | @elsif "%ContentType%" == "http+json" | ||
429 | 99 | r = JSON.parse(res); | ||
430 | 100 | |||
431 | 101 | var category_renderer = new scopes.lib.category_renderer(JSON.stringify(CURRENT_TEMPLATE)); | ||
432 | 102 | var category = search_reply.register_category("current", r.name + ", " + r.sys.country, "", category_renderer); | ||
433 | 103 | |||
434 | 104 | var categorised_result = new scopes.lib.categorised_result(category); | ||
435 | 105 | categorised_result.set_uri(r.id.toString()); | ||
436 | 106 | categorised_result.set_title(r.main.temp.toString() + "°C"); | ||
437 | 107 | categorised_result.set_art("http://openweathermap.org/img/w/" + r.weather[0].icon + ".png"); | ||
438 | 108 | categorised_result.set("subtitle", r.weather[0].description); | ||
439 | 109 | categorised_result.set("description", "A description of the result"); | ||
440 | 110 | @endif | ||
441 | 111 | |||
442 | 112 | search_reply.push(categorised_result); | ||
443 | 113 | |||
444 | 114 | // Now call back into the API for a 7 day forecast | ||
445 | 115 | http.request({host: query_host, path: forecast_weather_path + qs}, forecase_weather_cb).end(); | ||
446 | 116 | }); | ||
447 | 117 | } | ||
448 | 118 | |||
449 | 119 | var forecase_weather_cb = function(response) { | ||
450 | 120 | var res = ''; | ||
451 | 121 | |||
452 | 122 | // Another chunk of data has been recieved, so append it to res | ||
453 | 123 | response.on('data', function(chunk) { | ||
454 | 124 | res += chunk; | ||
455 | 125 | }); | ||
456 | 126 | |||
457 | 127 | // The whole response has been recieved | ||
458 | 128 | response.on('end', function() { | ||
459 | 129 | try { | ||
460 | 130 | @if "%ContentType%" == "http+xml" | ||
461 | 131 | r = XML.parse(res); | ||
462 | 132 | |||
463 | 133 | var category_renderer = new scopes.lib.category_renderer(JSON.stringify(FORECAST_TEMPLATE)); | ||
464 | 134 | var category = search_reply.register_category("forecast", "7 day forecast", "", category_renderer); | ||
465 | 135 | |||
466 | 136 | var weather_id = 1000000; | ||
467 | 137 | for (i = 0; i < r.forecast.time.length; i++) { | ||
468 | 138 | var categorised_result = new scopes.lib.categorised_result(category); | ||
469 | 139 | categorised_result.set_uri((weather_id++).toString()); | ||
470 | 140 | categorised_result.set_title(r.forecast.time[i].temperature.min.toString() + "°C to " | ||
471 | 141 | + r.forecast.time[i].temperature.max.toString() + "°C"); | ||
472 | 142 | categorised_result.set_art("http://openweathermap.org/img/w/" + r.forecast.time[i].symbol.var + ".png"); | ||
473 | 143 | categorised_result.set("subtitle", r.forecast.time[i].symbol.name); | ||
474 | 144 | categorised_result.set("description", "A description of the result"); | ||
475 | 145 | |||
476 | 146 | search_reply.push(categorised_result); | ||
477 | 147 | } | ||
478 | 148 | @elsif "%ContentType%" == "http+json" | ||
479 | 149 | r = JSON.parse(res); | ||
480 | 150 | |||
481 | 151 | var category_renderer = new scopes.lib.category_renderer(JSON.stringify(FORECAST_TEMPLATE)); | ||
482 | 152 | var category = search_reply.register_category("forecast", "7 day forecast", "", category_renderer); | ||
483 | 153 | |||
484 | 154 | for (i = 0; i < r.list.length; i++) { | ||
485 | 155 | var categorised_result = new scopes.lib.categorised_result(category); | ||
486 | 156 | categorised_result.set_uri(r.list[i].weather[0].id.toString()); | ||
487 | 157 | categorised_result.set_title(r.list[i].temp.min.toString() + "°C to " | ||
488 | 158 | + r.list[i].temp.max.toString() + "°C"); | ||
489 | 159 | categorised_result.set_art("http://openweathermap.org/img/w/" + r.list[i].weather[0].icon + ".png"); | ||
490 | 160 | categorised_result.set("subtitle", r.list[i].weather[0].description); | ||
491 | 161 | categorised_result.set("description", "A description of the result"); | ||
492 | 162 | |||
493 | 163 | search_reply.push(categorised_result); | ||
494 | 164 | } | ||
495 | 165 | @endif | ||
496 | 166 | |||
497 | 167 | // We are done, call finished() on our search_reply | ||
498 | 168 | search_reply.finished(); | ||
499 | 169 | } | ||
500 | 170 | catch(e) { | ||
501 | 171 | // Forecast not available | ||
502 | 172 | console.log("Forecast for '" + qs + "' is unavailable: " + e) | ||
503 | 173 | } | ||
504 | 174 | }); | ||
505 | 175 | } | ||
506 | 176 | |||
507 | 177 | http.request({host: query_host, path: current_weather_path + qs}, current_weather_cb).end(); | ||
508 | 178 | @endif | ||
509 | 179 | }, | ||
510 | 180 | // cancelled | ||
511 | 181 | function() { | ||
512 | 182 | }); | ||
513 | 183 | }, | ||
514 | 184 | preview: function(result, action_metadata) { | ||
515 | 185 | return new scopes.lib.preview_query( | ||
516 | 186 | result, | ||
517 | 187 | action_metadata, | ||
518 | 188 | // run | ||
519 | 189 | function(preview_reply) { | ||
520 | 190 | @if "%ContentType%" != "empty" | ||
521 | 191 | var layout1col = new scopes.lib.column_layout(1); | ||
522 | 192 | var layout2col = new scopes.lib.column_layout(2); | ||
523 | 193 | var layout3col = new scopes.lib.column_layout(3); | ||
524 | 194 | layout1col.add_column(["image", "header", "summary"]); | ||
525 | 195 | |||
526 | 196 | layout2col.add_column(["image"]); | ||
527 | 197 | layout2col.add_column(["header", "summary"]); | ||
528 | 198 | |||
529 | 199 | layout3col.add_column(["image"]); | ||
530 | 200 | layout3col.add_column(["header", "summary"]); | ||
531 | 201 | layout3col.add_column([]); | ||
532 | 202 | |||
533 | 203 | preview_reply.register_layout([layout1col, layout2col, layout3col]); | ||
534 | 204 | |||
535 | 205 | var header = new scopes.lib.preview_widget("header", "header"); | ||
536 | 206 | header.add_attribute_mapping("title", "title"); | ||
537 | 207 | header.add_attribute_mapping("subtitle", "subtitle"); | ||
538 | 208 | |||
539 | 209 | var image = new scopes.lib.preview_widget("image", "image"); | ||
540 | 210 | image.add_attribute_mapping("source", "art"); | ||
541 | 211 | |||
542 | 212 | var description = new scopes.lib.preview_widget("summary", "text"); | ||
543 | 213 | description.add_attribute_mapping("text", "description"); | ||
544 | 214 | |||
545 | 215 | preview_reply.push([image, header, description ]); | ||
546 | 216 | preview_reply.finished(); | ||
547 | 217 | @endif | ||
548 | 218 | }, | ||
549 | 219 | // cancelled | ||
550 | 220 | function() { | ||
551 | 221 | }); | ||
552 | 222 | } | ||
553 | 223 | } | ||
554 | 224 | ); | ||
555 | 0 | 225 | ||
556 | === added file 'qtc-templates/scope-js/wizard.xml' | |||
557 | --- qtc-templates/scope-js/wizard.xml 1970-01-01 00:00:00 +0000 | |||
558 | +++ qtc-templates/scope-js/wizard.xml 2015-10-23 07:30:32 +0000 | |||
559 | @@ -0,0 +1,96 @@ | |||
560 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
561 | 2 | <wizard version="1" kind="project" firstpage="10" id="C_UbuntuUnityJsScope" category="A.UbuntuProject" | ||
562 | 3 | platformIndependent="true" | ||
563 | 4 | class="ubuntu-project-cmake" | ||
564 | 5 | featuresRequired="" | ||
565 | 6 | > | ||
566 | 7 | <icon>../share/ubuntu.png</icon> | ||
567 | 8 | <description>A simple JavaScript based Unity Scope</description> | ||
568 | 9 | <displayname>Unity Scope (JavaScript)</displayname> | ||
569 | 10 | <displaycategory>Ubuntu</displaycategory> | ||
570 | 11 | <files> | ||
571 | 12 | <file source="po/CMakeLists.txt"/> | ||
572 | 13 | <file source="po/displayName.pot" target="po/%ProjectName:l%.pot"/> | ||
573 | 14 | <file source="po/POTFILES.in.in"/> | ||
574 | 15 | |||
575 | 16 | <file source="src/data/displayName.ini.in" target="src/data/%ClickHookName:l%.ini.in"/> | ||
576 | 17 | <file source="src/data/displayName-settings.ini.in" target="src/data/%ClickHookName:l%-settings.ini.in"/> | ||
577 | 18 | <file source="src/data/icon.png" binary="true"/> | ||
578 | 19 | <file source="src/data/logo.png" binary="true"/> | ||
579 | 20 | |||
580 | 21 | <file source="src/displayName.js.in" target="src/%ClickHookName:l%.js"/> | ||
581 | 22 | <file source="src/CMakeLists.txt"/> | ||
582 | 23 | |||
583 | 24 | <file source="CMakeLists.txt" openproject="true"/> | ||
584 | 25 | <file source="displayName.apparmor" target="%ClickHookName:l%.apparmor"/> | ||
585 | 26 | <file source="manifest.json.in" openeditor="true"/> | ||
586 | 27 | <file source=".bzrignore"/> | ||
587 | 28 | </files> | ||
588 | 29 | |||
589 | 30 | <!-- Create a 2nd wizard page with click package parameters --> | ||
590 | 31 | <fieldpagetitle>Click package parameters</fieldpagetitle> | ||
591 | 32 | <fields> | ||
592 | 33 | <field mandatory="true" name="ClickDomain"> | ||
593 | 34 | <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9-]+$' | ||
594 | 35 | defaulttext="" placeholdertext="Nickname"/> | ||
595 | 36 | <fielddescription>Nickname:</fielddescription> | ||
596 | 37 | </field> | ||
597 | 38 | <field mandatory="true" name="ClickMaintainer"> | ||
598 | 39 | <fieldcontrol class="QLineEdit" validator='^[^"]+$' | ||
599 | 40 | defaulttext="" placeholdertext="Maintainer"/> | ||
600 | 41 | <fielddescription>Maintainer:</fielddescription> | ||
601 | 42 | </field> | ||
602 | 43 | <field mandatory="true" name="ClickHookName"> | ||
603 | 44 | <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9.-]+$' | ||
604 | 45 | defaulttext="%ProjectName%" placeholdertext="scope hook name"/> | ||
605 | 46 | <fielddescription>Scope name:</fielddescription> | ||
606 | 47 | </field> | ||
607 | 48 | <field name="ClickFrameworkVersion"> | ||
608 | 49 | <fieldcontrol class="QComboBox" defaultindex="0"> | ||
609 | 50 | <comboentries> | ||
610 | 51 | <!-- 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 --> | ||
611 | 52 | <comboentry value="ubuntu-sdk-dummy-framework"> | ||
612 | 53 | <comboentrytext>Dummy Framework</comboentrytext> | ||
613 | 54 | </comboentry> | ||
614 | 55 | </comboentries> | ||
615 | 56 | </fieldcontrol> | ||
616 | 57 | <fielddescription>Framework:</fielddescription> | ||
617 | 58 | </field> | ||
618 | 59 | <field name="ConfinementType"> | ||
619 | 60 | <fieldcontrol class="QComboBox" defaultindex="0"> | ||
620 | 61 | <comboentries> | ||
621 | 62 | <comboentry value="ubuntu-scope-network"> | ||
622 | 63 | <comboentrytext>Scope with network access</comboentrytext> | ||
623 | 64 | </comboentry> | ||
624 | 65 | <!-- | ||
625 | 66 | <comboentry value="ubuntu-scope-local-content"> | ||
626 | 67 | <comboentrytext>Scope with local content</comboentrytext> | ||
627 | 68 | </comboentry> | ||
628 | 69 | --> | ||
629 | 70 | </comboentries> | ||
630 | 71 | </fieldcontrol> | ||
631 | 72 | <fielddescription>Confinement type:</fielddescription> | ||
632 | 73 | </field> | ||
633 | 74 | <field name="ContentType"> | ||
634 | 75 | <fieldcontrol class="QComboBox" defaultindex="0"> | ||
635 | 76 | <comboentries> | ||
636 | 77 | <comboentry value="http+json"> | ||
637 | 78 | <comboentrytext>JavaScript scope using HTTP and JSON</comboentrytext> | ||
638 | 79 | </comboentry> | ||
639 | 80 | <comboentry value="http+xml"> | ||
640 | 81 | <comboentrytext>JavaScript scope using HTTP and XML</comboentrytext> | ||
641 | 82 | </comboentry> | ||
642 | 83 | <comboentry value="empty"> | ||
643 | 84 | <comboentrytext>Empty scope</comboentrytext> | ||
644 | 85 | </comboentry> | ||
645 | 86 | </comboentries> | ||
646 | 87 | </fieldcontrol> | ||
647 | 88 | <fielddescription>Template type:</fielddescription> | ||
648 | 89 | </field> | ||
649 | 90 | </fields> | ||
650 | 91 | <validationrules> | ||
651 | 92 | <validationrule condition='/^(.*)\s+<(.*@.*)>$/.test("%ClickMaintainer%")'> | ||
652 | 93 | <message>Invalid format for maintainer (should be like "Joe Bloggs <joe.bloggs@isp.com>")</message> | ||
653 | 94 | </validationrule> | ||
654 | 95 | </validationrules> | ||
655 | 96 | </wizard> | ||
656 | 0 | 97 | ||
657 | === modified file 'src/tool/main.cc' | |||
658 | --- src/tool/main.cc 2015-10-16 07:06:35 +0000 | |||
659 | +++ src/tool/main.cc 2015-10-23 07:30:32 +0000 | |||
660 | @@ -30,42 +30,54 @@ | |||
661 | 30 | #include <boost/algorithm/string/predicate.hpp> | 30 | #include <boost/algorithm/string/predicate.hpp> |
662 | 31 | #include <boost/filesystem.hpp> | 31 | #include <boost/filesystem.hpp> |
663 | 32 | 32 | ||
665 | 33 | std::string get_arch() { | 33 | std::string exec_cmd(std::string const& cmd) { |
666 | 34 | std::string result = ""; | 34 | std::string result = ""; |
667 | 35 | 35 | ||
693 | 36 | { | 36 | FILE* pipe = popen(cmd.c_str(), "r"); |
694 | 37 | FILE* pipe = popen("dpkg-architecture -qDEB_HOST_ARCH", "r"); | 37 | if (!pipe) throw std::runtime_error("'" + cmd + "' command failed"); |
695 | 38 | if (!pipe) throw std::runtime_error("'dpkg-architecture' command failed"); | 38 | char buffer[128]; |
696 | 39 | char buffer[128]; | 39 | while (!feof(pipe)) { |
697 | 40 | while (!feof(pipe)) { | 40 | if (fgets(buffer, 128, pipe) != NULL) |
698 | 41 | if (fgets(buffer, 128, pipe) != NULL) | 41 | result += buffer; |
699 | 42 | result += buffer; | 42 | } |
700 | 43 | } | 43 | result.pop_back(); |
701 | 44 | result.pop_back(); | 44 | pclose(pipe); |
677 | 45 | pclose(pipe); | ||
678 | 46 | } | ||
679 | 47 | |||
680 | 48 | result += "-"; | ||
681 | 49 | |||
682 | 50 | { | ||
683 | 51 | FILE* pipe = popen("lsb_release -rs", "r"); | ||
684 | 52 | if (!pipe) throw std::runtime_error("'lsb_release' command failed"); | ||
685 | 53 | char buffer[128]; | ||
686 | 54 | while (!feof(pipe)) { | ||
687 | 55 | if (fgets(buffer, 128, pipe) != NULL) | ||
688 | 56 | result += buffer; | ||
689 | 57 | } | ||
690 | 58 | result.pop_back(); | ||
691 | 59 | pclose(pipe); | ||
692 | 60 | } | ||
702 | 61 | 45 | ||
703 | 62 | return result; | 46 | return result; |
704 | 63 | } | 47 | } |
705 | 64 | 48 | ||
706 | 49 | std::string get_arch() { | ||
707 | 50 | return exec_cmd("dpkg-architecture -qDEB_HOST_ARCH") + "-" + exec_cmd("lsb_release -rs"); | ||
708 | 51 | } | ||
709 | 52 | |||
710 | 53 | int setup_chroot(std::string const& fw) | ||
711 | 54 | { | ||
712 | 55 | if (exec_cmd("click chroot -a armhf -f ubuntu-sdk-" + fw + " maint echo 1") == "1") | ||
713 | 56 | { | ||
714 | 57 | std::string setup_script; | ||
715 | 58 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint apt-get install software-properties-common -y --force-yes \n"; | ||
716 | 59 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint add-apt-repository ppa:ubuntu-sdk-team/staging -y \n"; | ||
717 | 60 | |||
718 | 61 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint sh -c \"find /etc/apt/sources.list.d//*.list \ | ||
719 | 62 | -exec apt-get update -o Dir::Etc::sourcelist='{}' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' \\;\" \n"; | ||
720 | 63 | |||
721 | 64 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint apt-get install unity-js-scopes-bindings:armhf -y --force-yes \n"; | ||
722 | 65 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint apt-get install unity-js-scopes-launcher:armhf -y --force-yes \n"; | ||
723 | 66 | setup_script += "click chroot -a armhf -f ubuntu-sdk-" + fw + " maint apt-get install unity-js-scopes-tool -y --force-yes \n"; | ||
724 | 67 | |||
725 | 68 | std::cout << "Setting up " << fw << " chroot ..." << std::endl; | ||
726 | 69 | return system(setup_script.c_str()); | ||
727 | 70 | } | ||
728 | 71 | return EXIT_SUCCESS; | ||
729 | 72 | } | ||
730 | 73 | |||
731 | 65 | void usage() { | 74 | void usage() { |
732 | 66 | std::cout << "Usage:" | 75 | std::cout << "Usage:" |
733 | 67 | << std::endl | 76 | << std::endl |
734 | 68 | << executable_name() | 77 | << executable_name() |
735 | 78 | << " setup " | ||
736 | 79 | << std::endl | ||
737 | 80 | << executable_name() | ||
738 | 69 | << " [re]install " | 81 | << " [re]install " |
739 | 70 | << "<path/to/node_modules> " | 82 | << "<path/to/node_modules> " |
740 | 71 | << "[<npm_module>]" | 83 | << "[<npm_module>]" |
741 | @@ -333,6 +345,53 @@ | |||
742 | 333 | 345 | ||
743 | 334 | return result; | 346 | return result; |
744 | 335 | } | 347 | } |
745 | 348 | else if (std::string(argv[1]) == "setup") { | ||
746 | 349 | if (argc > 2) { | ||
747 | 350 | usage(); | ||
748 | 351 | return EXIT_FAILURE; | ||
749 | 352 | } | ||
750 | 353 | |||
751 | 354 | std::cout << "Setup started." << std::endl; | ||
752 | 355 | |||
753 | 356 | // Set up 15.04 chroot | ||
754 | 357 | try | ||
755 | 358 | { | ||
756 | 359 | if (setup_chroot("15.04") == EXIT_FAILURE) | ||
757 | 360 | { | ||
758 | 361 | std::cout << "Setup failed." << std::endl; | ||
759 | 362 | return EXIT_FAILURE; | ||
760 | 363 | } | ||
761 | 364 | } | ||
762 | 365 | catch (std::exception const& e) | ||
763 | 366 | { | ||
764 | 367 | std::cout << "Failed to detect 15.04 chroot: " << e.what() << " ..." << std::endl; | ||
765 | 368 | } | ||
766 | 369 | |||
767 | 370 | // Set up 15.10 chroot | ||
768 | 371 | try | ||
769 | 372 | { | ||
770 | 373 | if (setup_chroot("15.10") == EXIT_FAILURE) | ||
771 | 374 | { | ||
772 | 375 | std::cout << "Setup failed." << std::endl; | ||
773 | 376 | return EXIT_FAILURE; | ||
774 | 377 | } | ||
775 | 378 | } | ||
776 | 379 | catch (std::exception const& e) | ||
777 | 380 | { | ||
778 | 381 | std::cout << "Failed to detect 15.10 chroot: " << e.what() << " ..." << std::endl; | ||
779 | 382 | } | ||
780 | 383 | |||
781 | 384 | // Remount chroots | ||
782 | 385 | std::cout << "Remounting chroots ..." << std::endl; | ||
783 | 386 | if (system("click-chroot-agent --reload") == EXIT_FAILURE) | ||
784 | 387 | { | ||
785 | 388 | std::cout << "Setup failed." << std::endl; | ||
786 | 389 | return EXIT_FAILURE; | ||
787 | 390 | } | ||
788 | 391 | |||
789 | 392 | std::cout << "Setup complete." << std::endl; | ||
790 | 393 | return EXIT_SUCCESS; | ||
791 | 394 | } | ||
792 | 336 | else { | 395 | else { |
793 | 337 | return node::Start(argc, argv); | 396 | return node::Start(argc, argv); |
794 | 338 | } | 397 | } |
FAILED: Continuous integration, rev:93 jenkins. qa.ubuntu. com/job/ unity-js- scopes- ci/28/ jenkins. qa.ubuntu. com/job/ unity-js- scopes- wily-amd64- ci/28/console jenkins. qa.ubuntu. com/job/ unity-js- scopes- wily-armhf- ci/28/console jenkins. qa.ubuntu. com/job/ unity-js- scopes- wily-i386- ci/28/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- js-scopes- ci/28/rebuild
http://