-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
72 lines (57 loc) · 1.45 KB
/
Gruntfile.js
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
/* eslint-disable */
function getHockeyappConfig(grunt) {
const token = grunt.option('token') || '';
const file = grunt.option('file') || '';
if (!token || !file) {
return {};
}
const notes = grunt.option('notes') || '';
const releaseType = grunt.option('releaseType') || '';
const isIOS = file.lastIndexOf('.ipa') >= 0;
const isAndroid = file.lastIndexOf('.apk') >= 0;
const platform = isIOS ? 'ios' : (isAndroid ? 'android' : null);
const notify = !!grunt.option('notify') ? 'all' : '';
// Environment variable from JK
const buildServerUrl = process.env.BUILD_URL;
const commitSha = process.env.GIT_COMMIT;
const config = {
options: {
downloadable: false,
notes: notes,
notesType: 'markdown',
notify: notify,
releaseType: releaseType,
resource: 'upload',
token: token
}
};
if (platform) {
config[platform] = {
file: file
};
}
if (buildServerUrl) {
config.options.commitSha = commitSha;
}
return config;
}
function loadMobiTaskRunnerConfig(grunt, filePath) {
var config;
try {
config = grunt.file.readJSON(filePath);
} catch (e) {
config = {};
}
return config;
}
function getMobiTaskRunnerCapabilities(config) {
const capabilities = [];
if (config.devices) {
const devices = config.devices;
for (var i = 0; i < devices.length; i++) {
}
}
}
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
}