code: 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 );
          }
      }
docs: Check whether the artifact includes a BuildConfig located in a given package.
  
  @param artifact    an AAR artifact to look for BuildConfig in
  @param packageName BuildConfig package name
  @throws MojoExecutionException