Skip to content

Commit 04fd7fe

Browse files
committed
Documented examples build
1 parent 30e323c commit 04fd7fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/src/bld/java/com/example/ExampleBuild.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ public ExampleBuild() {
4040
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))
4141
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1)));
4242

43+
// Include the Kotlin source directory when creating or publishing sources Java Archives
4344
jarSourcesOperation().sourceDirectories(new File(srcMainDirectory(), "kotlin"));
4445
}
4546

4647
public static void main(String[] args) {
4748
var level = Level.ALL;
4849
var logger = Logger.getLogger("rife.bld.extension");
4950
var consoleHandler = new ConsoleHandler();
51+
52+
// Enable detailed logging for the Kotlin extension
5053
consoleHandler.setLevel(level);
5154
logger.addHandler(consoleHandler);
5255
logger.setLevel(level);
@@ -56,7 +59,9 @@ public static void main(String[] args) {
5659
}
5760

5861
@BuildCommand(summary = "Compile the Kotlin project")
62+
@Override
5963
public void compile() throws IOException {
64+
// The source code located in src/main/kotlin and src/test/kotlin will be compiled
6065
new CompileKotlinOperation()
6166
.fromProject(this)
6267
.compileOptions(
@@ -72,6 +77,7 @@ public void dokkaGfm() throws ExitStatusException, IOException, InterruptedExcep
7277
new DokkaOperation()
7378
.fromProject(this)
7479
.loggingLevel(LoggingLevel.INFO)
80+
// Create build/dokka/gfm
7581
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "gfm").toFile())
7682
.outputFormat(OutputFormat.MARKDOWN)
7783
.execute();
@@ -82,16 +88,19 @@ public void dokkaHtml() throws ExitStatusException, IOException, InterruptedExce
8288
new DokkaOperation()
8389
.fromProject(this)
8490
.loggingLevel(LoggingLevel.INFO)
91+
// Create build/dokka/html
8592
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "html").toFile())
8693
.outputFormat(OutputFormat.HTML)
8794
.execute();
8895
}
8996

9097
@BuildCommand(summary = "Generates Javadoc for the project")
98+
@Override
9199
public void javadoc() throws ExitStatusException, IOException, InterruptedException {
92100
new DokkaOperation()
93101
.fromProject(this)
94102
.loggingLevel(LoggingLevel.INFO)
103+
// Create build/javadoc
95104
.outputDir(new File(buildDirectory(), "javadoc"))
96105
.outputFormat(OutputFormat.JAVADOC)
97106
.execute();

0 commit comments

Comments
 (0)