@@ -8,6 +8,7 @@ import * as semver from "semver";
8
8
import * as projectServiceBaseLib from "./platform-project-service-base" ;
9
9
import * as androidDebugBridgePath from "../common/mobile/android/android-debug-bridge" ;
10
10
import { AndroidDeviceHashService } from "../common/mobile/android/android-device-hash-service" ;
11
+ import { EOL } from "os" ;
11
12
12
13
export class AndroidProjectService extends projectServiceBaseLib . PlatformProjectServiceBase implements IPlatformProjectService {
13
14
private static VALUES_DIRNAME = "values" ;
@@ -233,12 +234,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
233
234
}
234
235
this . spawn ( gradleBin , buildOptions , { stdio : "inherit" , cwd : this . platformData . projectRoot } ) . wait ( ) ;
235
236
} else {
236
- this . checkAnt ( ) . wait ( ) ;
237
-
238
- let args = this . getAntArgs ( this . $options . release ? "release" : "debug" , projectRoot ) ;
239
- this . spawn ( 'ant' , args ) . wait ( ) ;
240
-
241
- this . platformData . deviceBuildOutputPath = path . join ( this . platformData . projectRoot , "bin" ) ;
237
+ this . $errors . failWithoutHelp ( "Cannot complete build because this project is ANT-based." + EOL +
238
+ "Run `tns platform remove android && tns platform add android` to switch to Gradle and try again." ) ;
242
239
}
243
240
} ) . future < void > ( ) ( ) ;
244
241
}
@@ -416,32 +413,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
416
413
return this . $childProcess . spawnFromEvent ( command , args , "close" , opts || { stdio : "inherit" } ) ;
417
414
}
418
415
419
- private getAntArgs ( configuration : string , projectRoot : string ) : string [ ] {
420
- let args = [ configuration , "-f" , path . join ( projectRoot , "build.xml" ) ] ;
421
- if ( configuration === "release" ) {
422
- if ( this . $options . keyStorePath ) {
423
- args = args . concat ( [ "-Dkey.store" , path . resolve ( this . $options . keyStorePath ) ] ) ;
424
- }
425
-
426
- if ( this . $options . keyStorePassword ) {
427
- args = args . concat ( [ "-Dkey.store.password" , this . $options . keyStorePassword ] ) ;
428
- }
429
-
430
- if ( this . $options . keyStoreAlias ) {
431
- args = args . concat ( [ "-Dkey.alias" , this . $options . keyStoreAlias ] ) ;
432
- }
433
-
434
- if ( this . $options . keyStoreAliasPassword ) {
435
- args = args . concat ( [ "-Dkey.alias.password" , this . $options . keyStoreAliasPassword ] ) ;
436
- }
437
- }
438
-
439
- // metadata generation support
440
- args = args . concat ( [ "-Dns.resources" , path . join ( __dirname , "../../resources/tools" ) ] ) ;
441
-
442
- return args ;
443
- }
444
-
445
416
private validatePackageName ( packageName : string ) : void {
446
417
//Make the package conform to Java package types
447
418
//Enforce underscore limitation
@@ -483,16 +454,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
483
454
} ) . future < string > ( ) ( ) ;
484
455
}
485
456
486
- private checkAnt ( ) : IFuture < void > {
487
- return ( ( ) => {
488
- try {
489
- this . $childProcess . exec ( "ant -version" ) . wait ( ) ;
490
- } catch ( error ) {
491
- this . $errors . fail ( "Error executing commands 'ant', make sure you have ant installed and added to your PATH." ) ;
492
- }
493
- } ) . future < void > ( ) ( ) ;
494
- }
495
-
496
457
private symlinkDirectory ( directoryName : string , projectRoot : string , frameworkDir : string ) : IFuture < void > {
497
458
return ( ( ) => {
498
459
this . $fs . createDirectory ( path . join ( projectRoot , directoryName ) ) . wait ( ) ;
0 commit comments