forked from blackberry/cordova-blackberry-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jakefile
82 lines (71 loc) · 3.31 KB
/
Jakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright 2011 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var utils = require('./scripts/utils'),
jWorkflow = require('jWorkflow'),
childProcess = require('child_process'),
DESC_NEW_LINE = "\n\t\t\t # ";
desc("runs clean, hint, build and test");
task('default', ['clean', 'hint', 'build', 'test'], function () {});
desc("clean");
task('clean', [], function () {
var cmd = 'make clean',
cleanTask = jWorkflow.order();
cleanTask.andThen(utils.execCommandWithJWorkflow(cmd, {}, true));
cleanTask.start(function (error) {
if (error) {
utils.displayOutput("Clean FAILED");
process.exit(1);
} else {
utils.displayOutput("Clean SUCCESS");
}
complete();
});
}, true);
desc("hint");
task('hint', [], function () {
require('./scripts/lint')(Array.prototype.slice.call(arguments), complete);
}, true);
desc("build");
task('build', [], function () {
var build = jWorkflow.order(function (prev, baton) {
baton.take();
require('./scripts/build')(function () {
baton.pass();
});
}).start(function () {
complete();
});
}, true);
desc("run unit tests in node - jake test [pluginId]");
task('test', [], function () {
require('./scripts/test')(null, process.argv.length >= 4 ? process.argv[3] : null);
}, true);
desc("deploy and run test app on device/simulator" + DESC_NEW_LINE +
"Usage: jake deploy-test-app['remote/branch','targetname','ip','targettype','password']" + DESC_NEW_LINE +
"Example: jake deploy-test-app[origin/master,Z10,169.254.0.1,device,password]");
task('deploy-test-app', ['build'], require('./scripts/test-app'), true);
desc("deploy and run test suite on device/simulator" + DESC_NEW_LINE +
"Usage: jake deploy-test-suite['remote/branch','targetname','ip','targettype','password']" + DESC_NEW_LINE +
"Example: jake deploy-test-suite[origin/master,Z10,169.254.0.1,device,password]");
task('deploy-test-suite', [], require('./scripts/test-suite'));
desc("deploy and run cordova-mobile-spec on device/simulator" + DESC_NEW_LINE +
"Usage: jake deploy-mobile-spec['remote/branch','targetname','ip','targettype','password','remote/branch']" + DESC_NEW_LINE +
"Example: jake deploy-mobile-spec[origin/master,z10,169.254.0.1,device,abc123,origin/master]");
task('deploy-mobile-spec', [], require('./scripts/mobile-spec'));
desc("run mobile spec auto test on device" + DESC_NEW_LINE +
"Usage: jake autorun-mobile-spec['remote/branch','targetname','ip','targettype','password','remote/branch','couchdbIP']" + DESC_NEW_LINE +
"Example: jake autorun-mobile-spec[origin/master,z10,169.254.0.1,device,abc123,origin/master,169.254.0.2]");
task('autorun-mobile-spec', [], require('./scripts/autorun-mobile-spec'));