api / org.gradle.nativeplatform / NativeBinarySpec

NativeBinarySpec

@Incubating interface NativeBinarySpec : BinarySpec

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

Functions

getAssembler

abstract fun getAssembler(): Tool

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

getBuildType

abstract fun getBuildType(): BuildType

Returns the org.gradle.nativeplatform.BuildType used to construct this binary.

getComponent

abstract fun getComponent(): NativeComponentSpec

The component that this binary was built from.

getCppCompiler

abstract fun getCppCompiler(): PreprocessingTool

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.

getFlavor

abstract fun getFlavor(): Flavor

The org.gradle.nativeplatform.Flavor that this binary was built with.

getLibs

abstract fun getLibs(): MutableCollection<NativeDependencySet>

The libraries that should be linked into this binary.

getLinker

abstract fun getLinker(): Tool

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

getObjcCompiler

abstract fun getObjcCompiler(): PreprocessingTool

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.

getObjcppCompiler

abstract fun getObjcppCompiler(): PreprocessingTool

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.

getRcCompiler

abstract fun getRcCompiler(): PreprocessingTool

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.

getStaticLibArchiver

abstract fun getStaticLibArchiver(): Tool

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

getTargetPlatform

abstract fun getTargetPlatform(): NativePlatform

Returns the org.gradle.nativeplatform.platform.NativePlatform that this binary is targeted to run on.

getToolChain

abstract fun getToolChain(): NativeToolChain

Returns the org.gradle.nativeplatform.toolchain.NativeToolChain that will be used to build this binary.

getcCompiler

abstract fun getcCompiler(): PreprocessingTool

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.

lib

abstract fun lib(library: Any): Unit

Adds a library as input to this binary.

This method accepts the following types:

  • A NativeLibrarySpec
  • A NativeDependencySet
  • A java.util.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')

Inherited Functions

getInputs

abstract fun getInputs(): DomainObjectSet<LanguageSourceSet>

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

getSources

abstract fun getSources(): ModelMap<LanguageSourceSet>

The sources owned by this binary.

getTasks

abstract fun getTasks(): BinaryTasksCollection

The set of tasks associated with this binary.

isBuildable

abstract fun isBuildable(): Boolean

Can this binary be built in the current environment?

Inheritors

NativeExecutableBinarySpec

interface NativeExecutableBinarySpec : NativeBinarySpec, ApplicationBinarySpec

An binary built by Gradle for a native application.

NativeLibraryBinarySpec

interface NativeLibraryBinarySpec : NativeBinarySpec, LibraryBinarySpec

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

NativeTestSuiteBinarySpec

interface NativeTestSuiteBinarySpec : TestSuiteBinarySpec, NativeBinarySpec

An executable which runs a suite of tests.