Ejemplo n.º 1
0
def main(sourceFileName):
  start_ms = int(round(time.time() * 1000))
  pants_refs =  DepsFromPom(PomUtils.pom_provides_target()).get(sourceFileName)
  elapsed_ms = int(round(time.time() * 1000)) - start_ms
  for pants_ref in pants_refs:
    print("      {ref}".format(ref=pants_ref))
  print
  print("Parsed %d pom.xml files in %dms." % (PomContentHandler.num_invocations(), elapsed_ms))
Ejemplo n.º 2
0
def main(sourceFileName):
    start_ms = int(round(time.time() * 1000))
    pants_refs = DepsFromPom(
        PomUtils.pom_provides_target()).get(sourceFileName)
    elapsed_ms = int(round(time.time() * 1000)) - start_ms
    for pants_ref in pants_refs:
        print("      {ref}".format(ref=pants_ref))
    print
    print("Parsed %d pom.xml files in %dms." %
          (PomContentHandler.num_invocations(), elapsed_ms))
Ejemplo n.º 3
0
 def _get_parsed_pom_data(self, generation_context):
   self.deps_from_pom = DepsFromPom(PomUtils.pom_provides_target(rootdir=self.root_directory),
     rootdir=self.root_directory,
     exclude_project_targets=generation_context.exclude_project_targets
   )
   self.wire_info = WireInfo.from_pom(self.path, self.root_directory)
   self.signed_jar_info = SignedJarInfo.from_pom(self.path, self.root_directory)
   self.java_options_info = JavaOptionsInfo.from_pom(self.path, self.root_directory)
   self.shading_info = ShadingInfo.from_pom(self.path, self.root_directory)
   self.jooq_info = JooqInfo.from_pom(self.path, self.root_directory)
Ejemplo n.º 4
0
def main(args):
    """Searches all known modules for an artifactId
     of the module defined in sourceFile and prints them out as <groupId>.<artifactId>
  """

    usage = """usage: %prog [options]
  Searches all known modules for an artifactId or <groupId>.<artifactId>
  and prints out the name of pom.xml files that provide them

  e.g. %prog --target=com.squareup.service.exemplar
       %prog --artifactId=annotations
  """
    parser = OptionParser(usage=usage)
    parser.add_option("-a",
                      "--artifactId",
                      dest="artifactId",
                      help="<artifactId> from maven pom file")
    parser.add_option("-t",
                      "--target",
                      dest="target",
                      help="<groupId>.<artifactId> from maven pom file ")
    (options, args) = parser.parse_args(args)

    if not options.artifactId and not options.target:
        parser.print_help()
        PomUtils.common_usage()
        sys.exit(1)

    if options.artifactId:
        poms = PomUtils.pom_provides_target().find_artifact(options.artifactId)
    elif options.target:
        poms = PomUtils.pom_provides_target().find_target(options.target)

    if len(poms) == 0:
        logger.critical("*** No pom.xml file found")
        sys.exit(1)

    for pom in poms:
        print pom
Ejemplo n.º 5
0
def main(args):
  """Searches all known modules for an artifactId
     of the module defined in sourceFile and prints them out as <groupId>.<artifactId>
  """

  usage = """usage: %prog [options]
  Searches all known modules for an artifactId or <groupId>.<artifactId>
  and prints out the name of pom.xml files that provide them

  e.g. %prog --target=com.squareup.service.exemplar
       %prog --artifactId=annotations
  """
  parser = OptionParser(usage=usage)
  parser.add_option("-a", "--artifactId", dest="artifactId",
                    help="<artifactId> from maven pom file")
  parser.add_option("-t", "--target", dest="target",
                    help="<groupId>.<artifactId> from maven pom file ")
  (options, args) = parser.parse_args(args)

  if not options.artifactId and not options.target:
    parser.print_help()
    PomUtils.common_usage()
    sys.exit(1)


  if options.artifactId:
    poms = PomUtils.pom_provides_target().find_artifact(options.artifactId)
  elif options.target:
    poms = PomUtils.pom_provides_target().find_target(options.target)

  if len(poms) == 0:
    logger.critical("*** No pom.xml file found")
    sys.exit(1)

  for pom in poms:
    print pom