在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mozilla-b2g/firefoxos-loop-client开源软件地址:https://github.com/mozilla-b2g/firefoxos-loop-client开源编程语言:JavaScript 88.4%开源软件介绍:Firefox OS Loop ClientFirefox OS client for the Loop service Want to contribute?GruntWe rely on Grunt for performing repetetive task such as unit testing, linting, building and pushing the app onto the device. If this is the first time you clone the app you must install all the Grunt stuff. Grunt and Grunt plugins are installed and managed via npm, the Node.js package manager (so we would need to install Node.js as well). If you already have Node.js and Grunt you just need to install the Grunt plugins we use. Please proceed as follow:
At the moment we have a few Grunt tasks. Let's see them. build
This the one a regular dev, user, tester o QA guy should use. It builds the app and push it onto the device (no WebIDE usage is involved). release
This is the task that builds the app for releasing it. test
This is the task we have for unit testing. It launches tests in shell with PhantomJS. To add a new test, you only have to write the test (and add it somewhere under the test/ directory, preferably on test/unit) and then add a new .html file to test/test_scripts. That file should have the <script> tags to load your unit test and any other script file you need (like the one you're actually testing). More notes about testing. We're using SlimerJS and grunt-mocha-slimerjs for testing. The Spec reporter (as set by default) do not log errors or stack traces on failures. So if you want to see the errors (and believe me, you will) then you need to specify the JSON reporter. The easiest way to do this is with:
If you want to run only the test contained on test_name.js, execute:
e.g. to run only the test in test_join_room.js:
Grunt optionsThere are many flags that allow you to configure different parameters of the generated Loop Applications. loopVersionReplaces the loop version in both manifest.webapp and config.js with the string passed as parameter, e.g.
configures loop version to 2.2. Please do not use this parameter unless you really need as otherwise it might interfere with Loop Production metrics. loopServerConfigures the Loop server to be used. You can use one of the pre-defined servers, where possible values are production|stage|development. Alternatively you can pass a full URL (including the protocol e.g. https://myloopserver.com). This changes the server in the config.js and the origin in the manifest.webapp file. E.g. for a predefined server.
E.g. for a custom server.
Please note that although the use of encryption is encouraged, the tool allows using servers using plain http. If an http server is used, the allowUnsecure parameter will be set to true in the application config.js. enforceDevicesWhen setting this to true, only compatible/tested devices (Fire E) are allowed to use the app. When setting this to false, any device is allowed. E.g.
Using this option modifies the compatiblity.json file as required. debugWhen setting this to true, debug mode is enabled so logs are shown in the logcat. This modifies the parameter in config.js. E.g.
metricsConfigures if metrics are reported and to which server. Possible values are production|stage|disabled.
Configures if performance metrics for set-up time are taken. Possible values are persistent|enabled|disabled.
Additionally, a couple of extra tasks have been added to make easier the generation of builds for development or publication purposes: releaseProduction and buildProduction
Releases a build or creates it and pushes it to a device with the following options:
Releases a build or creates it and pushes it to a device with the following options:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论