Package: org.gradle.nativeplatform

## [Java] Interface NativeBinarySpec

- org.gradle.api.BuildableComponentSpec

- All Superinterfaces:
    BinarySpec, ModelElement, ComponentSpec, Named, Buildable, BuildableComponentSpec

  Represents a binary artifact that is the result of building a native component.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Tool` | `getAssembler()` The configuration of the assembler used when compiling assembly sources this binary.
    `BuildType` | `getBuildType()` Returns the BuildType used to construct this binary.
    `NativeComponentSpec` | `getComponent()` The component that this binary was built from.
    `PreprocessingTool` | `getCppCompiler()` The configuration of the C++ compiler used when compiling C++ sources for this binary.
    `Flavor` | `getFlavor()` The Flavor that this binary was built with.
    `Collection<NativeDependencySet>` | `getLibs()` The libraries that should be linked into this binary.
    `Tool` | `getLinker()` The configuration of the linker used when linking this binary.
    `PreprocessingTool` | `getObjcCompiler()` The configuration of the Objective-C compiler used when compiling Objective-C sources for this binary.
    `PreprocessingTool` | `getObjcppCompiler()` The configuration of the Objective-C++ compiler used when compiling Objective-C++ sources for this binary.
    `PreprocessingTool` | `getRcCompiler()` The configuration of the Resource compiler used when compiling resources for this binary.
    `Tool` | `getStaticLibArchiver()` The configuration of the static library archiver used when creating this binary.
    `NativePlatform` | `getTargetPlatform()` Returns the NativePlatform that this binary is targeted to run on.
    `NativeToolChain` | `getToolChain()` Returns the NativeToolChain that will be used to build this binary.
    `PreprocessingTool` | `getcCompiler()` The configuration of the C compiler used when compiling C sources for this binary.
    `void` | `lib(Object library)` Adds a library as input to this binary.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface BinarySpec` | `getInputs, getSources, getTasks, isBuildable`
    `interface BuildableComponentSpec` | `builtBy, getBuildTask, hasBuildDependencies, setBuildTask`
    `interface Buildable` | `getBuildDependencies`
    `interface ComponentSpec` | `getProjectPath`
    `interface ModelElement` | `getDisplayName, getName`
    `interface Named` | `getName`

- - ### Method Detail

    - #### public Tool getAssembler()

      The configuration of the assembler used when compiling assembly sources this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'assembler' plugin is applied.

    - #### @Variant public BuildType getBuildType()

      Returns the BuildType used to construct this binary.

    - #### public NativeComponentSpec getComponent()

      The component that this binary was built from.

    - #### public PreprocessingTool getCppCompiler()

      The configuration of the C++ compiler used when compiling C++ sources for this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'cpp' plugin is applied.

    - #### @Variant public Flavor getFlavor()

      The Flavor that this binary was built with.

    - #### public Collection<NativeDependencySet> getLibs()

      The libraries that should be linked into this binary.

    - #### public Tool getLinker()

      The configuration of the linker used when linking this binary. Valid for SharedLibraryBinarySpec and NativeExecutableBinarySpec.

    - #### public PreprocessingTool getObjcCompiler()

      The configuration of the Objective-C compiler used when compiling Objective-C sources for this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'objective-c' plugin is applied.

    - #### public PreprocessingTool getObjcppCompiler()

      The configuration of the Objective-C++ compiler used when compiling Objective-C++ sources for this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'objective-cpp' plugin is applied.

    - #### public PreprocessingTool getRcCompiler()

      The configuration of the Resource compiler used when compiling resources for this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'windows-resources' plugin is applied.

    - #### public Tool getStaticLibArchiver()

      The configuration of the static library archiver used when creating this binary. Valid for StaticLibraryBinarySpec.

    - #### @Variant public NativePlatform getTargetPlatform()

      Returns the NativePlatform that this binary is targeted to run on.

    - #### public NativeToolChain getToolChain()

      Returns the NativeToolChain that will be used to build this binary.

    - #### public PreprocessingTool getcCompiler()

      The configuration of the C compiler used when compiling C sources for this binary. Valid for SharedLibraryBinarySpec, StaticLibraryBinarySpec and NativeExecutableBinarySpec when the 'c' plugin is applied.

    - #### public void lib(Object library)

      Adds a library as input to this binary.

      This method accepts the following types:
      - A NativeLibrarySpec
      - A NativeDependencySet
      - A Map containing the library selector.
      The Map notation supports the following String attributes:
      - project: the path to the project containing the library (optional, defaults to current project)
      - library: the name of the library (required)
      - linkage: the library linkage required ['shared'/'static'] (optional, defaults to 'shared')