<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import os <EOL> from pants . backend . jvm . targets . import_jars_mixin import ImportJarsMixin <EOL> from pants . base . payload import Payload <EOL> from pants . base . payload_field import PrimitiveField <EOL> from pants . util . memo import memoized_property <EOL> from pants . contrib . android . android_manifest_parser import AndroidManifestParser <EOL> from pants . contrib . android . targets . android_target import AndroidTarget <EOL> class AndroidLibrary ( ImportJarsMixin , AndroidTarget ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , payload = None , libraries = None , <EOL> include_patterns = None , exclude_patterns = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> payload = payload or Payload ( ) <EOL> payload . add_fields ( { <EOL> '<STR_LIT>' : PrimitiveField ( libraries or ( ) ) , <EOL> '<STR_LIT>' : PrimitiveField ( include_patterns or ( ) ) , <EOL> '<STR_LIT>' : PrimitiveField ( exclude_patterns or ( ) ) , <EOL> } ) <EOL> self . libraries = libraries <EOL> super ( AndroidLibrary , self ) . __init__ ( payload = payload , ** kwargs ) <EOL> @ property <EOL> def imported_jar_library_specs ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . payload . library_specs <EOL> @ memoized_property <EOL> def manifest ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _manifest_file is None : <EOL> return None <EOL> else : <EOL> manifest_path = os . path . join ( self . _spec_path , self . _manifest_file ) <EOL> return AndroidManifestParser . parse_manifest ( manifest_path ) </s>
