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.c-language'
}
build.gradle.kts
plugins {
    id("dev.nokee.c-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/c

C source with extension of .c

src/main/headers

Headers - headers needed to compile the library