import { Config } from '../types' ; const path = require ( 'path' ) ; let _pathToFLAGSHIP ; let _pathToProject ; let _pathToApp ; returns { string } function getPathToFLAGSHIP ( ) { if ( _pathToFLAGSHIP ) { return _pathToFLAGSHIP ; } _pathToFLAGSHIP = path . resolve ( __dirname , '..' , '..' ) ; return _pathToFLAGSHIP ; } returns { string } function getPathToApp ( ) { if ( _pathToApp ) { return _pathToApp ; } _pathToApp = path . resolve ( __dirname , '..' , '..' , '..' , 'fsapp' ) ; return _pathToApp ; } returns { string } function getPathToProject ( ) { if ( _pathToProject ) { return _pathToProject ; } _pathToProject = process . cwd ( ) ; return _pathToProject ; } param { ... string } paths returns { string } function resolvePathFromFLAGSHIP ( ... paths ) { return path . resolve . apply ( path , [ getPathToFLAGSHIP ( ) , ... paths ] ) ; } param { ... string } paths returns { string } function resolvePathFromApp ( ... paths ) { return path . resolve . apply ( path , [ getPathToApp ( ) , ... paths ] ) ; } param { ... string } paths returns { string } function resolvePathFromProject ( ... paths ) { return path . resolve . apply ( path , [ getPathToProject ( ) , ... paths ] ) ; } param { object } configuration returns { string } function getInfoPlistPath ( configuration ) { return path . resolve ( getNativeProjectPathIOS ( configuration ) , 'Info.plist' ) ; } param { object } configuration returns { string } function getAppDelegatePath ( configuration ) { return resolvePathFromProject ( 'ios' , configuration . name , 'AppDelegate.m' ) ; } returns { string } function getPodfilePath ( ) { return resolvePathFromProject ( 'ios' , 'Podfile' ) ; } param { object } configuration returns { string } function getPbxprojFilePath ( configuration ) { return resolvePathFromProject ( 'ios' , `${ configuration . name }.xcodeproj` , 'project.pbxproj' ) ; } param { object } configuration returns { string } function getNativeProjectPathIOS ( configuration ) { return resolvePathFromProject ( 'ios' , configuration . name ) ; } returns { string } function getFastfilePathIOS ( ) { return resolvePathFromProject ( 'ios' , 'fastlane' , 'Fastfile' ) ; } param { object } configuration returns { string } function getMainActivityPath ( configuration ) { return resolvePathFromProject ( getNativeProjectPathAndriod ( configuration ) , 'MainActivity.java' ) ; } param { object } configuration returns { string } function getMainApplicationPath ( configuration ) { return resolvePathFromProject ( getNativeProjectPathAndriod ( configuration ) , 'MainApplication.java' ) ; } returns { string } function getManifestPath ( ) { return resolvePathFromProject ( getMainPath ( ) , 'AndroidManifest.xml' ) ; } param { object } configuration returns { string } function getNativeProjectPathAndriod ( configuration ) { const pkgId = configuration . bundleIds && configuration . bundleIds . android ? configuration . bundleIds . android : `com.brandingbrand.reactnative.and.${ configuration . name }` ; return resolvePathFromProject ( getMainPath ( ) , 'java' , ... pkgId . toLowerCase ( ) . split ( '.' ) ) ; } returns { string } function getGradlePath ( ) { return resolvePathFromProject ( 'android' , 'app' , 'build.gradle' ) ; } returns { string } function getGradlePropertiesPath ( ) { return resolvePathFromProject ( 'android' , 'gradle.properties' ) ; } returns { string } function getMainPath ( ) { return resolvePathFromProject ( 'android' , 'app' , 'src' , 'main' ) ; } returns { string } function getDebugPath ( ) { return resolvePathFromProject ( 'android' , 'app' , 'src' , 'debug' ) ; } returns { string } function getAssetsPath ( ) { return resolvePathFromProject ( getMainPath ( ) , 'assets' ) ; } returns { string } function getResourcesPath ( ) { return resolvePathFromProject ( getMainPath ( ) , 'res' ) ; } returns { string } function getStringsPath ( ) { return resolvePathFromProject ( getResourcesPath ( ) , 'values' , 'strings.xml' ) ; } returns { string } function getStylesPath ( ) { return resolvePathFromProject ( getResourcesPath ( ) , 'values' , 'styles.xml' ) ; } returns { string } function getFastfilePathAndroid ( ) { return resolvePathFromProject ( 'android' , 'fastlane' , 'Fastfile' ) ; } export const resolve = path . resolve ; export const extname = path . extname ; export const basename = path . basename ; export const sep = path . sep ; export const normalize = path . normalize ; export const flagship = { path : getPathToFLAGSHIP , resolve : resolvePathFromFLAGSHIP } ; export const app = { path : getPathToApp , resolve : resolvePathFromApp } ; export const project = { path : getPathToProject , resolve : resolvePathFromProject } ; export const ios = { appDelegatePath : getAppDelegatePath , fastfilePath : getFastfilePathIOS , infoPlistPath : getInfoPlistPath , podfilePath : getPodfilePath , pbxprojFilePath : getPbxprojFilePath , nativeProjectPath : getNativeProjectPathIOS } ; export const android = { mainActivityPath : getMainActivityPath , mainApplicationPath : getMainApplicationPath , manifestPath : getManifestPath , nativeProjectPath : getNativeProjectPathAndriod , gradlePath : getGradlePath , gradlePropertiesPath : getGradlePropertiesPath , mainPath : getMainPath , debugPath : getDebugPath , assetsPath : getAssetsPath , resourcesPath : getResourcesPath , stringsPath : getStringsPath , stylesPath : getStylesPath , fastfilePath : getFastfilePathAndroid } ;