@@ -4,9 +4,7 @@ import path = require("path");
44import shell = require( "shelljs" ) ;
55import util = require( "util" ) ;
66import Future = require( "fibers/future" ) ;
7- import options = require( "../common/options" ) ;
87import constants = require( "../constants" ) ;
9- import hostInfo = require( "../common/host-info" ) ;
108import helpers = require( "../common/helpers" ) ;
119import fs = require( "fs" ) ;
1210import os = require( "os" ) ;
@@ -26,7 +24,9 @@ class AndroidProjectService implements IPlatformProjectService {
2624 private $fs : IFileSystem ,
2725 private $logger : ILogger ,
2826 private $projectData : IProjectData ,
29- private $propertiesParser : IPropertiesParser ) {
27+ private $propertiesParser : IPropertiesParser ,
28+ private $options : IOptions ,
29+ private $hostInfo : IHostInfo ) {
3030 }
3131
3232 private _platformData : IPlatformData = null ;
@@ -68,7 +68,7 @@ class AndroidProjectService implements IPlatformProjectService {
6868 this . $fs . ensureDirectoryExists ( projectRoot ) . wait ( ) ;
6969 var newTarget = this . getLatestValidAndroidTarget ( frameworkDir ) . wait ( ) ;
7070 var versionNumber = _ . last ( newTarget . split ( "-" ) ) ;
71- if ( options . symlink ) {
71+ if ( this . $ options. symlink ) {
7272 this . copyResValues ( projectRoot , frameworkDir , versionNumber ) . wait ( ) ;
7373 this . copy ( projectRoot , frameworkDir , ".project AndroidManifest.xml project.properties custom_rules.xml" , "-f" ) . wait ( ) ;
7474
@@ -146,7 +146,7 @@ class AndroidProjectService implements IPlatformProjectService {
146146
147147 public buildProject ( projectRoot : string ) : IFuture < void > {
148148 return ( ( ) => {
149- var buildConfiguration = options . release ? "release" : "debug" ;
149+ var buildConfiguration = this . $ options. release ? "release" : "debug" ;
150150 var args = this . getAntArgs ( buildConfiguration , projectRoot ) ;
151151 this . spawn ( 'ant' , args ) . wait ( ) ;
152152 } ) . future < void > ( ) ( ) ;
@@ -256,7 +256,7 @@ class AndroidProjectService implements IPlatformProjectService {
256256 }
257257
258258 private spawn ( command : string , args : string [ ] ) : IFuture < void > {
259- if ( hostInfo . isWindows ( ) ) {
259+ if ( this . $ hostInfo. isWindows ) {
260260 args . unshift ( '/s' , '/c' , command ) ;
261261 command = process . env . COMSPEC || 'cmd.exe' ;
262262 }
@@ -267,20 +267,20 @@ class AndroidProjectService implements IPlatformProjectService {
267267 private getAntArgs ( configuration : string , projectRoot : string ) : string [ ] {
268268 var args = [ configuration , "-f" , path . join ( projectRoot , "build.xml" ) ] ;
269269 if ( configuration === "release" ) {
270- if ( options . keyStorePath ) {
271- args = args . concat ( [ "-Dkey.store" , options . keyStorePath ] ) ;
270+ if ( this . $ options. keyStorePath ) {
271+ args = args . concat ( [ "-Dkey.store" , this . $ options. keyStorePath ] ) ;
272272 }
273273
274- if ( options . keyStorePassword ) {
275- args = args . concat ( [ "-Dkey.store.password" , options . keyStorePassword ] ) ;
274+ if ( this . $ options. keyStorePassword ) {
275+ args = args . concat ( [ "-Dkey.store.password" , this . $ options. keyStorePassword ] ) ;
276276 }
277277
278- if ( options . keyStoreAlias ) {
279- args = args . concat ( [ "-Dkey.alias" , options . keyStoreAlias ] ) ;
278+ if ( this . $ options. keyStoreAlias ) {
279+ args = args . concat ( [ "-Dkey.alias" , this . $ options. keyStoreAlias ] ) ;
280280 }
281281
282- if ( options . keyStoreAliasPassword ) {
283- args = args . concat ( [ "-Dkey.alias.password" , options . keyStoreAliasPassword ] )
282+ if ( this . $ options. keyStoreAliasPassword ) {
283+ args = args . concat ( [ "-Dkey.alias.password" , this . $ options. keyStoreAliasPassword ] )
284284 }
285285 }
286286
0 commit comments