123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- /*++
- Copyright (c) 2017 Minoca Corp.
- This file is licensed under the terms of the GNU General Public License
- version 3. Alternative licensing terms are available. Contact
- info@minocacorp.com for details. See the LICENSE file at the root of this
- project for complete licensing information.
- Module Name:
- mkbundle.ck
- Abstract:
- This module is a build script that can created a single executable version
- of the santa application.
- Author:
- Evan Green 24-May-2017
- Environment:
- Chalk
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- from app import argv;
- from bundle import create;
- import santa;
- from santa.config import loadConfig;
- from santa.modules import enumerateCommands, enumerateContainmentTypes,
- enumeratePresentationTypes, initModuleSupport;
- import io;
- import os;
- //
- // --------------------------------------------------------------------- Macros
- //
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // ----------------------------------------------- Internal Function Prototypes
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // ------------------------------------------------------------------ Functions
- //
- function
- main (
- )
- /*++
- Routine Description:
- This routine implements the entry point into the create bundle application.
- Arguments:
- None.
- Return Value:
- 0 always, or an exception is raised.
- --*/
- {
- var ignoredModules = [null, "__main", "app", "bundle"];
- var modules;
- var command = "from santa import main;"
- "from os import exit;"
- "exit(main());";
- if (argv.length() != 2) {
- Core.raise(ValueError("Usage: %s output_file" % [argv[0]]));
- }
- //
- // Perform enough app-wide init to do the enumerations below.
- //
- loadConfig(null, {});
- initModuleSupport();
- //
- // Load up all the various modules to pull in the full module graph.
- //
- enumerateCommands();
- enumerateContainmentTypes();
- enumeratePresentationTypes();
- modules = [];
- for (key in Core.modules()) {
- if (!ignoredModules.contains(key)) {
- modules.append(Core.modules()[key]);
- }
- }
- create(argv[1], modules, command);
- return 0;
- }
- main();
- //
- // --------------------------------------------------------- Internal Functions
- //
|