Example #1
0
    def create_target(category, target_name, target_index, targets):
        def name(name):
            return "%s-%s-%d" % (target_name, name, target_index)

        # TODO(John Sirois): JavaLibrary and ScalaLibrary can float here between src/ and tests/ - add
        # ant build support to allow the same treatment for JavaThriftLibrary and JavaProtobufLibrary
        # so that tests can house test IDL in tests/
        target_type, base = category
        if target_type == JavaProtobufLibrary:
            return JavaProtobufLibrary._aggregate(name('protobuf'), provides,
                                                  buildflags, targets)
        elif target_type == JavaThriftLibrary:
            return JavaThriftLibrary._aggregate(name('thrift'), provides,
                                                buildflags, targets)
        elif target_type == AnnotationProcessor:
            return AnnotationProcessor._aggregate(name('apt'), provides,
                                                  targets)
        elif target_type == JavaLibrary:
            return JavaLibrary._aggregate(name('java'), provides, deployjar,
                                          buildflags, targets, base)
        elif target_type == ScalaLibrary:
            return ScalaLibrary._aggregate(name('scala'), provides, deployjar,
                                           buildflags, targets, base)
        elif target_type == JavaTests:
            return JavaTests._aggregate(name('java-tests'), buildflags,
                                        targets)
        elif target_type == ScalaTests:
            return ScalaTests._aggregate(name('scala-tests'), buildflags,
                                         targets)
        else:
            raise Exception("Cannot aggregate targets of type: %s" %
                            target_type)
Example #2
0
  def create_target(target_type, target_name, target_index, targets):
    def name(name):
      return "%s-%s-%d" % (target_name, name, target_index)

    if target_type == JavaProtobufLibrary:
      return JavaProtobufLibrary._aggregate(name('protobuf'), provides, buildflags, targets)
    elif target_type == JavaThriftLibrary:
      return JavaThriftLibrary._aggregate(name('thrift'), provides, buildflags, targets)
    elif target_type == JavaLibrary:
      return JavaLibrary._aggregate(name('java'), provides, deployjar, buildflags, targets)
    elif target_type == ScalaLibrary:
      return ScalaLibrary._aggregate(name('scala'), provides, deployjar, buildflags, targets)
    elif target_type == JavaTests:
      return JavaTests._aggregate(name('java-tests'), buildflags, targets)
    elif target_type == ScalaTests:
      return ScalaTests._aggregate(name('scala-tests'), buildflags, targets)
    else:
      raise Exception("Cannot aggregate targets of type: %s" % target_type)
Example #3
0
File: bang.py Project: crnt/commons
  def create_target(category, target_name, target_index, targets):
    def name(name):
      return "%s-%s-%d" % (target_name, name, target_index)

    # TODO(John Sirois): JavaLibrary and ScalaLibrary can float here between src/ and tests/ - add
    # ant build support to allow the same treatment for JavaThriftLibrary and JavaProtobufLibrary
    # so that tests can house test IDL in tests/
    target_type, base = category
    if target_type == JavaProtobufLibrary:
      return JavaProtobufLibrary._aggregate(name('protobuf'), provides, buildflags, targets)
    elif target_type == JavaThriftLibrary:
      return JavaThriftLibrary._aggregate(name('thrift'), provides, buildflags, targets)
    elif target_type == AnnotationProcessor:
      return AnnotationProcessor._aggregate(name('apt'), provides, targets)
    elif target_type == JavaLibrary:
      return JavaLibrary._aggregate(name('java'), provides, deployjar, buildflags, targets, base)
    elif target_type == ScalaLibrary:
      return ScalaLibrary._aggregate(name('scala'), provides, deployjar, buildflags, targets, base)
    elif target_type == JavaTests:
      return JavaTests._aggregate(name('java-tests'), buildflags, targets)
    elif target_type == ScalaTests:
      return ScalaTests._aggregate(name('scala-tests'), buildflags, targets)
    else:
      raise Exception("Cannot aggregate targets of type: %s" % target_type)