# NativeLibraryBinarySpec

API Documentation: | `NativeLibraryBinarySpec`

Known Subtypes: |
`SharedLibraryBinarySpec`
`StaticLibraryBinarySpec`

Note: This class is incubating and may change in a future version of Gradle.

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

### Properties

Property | Description
`assembler` | Incubating The configuration of the assembler used when compiling assembly sources this binary. Valid for `SharedLibraryBinarySpec`, `StaticLibraryBinarySpec` and `NativeExecutableBinarySpec` when the 'assembler' plugin is applied.
`buildType` | Incubating The `BuildType` used to construct this binary.
`buildable` | Incubating Can this binary be built in the current environment?
`cCompiler` | Incubating 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.
`component` | Incubating The component that this binary was built from.
`cppCompiler` | Incubating 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.
`flavor` | Incubating The `Flavor` that this binary was built with.
`inputs` | Incubating Returns all inputs of the binary. This includes source sets owned by the binary, and other source sets created elsewhere (e.g. inherited from the binary's component).
`libs` | Incubating The libraries that should be linked into this binary.
`linker` | Incubating The configuration of the linker used when linking this binary. Valid for `SharedLibraryBinarySpec` and `NativeExecutableBinarySpec`.
`objcCompiler` | Incubating 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.
`objcppCompiler` | Incubating 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.
`rcCompiler` | Incubating 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.
`sources` | Incubating The sources owned by this binary.
`staticLibArchiver` | Incubating The configuration of the static library archiver used when creating this binary. Valid for `StaticLibraryBinarySpec`.
`targetPlatform` | Incubating The `NativePlatform` that this binary is targeted to run on.
`tasks` | Incubating The set of tasks associated with this binary.
`toolChain` | Incubating The `NativeToolChain` that will be used to build this binary.

### Methods

Method | Description
`lib(library)` | Incubating Adds a library as input to this binary.

### Script blocks

No script blocks

### Property details

#### `Tool` `assembler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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

#### `BuildType` `buildType` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The `BuildType` used to construct this binary.

#### `boolean` `buildable` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Can this binary be built in the current environment?

#### `PreprocessingTool` `cCompiler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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.

#### `NativeComponentSpec` `component` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The component that this binary was built from.

#### `PreprocessingTool` `cppCompiler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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.

#### `Flavor` `flavor` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The `Flavor` that this binary was built with.

#### ``DomainObjectSet`<`LanguageSourceSet`>` `inputs` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns all inputs of the binary. This includes source sets owned by the binary, and other source sets created elsewhere (e.g. inherited from the binary's component).

#### ``Collection`<`NativeDependencySet`>` `libs` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The libraries that should be linked into this binary.

#### `Tool` `linker` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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

#### `PreprocessingTool` `objcCompiler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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.

#### `PreprocessingTool` `objcppCompiler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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.

#### `PreprocessingTool` `rcCompiler` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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.

#### ``ModelMap`<`LanguageSourceSet`>` `sources` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The sources owned by this binary.

#### `Tool` `staticLibArchiver` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

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

#### `NativePlatform` `targetPlatform` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The `NativePlatform` that this binary is targeted to run on.

#### `BinaryTasksCollection` `tasks` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The set of tasks associated with this binary.

#### `NativeToolChain` `toolChain` (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The `NativeToolChain` that will be used to build this binary.

### Method details

#### `void` `lib`(`Object` library)

Note: This method is incubating and may change in a future version of Gradle.

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')