@@ -11,6 +11,7 @@ export interface ILocalDependencyData extends IDependencyData {
11
11
export class TnsModulesCopy {
12
12
constructor (
13
13
private outputRoot : string ,
14
+ private $options : IOptions ,
14
15
private $fs : IFileSystem
15
16
) {
16
17
}
@@ -26,12 +27,18 @@ export class TnsModulesCopy {
26
27
27
28
// Remove .ts files
28
29
let allFiles = this . $fs . enumerateFilesInDirectorySync ( tnsCoreModulesResourcePath ) ;
29
- let deleteFilesFutures = allFiles . filter ( file => minimatch ( file , "**/*.ts" , { nocase : true } ) ) . map ( file => this . $fs . deleteFile ( file ) ) ;
30
- Future . wait ( deleteFilesFutures ) ;
30
+ if ( this . $options . release ) {
31
+ let deleteFilesFutures = allFiles . filter ( file => minimatch ( file , "**/*.ts" , { nocase : true } ) ) . map ( file => this . $fs . deleteFile ( file ) ) ;
32
+ Future . wait ( deleteFilesFutures ) ;
33
+ } else {
34
+ let deleteFilesFutures = allFiles . filter ( file => minimatch ( file , "**/*.d.ts" , { nocase : true } ) ) . map ( file => this . $fs . deleteFile ( file ) ) ;
35
+ Future . wait ( deleteFilesFutures ) ;
36
+ }
37
+
31
38
32
39
shelljs . rm ( "-rf" , path . join ( tnsCoreModulesResourcePath , "node_modules" ) ) ;
33
40
34
- // TODO: The following two lines are necessary to temporarily work around hardcoded
41
+ // TODO: The following two lines are necessary to temporarily work around hardcoded
35
42
// path dependencies in iOS livesync logic. Should be addressed ASAP
36
43
shelljs . cp ( "-Rf" , path . join ( tnsCoreModulesResourcePath , "*" ) , this . outputRoot ) ;
37
44
shelljs . rm ( "-rf" , tnsCoreModulesResourcePath ) ;
0 commit comments