示例#1
0
  def build_libs_dir(self, target, ivyxml, conf):
    all_deps = OrderedSet()
    all_sources = ['dummy']
    def extract_jars(ttarget):
      for jar_dep in ttarget.jar_dependencies:
        if jar_dep.rev:
          all_deps.add(copy(jar_dep))
    target.walk(extract_jars)
    def create_meta_target():
      return JavaLibrary(target.name + '.deps',
                         all_sources,
                         dependencies = all_deps,
                         is_meta = True)

    meta_target = target.do_in_context(create_meta_target)

    local_ivy = os.path.abspath(ivyxml) + ".local"
    AntBuilder.generate_ivy(self.workspace_root, local_ivy, meta_target)
    libs_dir = os.path.join(os.path.dirname(os.path.abspath(ivyxml)), 'libs', conf)
    if not os.path.exists(libs_dir):
      os.makedirs(libs_dir)
    classpath_result = subprocess.call([
        'java',
        '-jar', self.ivy_jar,
        '-settings', self.ivy_settings,
        '-ivy', local_ivy,
        '-confs', conf,
        '-retrieve',
        "%s/[artifact]-[revision].[ext]" % libs_dir,
        "-symlink",
        "-sync"])
示例#2
0
  def build_libs_dir(self, target, ivyxml, conf):
    all_deps = OrderedSet()
    all_sources = ['dummy']
    def extract_jars(ttarget):
      for jar_dep in ttarget.jar_dependencies:
        if jar_dep.rev:
          all_deps.add(copy(jar_dep))
    target.walk(extract_jars)
    def create_meta_target():
      return JavaLibrary(target.name + '.deps',
                         all_sources,
                         dependencies = all_deps,
                         is_meta = True)

    meta_target = target.do_in_context(create_meta_target)

    local_ivy = os.path.abspath(ivyxml) + ".local"
    AntBuilder.generate_ivy(self.workspace_root, local_ivy, meta_target)
    libs_dir = os.path.join(os.path.dirname(os.path.abspath(ivyxml)), 'libs', conf)
    if not os.path.exists(libs_dir):
      os.makedirs(libs_dir)
    classpath_result = subprocess.call([
        'java',
        '-jar', self.ivy_jar,
        '-settings', self.ivy_settings,
        '-ivy', local_ivy,
        '-confs', conf,
        '-retrieve',
        "%s/[artifact]-[revision].[ext]" % libs_dir,
        "-symlink",
        "-sync"])
示例#3
0
文件: ide.py 项目: znewman01/commons
  def _generate_ivy(self, ide_target):
    jvmbuilder = AntBuilder(self.error, self.root_dir)

    antargs = []
    if self.options.clean:
      antargs.extend([ 'clean-all', 'compile' ])

    _, ivyfile, _ = jvmbuilder.generate_and_build([ide_target], antargs, name = self.project_name)
    return ivyfile, os.path.join(self.root_dir, 'build-support', 'ivy', 'ivysettings.xml')
示例#4
0
文件: build.py 项目: DikangGu/commons
 def _jvm_build(self, targets):
   try:
     # TODO(John Sirois): think about moving away from the ant backend
     executor = AntBuilder(self.error, self.root_dir, self.is_ide, self.ide_transitivity)
     if self.options.quiet:
       self.build_args.insert(0, "-logger")
       self.build_args.insert(1, "org.apache.tools.ant.NoBannerLogger")
       self.build_args.insert(2, "-q")
     return executor.build(targets, self.build_args)
   except:
     self.error("Problem executing AntBuilder for targets %s: %s" % (targets,
                                                                     traceback.format_exc()))
示例#5
0
文件: build.py 项目: cscotta/commons
 def _jvm_build(self, targets):
     try:
         # TODO(John Sirois): think about moving away from the ant backend
         executor = AntBuilder(self.error, self.root_dir, self.is_ide,
                               self.ide_transitivity)
         if self.options.quiet:
             self.build_args.insert(0, "-logger")
             self.build_args.insert(1,
                                    "org.apache.tools.ant.NoBannerLogger")
             self.build_args.insert(2, "-q")
         return executor.build(targets, self.build_args)
     except:
         self.error("Problem executing AntBuilder for targets %s: %s" %
                    (targets, traceback.format_exc()))
示例#6
0
文件: build.py 项目: adamsxu/commons
 def _jvm_build(self, targets):
   try:
     # TODO(John Sirois): think about moving away from the ant backend
     executor = AntBuilder(self.error, self.root_dir)
     if self.options.quiet:
       self.build_args.insert(0, "-logger")
       self.build_args.insert(1, "org.apache.tools.ant.NoBannerLogger")
       self.build_args.insert(2, "-q")
     if self.options.time:
       self.build_args.insert(0, "-lib")
       self.build_args.insert(1, "build-support/antlib")
       self.build_args.insert(2, "-listener")
       self.build_args.insert(3, "net.sf.antcontrib.perf.AntPerformanceListener")
     return executor.build(targets, self.build_args)
   except:
     self.error("Problem executing AntBuilder for targets %s: %s" % (targets,
                                                                     traceback.format_exc()))
示例#7
0
 def _jvm_build(self, targets):
     try:
         # TODO(John Sirois): think about moving away from the ant backend
         executor = AntBuilder(self.error, self.root_dir)
         if self.options.quiet:
             self.build_args.insert(0, "-logger")
             self.build_args.insert(1,
                                    "org.apache.tools.ant.NoBannerLogger")
             self.build_args.insert(2, "-q")
         if self.options.time:
             self.build_args.insert(0, "-lib")
             self.build_args.insert(1, "build-support/antlib")
             self.build_args.insert(2, "-listener")
             self.build_args.insert(
                 3, "net.sf.antcontrib.perf.AntPerformanceListener")
         return executor.build(targets, self.build_args)
     except:
         self.error("Problem executing AntBuilder for targets %s: %s" %
                    (targets, traceback.format_exc()))
示例#8
0
 def create_ivyxml(self, target):
   builder = AntBuilder(self.error, self.workspace_root, False, False)
   buildxml, ivyxml = builder.create_ant_builds(self.workspace_root, dict(), set(), target)
   return ivyxml
示例#9
0
 def create_ivyxml(self, target):
   builder = AntBuilder(self.error, self.workspace_root, False, False)
   buildxml, ivyxml = builder.create_ant_builds(self.workspace_root, dict(), set(), target)
   return ivyxml
示例#10
0
文件: doc.py 项目: DikangGu/commons
 def _create_ivy_file(self, target):
   ivy_file = os.path.abspath(os.path.join(self.target_path, 'ivy.xml'))
   AntBuilder.generate_ivy(self.root_dir, ivy_file, target)
   return ivy_file
示例#11
0
文件: doc.py 项目: znewman01/commons
 def _create_ivy_file(self, target, target_path):
     ivy_file = os.path.abspath(os.path.join(target_path, 'ivy.xml'))
     AntBuilder.generate_ivy(self.root_dir, ivy_file, target)
     return ivy_file