import * as path from '../../path' ; import * as fs from '../../fs' ; import { Config } from '../../../types' ; import { logError , logInfo } from '../../../helpers' ; const kRepository = `maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' }` ; param { object } configuration export function postLink ( configuration ) { logInfo ( 'patching Android for react-native-zendesk-chat' ) ; const gradlePath = path . android . gradlePath ( ) ; const stylesPath = path . android . stylesPath ( ) ; if ( ! configuration . zendeskChat || ! configuration . zendeskChat . accountKey ) { logError ( 'zendeskChat.accountKey needs to be set in the project env' ) ; return process . exit ( 1 ) ; } fs . update ( gradlePath , 'repositories {' , `repositories {\n        ${ kRepository }` ) ; fs . update ( stylesPath , '</resources>' , '<style name="ZopimChatTheme" parent="ZopimChatTheme.Dark" />\n</resources>' ) ; fs . update ( path . android . mainApplicationPath ( configuration ) , 'import com.taskrabbit.zendesk.RNZendeskChat.RNZendeskChatPackage;' , `import com.taskrabbit.zendesk.*;` ) ; }