# gradle

Jolan Rensen [JB]

01/21/2023, 3:25 PM
Hi everyone! I was looking for a way to be able to change KDocs at compile-time such that changes appear in the sources.jar as well as potentially a javadoc.jar or HTML Dokka site. Existing solutions only worked for the latter and since there exists no such thing as a kdoc.jar, changed documentation doesn't always (correctly) show up when a user is working with your open source library. Introducing my KDoc / JavaDoc Preprocessor Gradle Plugin! This plugin acts as a preprocessor on your sources, allowing you to create new sources from your own with modified KDoc/JavaDocs. The plugin contains a couple of default processors, but is also extensible to include your own! Examples include: •
tag to include other comments into your KDoc / JavaDoc, see @include Processor (
) •
tag to include code samples into your KDoc / JavaDoc (
) • A processor that removes all KDoc / JavaDoc comments (
) • A processor that adds a
/** TODO */
comment wherever there is no KDoc / JavaDoc comment (
) • A processor that makes all KDoc / JavaDoc comments uppercase (try and make this for fun!) • The sky is the limit :) Note that this first release is still an early Alpha, but I'm welcome to feedback, bugs, your own processors and whatnot 🙂