@@ -40,13 +40,16 @@ public ExampleBuild() {
40
40
.include (dependency ("org.junit.jupiter" , "junit-jupiter" , version (5 , 10 , 1 )))
41
41
.include (dependency ("org.junit.platform" , "junit-platform-console-standalone" , version (1 , 10 , 1 )));
42
42
43
+ // Include the Kotlin source directory when creating or publishing sources Java Archives
43
44
jarSourcesOperation ().sourceDirectories (new File (srcMainDirectory (), "kotlin" ));
44
45
}
45
46
46
47
public static void main (String [] args ) {
47
48
var level = Level .ALL ;
48
49
var logger = Logger .getLogger ("rife.bld.extension" );
49
50
var consoleHandler = new ConsoleHandler ();
51
+
52
+ // Enable detailed logging for the Kotlin extension
50
53
consoleHandler .setLevel (level );
51
54
logger .addHandler (consoleHandler );
52
55
logger .setLevel (level );
@@ -56,7 +59,9 @@ public static void main(String[] args) {
56
59
}
57
60
58
61
@ BuildCommand (summary = "Compile the Kotlin project" )
62
+ @ Override
59
63
public void compile () throws IOException {
64
+ // The source code located in src/main/kotlin and src/test/kotlin will be compiled
60
65
new CompileKotlinOperation ()
61
66
.fromProject (this )
62
67
.compileOptions (
@@ -72,6 +77,7 @@ public void dokkaGfm() throws ExitStatusException, IOException, InterruptedExcep
72
77
new DokkaOperation ()
73
78
.fromProject (this )
74
79
.loggingLevel (LoggingLevel .INFO )
80
+ // Create build/dokka/gfm
75
81
.outputDir (Path .of (buildDirectory ().getAbsolutePath (), "dokka" , "gfm" ).toFile ())
76
82
.outputFormat (OutputFormat .MARKDOWN )
77
83
.execute ();
@@ -82,16 +88,19 @@ public void dokkaHtml() throws ExitStatusException, IOException, InterruptedExce
82
88
new DokkaOperation ()
83
89
.fromProject (this )
84
90
.loggingLevel (LoggingLevel .INFO )
91
+ // Create build/dokka/html
85
92
.outputDir (Path .of (buildDirectory ().getAbsolutePath (), "dokka" , "html" ).toFile ())
86
93
.outputFormat (OutputFormat .HTML )
87
94
.execute ();
88
95
}
89
96
90
97
@ BuildCommand (summary = "Generates Javadoc for the project" )
98
+ @ Override
91
99
public void javadoc () throws ExitStatusException , IOException , InterruptedException {
92
100
new DokkaOperation ()
93
101
.fromProject (this )
94
102
.loggingLevel (LoggingLevel .INFO )
103
+ // Create build/javadoc
95
104
.outputDir (new File (buildDirectory (), "javadoc" ))
96
105
.outputFormat (OutputFormat .JAVADOC )
97
106
.execute ();
0 commit comments