@@ -18,7 +18,7 @@ exports.init = function (logger, config, cli, appc) {
1818 spawn = require ( 'child_process' ) . spawn ,
1919 parallel = appc . async . parallel ;
2020
21- function run ( deviceFamily , deployType , finished ) {
21+ function run ( deviceFamily , deployType , target , finished ) {
2222 var appDir = path . join ( cli . argv [ 'project-dir' ] , 'app' ) ;
2323 if ( ! afs . exists ( appDir ) ) {
2424 logger . info ( __ ( 'Project not an Alloy app, continuing' ) ) ;
@@ -41,7 +41,8 @@ exports.init = function (logger, config, cli, appc) {
4141 version : '0' ,
4242 simtype : 'none' ,
4343 devicefamily : / (?: i p h o n e | i o s ) / . test ( cli . argv . platform ) ? deviceFamily : 'none' ,
44- deploytype : deployType || cli . argv [ 'deploy-type' ] || 'development'
44+ deploytype : deployType || cli . argv [ 'deploy-type' ] || 'development' ,
45+ target : target
4546 } ;
4647
4748 config = Object . keys ( config ) . map ( function ( c ) {
@@ -154,8 +155,10 @@ exports.init = function (logger, config, cli, appc) {
154155 cli . addHook ( 'build.pre.compile' , function ( build , finished ) {
155156 // TODO: Remove this workaround when the CLI reports the right deploy type for android
156157 var deployType = build . deployType ;
158+ var target = build . target ;
159+
157160 if ( cli . argv . platform === 'android' ) {
158- switch ( cli . argv . target ) {
161+ switch ( target ) {
159162 case 'dist-playstore' :
160163 deployType = 'production' ;
161164 break ;
@@ -168,10 +171,10 @@ exports.init = function (logger, config, cli, appc) {
168171 break ;
169172 }
170173 }
171- run ( build . deviceFamily , deployType , finished ) ;
174+ run ( build . deviceFamily , deployType , target , finished ) ;
172175 } ) ;
173176
174177 cli . addHook ( 'codeprocessor.pre.run' , function ( build , finished ) {
175- run ( 'none' , 'development' , finished ) ;
178+ run ( 'none' , 'development' , undefined , finished ) ;
176179 } ) ;
177180} ;
0 commit comments