(options)
| 951 | }); |
| 952 | |
| 953 | var buildCommand = function (options) { |
| 954 | Console.setVerbose(!!options.verbose); |
| 955 | if (options.headless) { |
| 956 | // There's no point in spinning the spinner when we're running |
| 957 | // automated builds. |
| 958 | Console.setHeadless(true); |
| 959 | } |
| 960 | // XXX output, to stderr, the name of the file written to (for human |
| 961 | // comfort, especially since we might change the name) |
| 962 | |
| 963 | // XXX name the root directory in the bundle based on the basename |
| 964 | // of the file, not a constant 'bundle' (a bit obnoxious for |
| 965 | // machines, but worth it for humans) |
| 966 | |
| 967 | // Error handling for options.architecture. See archinfo for more |
| 968 | // information on what the architectures are, what they mean, et cetera. |
| 969 | if (options.architecture && |
| 970 | !_.has(archinfo.VALID_ARCHITECTURES, options.architecture)) { |
| 971 | showInvalidArchMsg(options.architecture); |
| 972 | return 1; |
| 973 | } |
| 974 | var bundleArch = options.architecture || archinfo.host(); |
| 975 | |
| 976 | var projectContext = new projectContextModule.ProjectContext({ |
| 977 | projectDir: options.appDir, |
| 978 | serverArchitectures: _.uniq([bundleArch, archinfo.host()]), |
| 979 | allowIncompatibleUpdate: options['allow-incompatible-update'] |
| 980 | }); |
| 981 | |
| 982 | main.captureAndExit("=> Errors while initializing project:", function () { |
| 983 | // TODO Fix the nested Profile.run warning here, without interfering |
| 984 | // with METEOR_PROFILE output for other commands, like `meteor run`. |
| 985 | projectContext.prepareProjectForBuild(); |
| 986 | }); |
| 987 | projectContext.packageMapDelta.displayOnConsole(); |
| 988 | |
| 989 | // _bundleOnly implies serverOnly |
| 990 | const serverOnly = options._bundleOnly || !!options['server-only']; |
| 991 | |
| 992 | // options['mobile-settings'] is used to set the initial value of |
| 993 | // `Meteor.settings` on mobile apps. Pass it on to options.settings, |
| 994 | // which is used in this command. |
| 995 | if (options['mobile-settings']) { |
| 996 | options.settings = options['mobile-settings']; |
| 997 | } |
| 998 | |
| 999 | const appName = files.pathBasename(options.appDir); |
| 1000 | |
| 1001 | let cordovaPlatforms; |
| 1002 | let parsedMobileServerUrl; |
| 1003 | let parsedCordovaServerPort; |
| 1004 | if (!serverOnly) { |
| 1005 | cordovaPlatforms = projectContext.platformList.getCordovaPlatforms(); |
| 1006 | |
| 1007 | if (process.platform !== 'darwin' && _.contains(cordovaPlatforms, 'ios')) { |
| 1008 | cordovaPlatforms = _.without(cordovaPlatforms, 'ios'); |
| 1009 | Console.warn("Currently, it is only possible to build iOS apps \ |
| 1010 | on an OS X system."); |
no test coverage detected
searching dependent graphs…