# StaticLibraryBinarySpec

API Documentation: | `StaticLibraryBinarySpec`

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

A static library binary built by Gradle for a native library.

### 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.
`buildDependencies` | Returns a dependency which contains the tasks which build this artifact. All `Buildable` implementations must ensure that the returned dependency object is live, so that it tracks changes to the dependencies of this buildable.
`buildTask` | Incubating The 'lifecycle' task associated with the construction of this element.
`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.
`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.
`source` | Deprecated Incubating The source sets used to compile this binary.
`staticLibArchiver` | Incubating The configuration of the static library archiver used when creating this binary. Valid for `StaticLibraryBinarySpec`.
`staticLibraryFile` | Incubating The static library file.
`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
`builtBy(tasks)` | Incubating Adds a task that is required for the construction of this element. A task added this way is then added as a dependency of the associated lifecycle task.
`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.

#### `TaskDependency` `buildDependencies` (read-only)

Returns a dependency which contains the tasks which build this artifact. All `Buildable` implementations must ensure that the returned dependency object is live, so that it tracks changes to the dependencies of this buildable.

#### `Task` `buildTask`

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

The 'lifecycle' task associated with the construction of this element.

#### `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.

#### ``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.

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

Note: This property is deprecated and will be removed in the next major version of Gradle.

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

The source sets used to compile 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`.

#### `File` `staticLibraryFile`

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

The static library file.

#### `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` `builtBy`(``Object`...` tasks)

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

Adds a task that is required for the construction of this element. A task added this way is then added as a dependency of the associated lifecycle task.

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