Skip to content

Commit 83c5272

Browse files
committed
Update README
1 parent f253ada commit 83c5272

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ buildscript {
6161
Then you can create a task that compiles `module-info.java` like this:
6262

6363
```kotlin
64-
tasks.create<org.glavo.mic.tasks.CompileModuleInfo>("compileModuleInfo") {
64+
val compileModuleInfo = tasks.create<org.glavo.mic.tasks.CompileModuleInfo>("compileModuleInfo") {
6565
sourceFile.set(file("src/main/module-info.java"))
6666
targetFile.set(buildDir.resolve("classes/java/module-info/module-info.class"))
6767

@@ -71,4 +71,13 @@ tasks.create<org.glavo.mic.tasks.CompileModuleInfo>("compileModuleInfo") {
7171
moduleMainClass = "simple.Main" // Optional
7272

7373
}
74+
```
75+
76+
Then you can include it inside the jar like this:
77+
78+
```kotlin
79+
tasks.jar {
80+
dependsOn(tasks["compileModuleInfo"])
81+
from((tasks["compileModuleInfo"] as org.glavo.mic.tasks.CompileModuleInfo).targetFile)
82+
}
7483
```

0 commit comments

Comments
 (0)