[ALOY-1232] --deploy-type ignored on android builds for emulator and device
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-02-17T15:17:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.6.0 |
Components | Tooling |
Labels | TCSupport, alloy-configuration, android, cli |
Reporter | Pablo Guevara |
Assignee | Feon Sua Xin Miao |
Created | 2014-12-22T21:51:49.000+0000 |
Updated | 2015-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
File | Date | Size |
Test.zip | 2014-12-22T21:51:49.000+0000 | 331498 |
Comments
- 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"}
- 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.
- Mauro Parra-Miranda 2015-01-29
[~pablog178] is the original reporter for this ticket.
- 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?
- 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
- Tim Poulsen 2015-02-17
FR & CR pass, merged to master, cherry-picked to 1_6_X
- 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