code: def _compute_sources_for_target(self, target):
      
      def resolve_target_sources(target_sources):
        resolved_sources = []
        for tgt in target_sources:
          if tgt.has_sources():
            resolved_sources.extend(tgt.sources_relative_to_buildroot())
        return resolved_sources
  
      sources = [s for s in target.sources_relative_to_buildroot() if self._sources_predicate(s)]
      # TODO: Make this less hacky. Ideally target.java_sources will point to sources, not targets.
      if hasattr(target, 'java_sources') and target.java_sources:
        sources.extend(resolve_target_sources(target.java_sources))
      return sources
docs: Computes and returns the sources (relative to buildroot) for the given target.