Custom Gradle module in mill.build #6038
-
|
Hello! I have a mill project, and a subproject of it which is being build by gradle. I'm realizing that it's not a perfect approach, but the subproject is in Kotlin and has Springboot dependencies, and I couldn't make mill build it correctly. Currently its compilation is implemented by an ugly hack using But it lacks testing stuff and all other mill benefits. I'm wondering, what would be a best approach to handle such subproject? Maybe you have some examples of custom modules for Gradle? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
We don't have examples embedding Gradle, so I can't directly point you to one. May I ask, why you can't migrate the sub-project to Mill? Maybe, converting the project with
Since you posted your "hack", let me point out some potential issues. Since tasks are cached, you also should capture anything that may lead to an outdated cache. E.g. you could create a def gradleSources = Task.Sources(
"build.gradle",
"src/main/java" // or whatever your sources are
... // any other paths, that will end up in the compilation
)
def compile = Task {
gradleSources() // depend on it to properly re-compile when these change
or.proc(".gradlew", ....
val dummy = Task.dest / "dummy"
os.write(dummy, "")
val classes = PathRef(moduleDir / "target/classes").withRevalidateOnce
CompilationResult(dummyFile, classes)
} |
Beta Was this translation helpful? Give feedback.
Java + Spring Boot
Kotlin + Spring Boot
Open issues / PRs