forked from play-co/native-ios
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
66 lines (57 loc) · 2.12 KB
/
index.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
/* @license
* This file is part of the Game Closure SDK.
*
* The Game Closure SDK is free software: you can redistribute it and/or modify
* it under the terms of the Mozilla Public License v. 2.0 as published by Mozilla.
* The Game Closure SDK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Mozilla Public License v. 2.0 for more details.
* You should have received a copy of the Mozilla Public License v. 2.0
* along with the Game Closure SDK. If not, see <http://mozilla.org/MPL/2.0/>.
*/
var path = require("path");
var ff = require("ff");
var clc = require("cli-color");
exports.init = function(common) {
console.log("Running install.sh");
common.child("sh", ["install.sh"], {
cwd: __dirname
}, function () {
console.log("Install complete");
});
exports.load(common);
}
exports.load = function(common) {
common.config.set("ios:root", path.resolve(__dirname))
require(common.paths.root('src', 'testapp')).registerTarget("native-ios", __dirname);
return {
commands: [{
name: 'check-profile',
shortDescription: 'returns information about a provisioning profile',
help: 'accepts either a provisioning profile UUID or filename. If a'
+ ' filename is provided and the profile is not already installed'
+ ' on this system, this will install the profile. Returns a JSON'
+ ' object containing where the profile is, if it\'s installed,'
+ ' and the profile\'s short name.',
handler: function (args, cb) {
require('./xcode/profiles').getProvisioningProfileInfo(args._[0], function (err, info) {
if (err) {
console.error(err);
} else {
console.log(JSON.stringify(info, null, ' '));
}
});
}
}]
};
}
exports.testapp = function(common, opts, next) {
var f = ff(this, function () {
common.child('open', [path.join(__dirname, './tealeaf/TeaLeafIOS.xcodeproj')], {}, f.wait());
}, function() {
require(common.paths.root('src', 'serve')).cli();
}).error(function(err) {
console.log("Error during testapp:", err, err.stack);
}).cb(next);
}