private boolean isBuildConfigPresent ( Artifact artifact , String packageName ) throws MojoExecutionException { try { JarFile jar = new JarFile ( getUnpackedAarClassesJar ( artifact ) ) ; JarEntry entry = jar . getJarEntry ( packageName . replace ( ' ' , ' ' ) + "/BuildConfig.class" ) ; return ( entry != null ) ; } catch ( IOException e ) { getLog ( ) . error ( "Error generating BuildConfig " , e ) ; throw new MojoExecutionException ( "Error generating BuildConfig" , e ) ; } }
Check whether the artifact includes a BuildConfig located in a given package .