Library

API Documentation:Library

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

A library component that is built by a gradle project.

Properties

PropertyDescription
api
Incubating

Converts this library to a native library requirement that uses the api library linkage.

baseName
Incubating

The name that is used to construct the output file names when building this component.

binaries
Incubating

The binaries that are built for this component. You can use this to configure the binaries for this component.

shared
Incubating

Converts this library to a native library requirement that uses the shared library variant. This is the default.

source
Incubating

The source sets that are used to build this component.

static
Incubating

Converts this library to a native library requirement that uses the static library variant.

Property details

NativeLibraryRequirement api (read-only)

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

Converts this library to a native library requirement that uses the api library linkage.

String baseName

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

The name that is used to construct the output file names when building this component.

DomainObjectSet<NativeBinary> binaries (read-only)

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

The binaries that are built for this component. You can use this to configure the binaries for this component.

NativeLibraryRequirement shared (read-only)

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

Converts this library to a native library requirement that uses the shared library variant. This is the default.

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

The source sets that are used to build this component.

NativeLibraryRequirement static (read-only)

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

Converts this library to a native library requirement that uses the static library variant.

Script blocks

No script blocks

Methods

MethodDescription
source(source)
Incubating

Adds one or more LanguageSourceSets that are used to compile this binary.

targetBuildTypes(platformSelectors)
Incubating

Specifies one or more BuildTypes that this component should be built for.

targetFlavors(flavorSelectors)
Incubating

Specifies one or more Flavors that this component should be built for.

targetPlatforms(platformSelectors)
Incubating

Specifies one or more Platforms that this component should be built for.

Method details

void source(Object source)

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

Adds one or more LanguageSourceSets that are used to compile this binary.

This method accepts the following types:

void targetBuildTypes(Object... platformSelectors)

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

Specifies one or more BuildTypes that this component should be built for.

This method accepts the following types:

  • The String name of a build type.

void targetFlavors(Object... flavorSelectors)

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

Specifies one or more Flavors that this component should be built for.

This method accepts the following types:

  • The String name of the flavor to build.

void targetPlatforms(Object... platformSelectors)

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

Specifies one or more Platforms that this component should be built for.

This method accepts the following types:

  • The String name of the platform to target.