Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20519] '--project dir .' causes module build to fail

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-03-07T20:50:38.000+0000
Affected Version/sRelease 5.2.1
Fix Version/sRelease 5.2.1
ComponentsTooling
Labelsqe-5.2.1
ReporterEric Wieber
AssigneeChris Barber
Created2016-03-04T22:10:57.000+0000
Updated2016-03-07T22:00:16.000+0000

Description

When specifying --project-dir . when trying to build a module, the build will fail. *Steps to reproduce issue* 1. Try to build a module with ti build -p ios --project-dir . -b *Actual Results* The build fails with: [ERROR] Unable to find "undefined" module *Expected Results* The build succeeds

Comments

  1. Chris Barber 2016-03-04

    There are two things that need to be done.

    Change the order of the \-\-platform and \-\-project\-dir options in https://github.com/appcelerator/titanium_mobile/blob/master/cli/commands/build.js. Currently \-\-project\-dir is validated first, then \-\-platform. If we swap this, then cli.argv.platform will be set when the \-\-project\-dir validation runs.

    Normalize the platform name in the module's manifest which is done here: https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/titanium-sdk/lib/titanium.js#L359. This is done like this:

       if (cli.argv.platform !== exports.resolvePlatform(manifest.platform)) {
       
  2. Chris Barber 2016-03-07

    Master PR: https://github.com/appcelerator/titanium_mobile/pull/7806 5_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/7807 5_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/7808
  3. Feon Sua Xin Miao 2016-03-07

    PR merged.
  4. Eric Wieber 2016-03-07

    Verified fixed, using: MacOS 10.11.3 (15D21) Studio 4.5.0.201602170821 Ti SDK 5.2.1.v20160307134704 Appc NPM 4.2.4.2 Appc CLI 5.2.1-11 Alloy 1.7.35 Xcode 7.2 (7C68) Able to successfully build modules using --project-dir . and --platform in the command, in any order.

JSON Source