@@ -44,41 +44,55 @@ export namespace ProjectService {
4444 }
4545
4646 export async function testWebpack ( plugin : MarketplaceService . PluginModel ) {
47- return await testPlugin ( plugin , '--bundle' ) ;
47+ return await testPlugin ( plugin , {
48+ android : '--bundle' ,
49+ ios : '--bundle'
50+ } ) ;
4851 }
4952
5053 export async function testSnapshot ( plugin : MarketplaceService . PluginModel ) {
51- return await testPlugin ( plugin , '--bundle --release --env.snapshot --key-store-path ~/.android/debug.keystore --key-store-password android --key-store-alias androiddebugkey --key-store-alias-password android' ) ;
54+ return await testPlugin ( plugin , {
55+ android : '--bundle --release --env.snapshot --key-store-path ~/.android/debug.keystore --key-store-password android --key-store-alias androiddebugkey --key-store-alias-password android'
56+ } ) ;
5257 }
5358
5459 export async function testUglify ( plugin : MarketplaceService . PluginModel ) {
55- return await testPlugin ( plugin , '--bundle --env.uglify' ) ;
60+ return await testPlugin ( plugin , {
61+ android : '--bundle --env.uglify' ,
62+ ios : '--bundle --env.uglify'
63+ } ) ;
5664 }
5765
5866 export async function testAot ( plugin : MarketplaceService . PluginModel ) {
59- return await testPlugin ( plugin , '--bundle --env.aot' ) ;
67+ return await testPlugin ( plugin , {
68+ android : '--bundle --env.aot' ,
69+ ios : '--bundle --env.aot'
70+ } ) ;
6071 }
6172
6273 export async function testBuild ( plugin : MarketplaceService . PluginModel ) {
63- return await testPlugin ( plugin , '' ) ;
74+ return await testPlugin ( plugin , {
75+ android : ' ' ,
76+ ios : ' '
77+ } ) ;
6478 }
6579
66- async function testPlugin ( plugin : MarketplaceService . PluginModel , options : string ) {
80+ async function testPlugin ( plugin : MarketplaceService . PluginModel , options : { android ?: string , ios ?: string } ) {
6781 const result = { android : false , ios : false } ;
6882 let skipBuild = false ;
6983 try {
7084 skipBuild = ! plugin . badges . androidVersion && plugin . badges . iosVersion ;
71- if ( ! skipBuild ) {
72- result . android = ! ! ( await _buildProject ( testProject , 'android' , options ) ) ;
85+ if ( ! skipBuild && options . android ) {
86+ result . android = ! ! ( await _buildProject ( testProject , 'android' , options . android ) ) ;
7387 } else {
74- Logger . error ( 'Skipping android build! Plugin only has ios support.' ) ;
88+ Logger . error ( 'Skipping android build! Plugin only has ios support or no options supplied .' ) ;
7589 }
7690
7791 skipBuild = ! plugin . badges . iosVersion && plugin . badges . androidVersion ;
78- if ( ! skipBuild ) {
79- result . ios = ! ! ( await _buildProject ( testProject , 'ios' , options ) ) ;
92+ if ( ! skipBuild && options . ios ) {
93+ result . ios = ! ! ( await _buildProject ( testProject , 'ios' , options . ios ) ) ;
8094 } else {
81- Logger . error ( 'Skipping ios build! Plugin only has android support.' ) ;
95+ Logger . error ( 'Skipping ios build! Plugin only has android support or no options supplied .' ) ;
8296 }
8397 } catch ( errExec ) {
8498 Logger . error ( JSON . stringify ( errExec ) ) ;
@@ -89,7 +103,11 @@ export namespace ProjectService {
89103 async function _buildProject ( projectName : string , platform : string , options : string ) {
90104 Logger . debug ( `building project for ${ platform } ...` ) ;
91105 const cwd = path . join ( testDirectory , projectName ) ;
92- const result = await execPromise ( cwd , `tns build ${ platform } ${ options } ` ) ;
106+ if ( platform === 'ios' ) {
107+ options += ' --provision /tns-official/CodeSign/ios/Icenium_QA_Development.mobileprovision --certificate /tns-official/CodeSign/ios/iPhone\ Developer\ Dragon\ Telerikov\ \(GNKAEXW8YQ\).p12 --certificatePassword 1' ;
108+ }
109+
110+ const result = await execPromise ( cwd , `tns cloud build ${ platform } --accountId 1 ${ options } ` ) ;
93111 return result ;
94112 }
95113
0 commit comments