<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import itertools <EOL> import os <EOL> from pants . backend . jvm . targets . jvm_app import JvmApp <EOL> from pants . backend . jvm . targets . scala_library import ScalaLibrary <EOL> from pants . base . build_environment import get_buildroot <EOL> from pants . task . console_task import ConsoleTask <EOL> class FileDeps ( ConsoleTask ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def register_options ( cls , register ) : <EOL> super ( FileDeps , cls ) . register_options ( register ) <EOL> register ( '<STR_LIT>' , type = bool , <EOL> help = '<STR_LIT>' ) <EOL> def console_output ( self , targets ) : <EOL> concrete_targets = set ( ) <EOL> for target in targets : <EOL> concrete_target = target . concrete_derived_from <EOL> concrete_targets . add ( concrete_target ) <EOL> if isinstance ( concrete_target , ScalaLibrary ) : <EOL> concrete_targets . update ( concrete_target . java_sources ) <EOL> buildroot = get_buildroot ( ) <EOL> files = set ( ) <EOL> output_globs = self . get_options ( ) . globs <EOL> concrete_targets = set ( [ target for target in concrete_targets if not target . is_synthetic ] ) <EOL> for target in concrete_targets : <EOL> files . add ( target . address . build_file . full_path ) <EOL> if output_globs or target . has_sources ( ) : <EOL> if output_globs : <EOL> globs_obj = target . globs_relative_to_buildroot ( ) <EOL> if globs_obj : <EOL> files . update ( os . path . join ( buildroot , src ) for src in globs_obj [ '<STR_LIT>' ] ) <EOL> else : <EOL> files . update ( os . path . join ( buildroot , src ) for src in target . sources_relative_to_buildroot ( ) ) <EOL> if isinstance ( target , JvmApp ) and not output_globs : <EOL> files . update ( itertools . chain ( * [ bundle . filemap . keys ( ) for bundle in target . bundles ] ) ) <EOL> return files </s>
