Contents

The C++ Language Plugin provides the tasks, configurations and conventions for compiling C++ source files. It’s an implementation language plugin and works in tandem with plugins providing a runtime and/or entry point.

Usage

Example 1. Applying the C++ Language Plugin
build.gradle
plugins {
   id 'dev.nokee.cpp-language'
}
build.gradle.kts
plugins {
   id("dev.nokee.cpp-language")
}
This plugin provides the C++ implementation language capability to a project already providing a runtime and/or entry point, such as the JNI Library Plugin.

Conventions

The C++ Language Plugin adds conventions for sources, shown below.

Project layout

The plugin assumes the project layout shown below. None of these directories needs to exist or have anything in them. The compile tasks will compile whatever it finds and ignore anything missing.

src/main/cpp

C++ source with extension of .cpp, .{cpplower}, .cc or .cxx

src/main/headers

Headers - headers needed to compile the library