Пример #1
0
    def __init__(self,
                 address,
                 payload=None,
                 sources=None,
                 ctypes_native_library=None,
                 strict_deps=None,
                 fatal_warnings=None,
                 **kwargs):

        if not payload:
            payload = Payload()
        sources_field = self.create_sources_field(sources,
                                                  address.spec_path,
                                                  key_arg='sources')
        payload.add_fields({
            'sources': sources_field,
            'ctypes_native_library': ctypes_native_library,
            'strict_deps': PrimitiveField(strict_deps),
            'fatal_warnings': PrimitiveField(fatal_warnings),
        })

        if ctypes_native_library and not isinstance(ctypes_native_library,
                                                    NativeArtifact):
            raise TargetDefinitionException(
                "Target must provide a valid pants '{}' object. Received an object with type '{}' "
                "and value: {}.".format(NativeArtifact.alias(),
                                        type(ctypes_native_library).__name__,
                                        ctypes_native_library))

        super(NativeLibrary, self).__init__(address=address,
                                            payload=payload,
                                            **kwargs)
Пример #2
0
def build_file_aliases():
    return BuildFileAliases(targets={
        CLibrary.alias(): CLibrary,
        CppLibrary.alias(): CppLibrary,
    },
                            objects={
                                NativeArtifact.alias(): NativeArtifact,
                            })
Пример #3
0
def build_file_aliases():
  return BuildFileAliases(
    targets={
      CLibrary.alias(): CLibrary,
      CppLibrary.alias(): CppLibrary,
      ExternalNativeLibrary.alias(): ExternalNativeLibrary,
    },
    objects={
      NativeArtifact.alias(): NativeArtifact,
    }
  )
Пример #4
0
def build_file_aliases():
    return BuildFileAliases(
        targets={
            CLibrary.alias(): CLibrary,
            CppLibrary.alias(): CppLibrary,
            ExternalNativeLibrary.alias(): ExternalNativeLibrary,
            PackagedNativeLibrary.alias(): PackagedNativeLibrary,
        },
        objects={
            ConanRequirement.alias(): ConanRequirement,
            NativeArtifact.alias(): NativeArtifact,
        },
    )
Пример #5
0
def build_file_aliases():
  return BuildFileAliases(
    targets={
      CLibrary.alias(): CLibrary,
      CppLibrary.alias(): CppLibrary,
      ExternalNativeLibrary.alias(): ExternalNativeLibrary,
      PackagedNativeLibrary.alias(): PackagedNativeLibrary,
    },
    objects={
      ConanRequirement.alias(): ConanRequirement,
      NativeArtifact.alias(): NativeArtifact,
    }
  )
Пример #6
0
    def __init__(self,
                 address,
                 payload=None,
                 sources=None,
                 ctypes_native_library=None,
                 strict_deps=None,
                 fatal_warnings=None,
                 compiler_option_sets=None,
                 toolchain_variant=None,
                 **kwargs):

        if not payload:
            payload = Payload()
        sources_field = self.create_sources_field(sources,
                                                  address.spec_path,
                                                  key_arg="sources")
        payload.add_fields({
            "sources":
            sources_field,
            "ctypes_native_library":
            ctypes_native_library,
            "strict_deps":
            PrimitiveField(strict_deps),
            "fatal_warnings":
            PrimitiveField(fatal_warnings),
            "compiler_option_sets":
            PrimitivesSetField(compiler_option_sets),
            "toolchain_variant":
            PrimitiveField(toolchain_variant),
        })

        if ctypes_native_library and not isinstance(ctypes_native_library,
                                                    NativeArtifact):
            raise TargetDefinitionException(
                "Target must provide a valid pants '{}' object. Received an object with type '{}' "
                "and value: {}.".format(
                    NativeArtifact.alias(),
                    type(ctypes_native_library).__name__,
                    ctypes_native_library,
                ))

        super().__init__(address=address, payload=payload, **kwargs)
Пример #7
0
  def __init__(self, address, payload=None, sources=None, ctypes_native_library=None,
               strict_deps=None, fatal_warnings=None, **kwargs):

    if not payload:
      payload = Payload()
    sources_field = self.create_sources_field(sources, address.spec_path, key_arg='sources')
    payload.add_fields({
      'sources': sources_field,
      'ctypes_native_library': ctypes_native_library,
      'strict_deps': PrimitiveField(strict_deps),
      'fatal_warnings': PrimitiveField(fatal_warnings),
    })

    if ctypes_native_library and not isinstance(ctypes_native_library, NativeArtifact):
      raise TargetDefinitionException(
        "Target must provide a valid pants '{}' object. Received an object with type '{}' "
        "and value: {}."
        .format(NativeArtifact.alias(), type(ctypes_native_library).__name__, ctypes_native_library))

    super(NativeLibrary, self).__init__(address=address, payload=payload, **kwargs)