question: private Option < File > findManifestInParentsDirectories ( ) { Option < FileHelper . FileHolder > projectRootHolderOption = fileHelper . findRootProjectHolder ( ) ; if ( projectRootHolderOption . isAbsent ( ) ) { return Option . absent ( ) ; } FileHelper . FileHolder projectRootHolder = projectRootHolderOption . get ( ) ; File projectRoot = projectRootHolder . projectRoot ; File androidManifestFile = new File ( projectRoot , "AndroidManifest.xml" ) ; for ( int i = 0 ; i < MAX_PARENTS_FROM_SOURCE_FOLDER ; i ++ ) { if ( androidManifestFile . exists ( ) ) { break ; } androidManifestFile = new File ( projectRoot , "src" + File . separator + "main" + File . separator + "AndroidManifest.xml" ) ; if ( androidManifestFile . exists ( ) ) { break ; } if ( projectRoot . getParentFile ( ) != null ) { projectRoot = projectRoot . getParentFile ( ) ; androidManifestFile = new File ( projectRoot , "AndroidManifest.xml" ) ; } else { break ; } } if ( ! androidManifestFile . exists ( ) ) { return Option . absent ( ) ; } return Option . of ( androidManifestFile ) ; }
target:  We use a dirty trick to find the AndroidManifest.xml file, since it's not available in the classpath. The idea is quite simple : create a fake class file, retrieve its URI, and start going up in parent folders to find the AndroidManifest.xml file. Any better solution will be appreciated.