def GenerateClasspathFile(target_list, target_dicts, toplevel_dir, toplevel_build, out_name):
 gyp.common.EnsureDirExists(out_name)
 result = ET.Element('classpath')
 def AddElements(kind, paths):
  rel_paths = set()
  for path in paths:
   if os.path.isabs(path):
    rel_paths.add(os.path.relpath(path, toplevel_dir))
   else:
    rel_paths.add(path)
  for path in sorted(rel_paths):
   entry_element = ET.SubElement(result, 'classpathentry')
   entry_element.set('kind', kind)
   entry_element.set('path', path)
 AddElements('lib', GetJavaJars(target_list, target_dicts, toplevel_dir))
 AddElements('src', GetJavaSourceDirs(target_list, target_dicts, toplevel_dir))
 AddElements('con', ['org.eclipse.jdt.launching.JRE_CONTAINER'])
 AddElements('output', [os.path.join(toplevel_build, '.eclipse-java-build')])
 ET.ElementTree(result).write(out_name)

def GenerateClasspathFile ( target_list , target_dicts , toplevel_dir , toplevel_build , out_name ) : gyp . common . EnsureDirExists ( out_name ) result = ET . Element ( 'classpath' ) def AddElements ( kind , paths ) : rel_paths = set ( ) for path in paths : if os . path . isabs ( path ) : rel_paths . add ( os . path . relpath ( path , toplevel_dir ) ) else : rel_paths . add ( path ) for path in sorted ( rel_paths ) : entry_element = ET . SubElement ( result , 'classpathentry' ) entry_element . set ( 'kind' , kind ) entry_element . set ( 'path' , path ) AddElements ( 'lib' , GetJavaJars ( target_list , target_dicts , toplevel_dir ) ) AddElements ( 'src' , GetJavaSourceDirs ( target_list , target_dicts , toplevel_dir ) ) AddElements ( 'con' , [ 'org.eclipse.jdt.launching.JRE_CONTAINER' ] ) AddElements ( 'output' , [ os . path . join ( toplevel_build , '.eclipse-java-build' ) ] ) ET . ElementTree ( result ) . write ( out_name )
generates a classpath file suitable for symbol navigation and code completion of java code by finding all .