Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1232] --deploy-type ignored on android builds for emulator and device

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-02-17T15:17:09.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.6.0
ComponentsTooling
LabelsTCSupport, alloy-configuration, android, cli
ReporterPablo Guevara
AssigneeFeon Sua Xin Miao
Created2014-12-22T21:51:49.000+0000
Updated2015-03-25T19:42:49.000+0000

Description

Problem Description

The argument --deploy-type or -D is ignored if the target is android, always generating 'development' for emulator and 'test' for device, even if specified the other way. iOS works fine. I didn't test all the others platforms.

Steps to reproduce

Since we use these settings to trigger our testing scripts, figured I'd give it a test. Ti.App.deployType seems to work fine here. But your settings from the config.json file do not. added the following to my alloy.js to test faster:
console.log('Ti.App.deployType: ', Ti.App.deployType);
console.log('Alloy.CFG: ', Alloy.CFG);
Results: Genymotion Google Nexus 5 - 5.0.0 - API 21 - 1080x1920 (5.0.0)
[INFO]  Ti.App.deployType:  test
[INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
[INFO]  Ti.App.deployType:  development
[INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
Genymotion Samsung Galaxy S5 - 4.4.4 - API 19 - 1080x1920 (4.4.4)
[INFO]  Ti.App.deployType:  test
[INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
[INFO]  Ti.App.deployType:  development
[INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
Device Samsung S4
12-22 20:32:56.028: I/TiAPI(17077):  Ti.App.deployType:  development
12-22 20:32:56.028: I/TiAPI(17077):  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
12-22 20:34:35.465: I/TiAPI(18183):  Ti.App.deployType:  test
12-22 20:34:35.475: I/TiAPI(18183):  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}

Steps to reproduce

I used these commands for testing:
ti build -p android -D development --device-id ?
ti build -p android -D test --device-id ?
ti build -p android -D development -T device
ti build -p android -D test -T device

Extra info

Seems like CFG.js doesn't get updated under resources once you switch the deployType flag. Deleting the content of Resources (aka forcing regeneration of CFG.js) will go and use the right config.

Attachments

FileDateSize
Test.zip2014-12-22T21:51:49.000+0000331498

Comments

  1. Stephen Feather 2014-12-23

    Since we use these settings to trigger our testing scripts, figured I'd give it a test. Ti.App.deployType seems to work fine here. But your settings from the config.json file do not. added the following to my alloy.js to test faster:
       console.log('Ti.App.deployType: ', Ti.App.deployType);
       console.log('Alloy.CFG: ', Alloy.CFG);
       
    Results: Genymotion Google Nexus 5 - 5.0.0 - API 21 - 1080x1920 (5.0.0)
       [INFO]  Ti.App.deployType:  test
       [INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
       [INFO]  Ti.App.deployType:  development
       [INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
    Genymotion Samsung Galaxy S5 - 4.4.4 - API 19 - 1080x1920 (4.4.4)
       [INFO]  Ti.App.deployType:  test
       [INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
       [INFO]  Ti.App.deployType:  development
       [INFO]  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
    Device Samsung S4
       12-22 20:32:56.028: I/TiAPI(17077):  Ti.App.deployType:  development
       12-22 20:32:56.028: I/TiAPI(17077):  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
       12-22 20:34:35.465: I/TiAPI(18183):  Ti.App.deployType:  test
       12-22 20:34:35.475: I/TiAPI(18183):  Alloy.CFG:  {"dependencies":{},"TEST_STRING":"TEST ENV"}
       
  2. Cesar Cavazos 2015-01-29

    My 2 cents here: Seems like CFG.js doesn't get updated under resources once you switch the deployType flag. Deleting the content of Resources (aka forcing regeneration of CFG.js) will go and use the right config.
  3. Mauro Parra-Miranda 2015-01-29

    [~pablog178] is the original reporter for this ticket.
  4. Tim Poulsen 2015-02-04

    I think this is solved by the change in ALOY-1206. [~mpmiranda] could you test and confirm with the customer that this would resolve their issue?
  5. Feon Sua Xin Miao 2015-02-16

    PR: https://github.com/appcelerator/alloy/pull/665 Functional Test: Follow the steps to reproduce stated above, and confirm that Resources/alloy/CFG.js has the correct TEST_STRING value for each android build.
       // device
       ti build -p android -D development -T device --device-id xxx // should be DEV ENV
       ti build -p android -D test -T device --device-id xxx // should be TEST ENV
       
       // emulator
       ti build -p android -D development  // should be DEV ENV
       ti build -p android -D test // should be TEST ENV
       
  6. Tim Poulsen 2015-02-17

    FR & CR pass, merged to master, cherry-picked to 1_6_X
  7. Eric Wieber 2015-03-25

    Verified fixed using: Titanium SDK 4.0.0.v20150323131014 Studio 4.0.0.201503231407 Appc NPM: 0.3.34 Appc CLI 0.2.187 Alloy 1.6.0-alpha The correct TEST_STRING is printed when using -D development and -D test.

JSON Source