[TIMOB-10757] CLI: Module Build
| GitHub Issue | n/a |
|---|---|
| Type | Epic |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-08-24T19:20:16.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 4.0.0 |
| Components | CLI |
| Labels | ft, notable, planning-3.2.0 |
| Reporter | Chris Barber |
| Assignee | Feon Sua Xin Miao |
| Created | 2012-09-04T14:48:48.000+0000 |
| Updated | 2017-03-22T17:05:17.000+0000 |
Description
The task involves a few things before implementing the platform specific logic.
In the
Add
cli/commands/build.js
In the project-dir callback function, determine if the project is an app or a module. If the project has a tiapp.xml, then it is an app. If the project has a timodule.xml, it is a module. When a module project is found, the timodule.xml should be parsed and saved into the cli.timodule variable. If the the project is neither a app or module, error and exit. You should set the cli.argv.type to the appropriate value. Remember that you need to scan up the directory tree since the project-dir may be a subdirectory.
In the validate() function, if it is an app, then do the ti.validateCorrectSDK() and ti.validatePlatform() stuff. If it is a module, then validate module stuff.
In the run() function, I think you only need to call ti.resolvePlatform() for apps. The buildModule should be path.join(__dirname, '..', '..', platform, 'cli', 'commands', '_build.js') for apps and path.join(__dirname, '..', '..', platform, 'cli', 'commands', '_build_module.js') for modules. If _build_module.js file does not exist, error and exit.
node_modules/titanium-sdk/lib/builder.js
Add this.timodule = cli.timodule; to the run() function after the this.tiapp line.
iOS and Android are done. MobileWeb is on hold for the moment.
Closing ticket as fixed.