ExternalNativeBuild

public interface ExternalNativeBuild


DSL object to configure external native builds using CMake or ndk-build

android {
externalNativeBuild {
// Encapsulates your CMake build configurations.
// For ndk-build, instead use the ndkBuild block.
cmake {
// Specifies a path to your CMake build script that's
// relative to the build.gradle file.
path "CMakeLists.txt"
}
}
}

To learn more about including external native builds to your Android Studio projects, read Add C and C++ Code to Your Project

Summary

Public methods

abstract void
cmake(
    @ExtensionFunctionType @NonNull Function1<@NonNull CmakeUnit> action
)

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

abstract @NonNull Cmake

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

abstract @NonNull Map<@NonNull String, @NonNull Object>

Additional per module experimental properties for C and C++.

abstract @NonNull NdkBuild

Per module settings, such as the path to Android.mk, for an external ndk-build project.

abstract void
ndkBuild(
    @ExtensionFunctionType @NonNull Function1<@NonNull NdkBuildUnit> action
)

Per module settings, such as the path to Android.mk, for an external ndk-build project.

Public methods

cmake

abstract void cmake(
    @ExtensionFunctionType @NonNull Function1<@NonNull CmakeUnit> action
)

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

For more information about the properties you can configure in this block, see Cmake.

getCmake

abstract @NonNull Cmake getCmake()

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

For more information about the properties you can configure in this block, see Cmake.

getExperimentalProperties

@Incubating
abstract @NonNull Map<@NonNull String, @NonNull ObjectgetExperimentalProperties()

Additional per module experimental properties for C and C++.

getNdkBuild

abstract @NonNull NdkBuild getNdkBuild()

Per module settings, such as the path to Android.mk, for an external ndk-build project.

For more information about the properties you can configure in this block, see NdkBuild.

ndkBuild

abstract void ndkBuild(
    @ExtensionFunctionType @NonNull Function1<@NonNull NdkBuildUnit> action
)

Per module settings, such as the path to Android.mk, for an external ndk-build project.

For more information about the properties you can configure in this block, see NdkBuild.