예제 #1
0
def main():
    parser = optparse.OptionParser()
    build_utils.AddDepfileOption(parser)
    parser.add_option('--output-dir', help='Directory to put javadoc')
    parser.add_option('--input-dir', help='Root of cronet source')
    parser.add_option('--input-src-jar', help='Cronet api source jar')
    parser.add_option('--overview-file', help='Path of the overview page')
    parser.add_option('--readme-file', help='Path of the README.md')
    parser.add_option('--lib-java-dir', help='Directory containing java libs')

    options, _ = parser.parse_args()
    # A temporary directory to put the output of cronet api source jar files.
    unzipped_jar_path = tempfile.mkdtemp(dir=options.output_dir)
    if os.path.exists(options.input_src_jar):
        jar_cmd = ['jar', 'xf', os.path.abspath(options.input_src_jar)]
        build_utils.CheckOutput(jar_cmd, cwd=unzipped_jar_path)
    else:
        raise Exception('Jar file does not exist: %s' % options.input_src_jar)

    net_docs.ProcessDocs([options.readme_file],
                         options.input_dir,
                         options.output_dir,
                         extensions=[CronetExtension()])

    GenerateJavadoc(options, os.path.abspath(unzipped_jar_path))

    if options.depfile:
        input_paths = []
        for root, _, filenames in os.walk(options.input_dir):
            input_paths.extend(os.path.join(root, f) for f in filenames)
        build_utils.WriteDepfile(
            options.depfile, input_paths + build_utils.GetPythonDependencies())
    # Clean up temporary output directory.
    build_utils.DeleteDirectory(unzipped_jar_path)
예제 #2
0
def main():
  parser = optparse.OptionParser()
  build_utils.AddDepfileOption(parser)
  parser.add_option('--src-dir', action="append",
      help='Directory containing .java files.')
  parser.add_option('--jar-path', help='Jar output path.')
  parser.add_option('--stamp', help='Path to touch on success.')

  options, _ = parser.parse_args()

  src_dirs = []
  for src_dir in options.src_dir:
    src_dirs.extend(build_utils.ParseGypList(src_dir))

  for src_dir in src_dirs:
    JarSources(src_dir, options.jar_path)

  if options.depfile:
    input_paths = []
    for src_dir in src_dirs:
      for root, _, filenames in os.walk(src_dir):
        input_paths.extend(os.path.join(root, f) for f in filenames)
    build_utils.WriteDepfile(options.depfile,
                             input_paths + build_utils.GetPythonDependencies())

  if options.stamp:
    build_utils.Touch(options.stamp)
예제 #3
0
def main():
    parser = optparse.OptionParser()
    build_utils.AddDepfileOption(parser)
    parser.add_option('--src-dir',
                      action="append",
                      help='Directory containing .java files.')
    parser.add_option(
        '--src-jars',
        action="append",
        help='A list of source jars to include in addition to source files.')
    parser.add_option('--jar-path', help='Jar output path.')
    parser.add_option('--stamp', help='Path to touch on success.')

    options, _ = parser.parse_args()

    # A temporary directory to put the output of jar files.
    unzipped_jar_path = None
    if options.src_jars:
        unzipped_jar_path = tempfile.mkdtemp(
            dir=os.path.dirname(options.jar_path))
        jar_list = []
        for gn_list in options.src_jars:
            jar_list.extend(build_utils.ParseGnList(gn_list))

        for jar in jar_list:
            UnzipSourceJar(jar, unzipped_jar_path)

    src_dirs = []
    for src_dir in options.src_dir:
        src_dirs.extend(build_utils.ParseGnList(src_dir))
    if unzipped_jar_path:
        src_dirs += [unzipped_jar_path]

    for src_dir in src_dirs:
        JarSources(src_dir, options.jar_path)

    if options.depfile:
        input_paths = []
        for src_dir in src_dirs:
            for root, _, filenames in os.walk(src_dir):
                input_paths.extend(os.path.join(root, f) for f in filenames)
        build_utils.WriteDepfile(
            options.depfile, input_paths + build_utils.GetPythonDependencies())
    # Clean up temporary output directory.
    if unzipped_jar_path:
        build_utils.DeleteDirectory(unzipped_jar_path)

    if options.stamp:
        build_utils.Touch(options.stamp)
예제 #4
0
def main():
    parser = optparse.OptionParser()
    build_utils.AddDepfileOption(parser)
    parser.add_option('--classes-dir',
                      help='Directory to extract .class files.')
    parser.add_option('--jars', help='Paths to jars to extract.')
    parser.add_option('--stamp', help='Path to touch on success.')

    options, _ = parser.parse_args()

    ExtractJars(options)

    if options.depfile:
        build_utils.WriteDepfile(options.depfile,
                                 build_utils.GetPythonDependencies())

    if options.stamp:
        build_utils.Touch(options.stamp)
예제 #5
0
def main():
  parser = optparse.OptionParser()
  build_utils.AddDepfileOption(parser)
  parser.add_option('--output-dir', help='Directory to put javadoc')
  parser.add_option('--input-dir', help='Root of cronet source')
  parser.add_option('--overview-file', help='Path of the overview page')
  parser.add_option('--readme-file', help='Path of the README.md')

  options, _ = parser.parse_args()

  net_docs.ProcessDocs([options.readme_file], options.input_dir,
                       options.output_dir, extensions=[CronetExtension()])

  GenerateJavadoc(options)

  if options.depfile:
    input_paths = []
    for root, _, filenames in os.walk(options.input_dir):
      input_paths.extend(os.path.join(root, f) for f in filenames)
    build_utils.WriteDepfile(options.depfile,
                             input_paths + build_utils.GetPythonDependencies())