def _generate_java_test_coverage_flag(env):
 env_dict = env.Dictionary()
 jacoco_agent = env_dict.get('JACOCOAGENT')
 if jacoco_agent:
  jacoco_agent = os.path.abspath(jacoco_agent)
  target_under_test_package = env_dict.get('JAVATARGETUNDERTESTPKG')
  if target_under_test_package:
   options = []
   options.append(('includes=%s' % ':'.join([(p + '.*') for p in target_under_test_package if p])))
   options.append('output=file')
   return ('-javaagent:%s=%s' % (jacoco_agent, ','.join(options)))
 return ''

def _generate_java_test_coverage_flag ( env ) : env_dict = env . Dictionary ( ) jacoco_agent = env_dict . get ( 'JACOCOAGENT' ) if jacoco_agent : jacoco_agent = os . path . abspath ( jacoco_agent ) target_under_test_package = env_dict . get ( 'JAVATARGETUNDERTESTPKG' ) if target_under_test_package : options = [ ] options . append ( ( 'includes=%s' % ':' . join ( [ ( p + '.*' ) for p in target_under_test_package if p ] ) ) ) options . append ( 'output=file' ) return ( '-javaagent:%s=%s' % ( jacoco_agent , ',' . join ( options ) ) ) return ''
returns java test coverage flags based on the environment passed in .