Gradle and Java builds
The CLI controls the MCFPP build. Gradle resolves MNI Java dependencies, compiles Java, and runs tests. mcfpp init demo --mni creates the user configuration.
Project files
| File or directory | Purpose |
|---|---|
mcfpp.toml | Project and MNI configuration |
mcfpp-packages.json | MCFPP and Java dependency declarations |
src/main/java | MNI implementations |
src/test/java | JUnit tests |
.mcfpp/gradle | Gradle project generated by the CLI |
build/.mcfpp/mni | Java build output |
The CLI generates Gradle files when it prepares MNI. Keep custom settings in your project's extension scripts.
Add a Java dependency
This coordinate identifies a public Java library:
mcfpp add --mni org.apache.commons:commons-lang3:3.14.0
mcfpp build
mcfpp testUse a configuration for test dependencies:
mcfpp add --mni org.junit.jupiter:junit-jupiter:5.10.1 --configuration testImplementationConfigure an extension script
mcfpp.toml:
[mni]
enabled = true
repositories = ["https://repo.maven.apache.org/maven2/"]
extensions = ["mni.gradle.kts"]Create mni.gradle.kts in the project root:
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
tasks.withType<Test>().configureEach {
testLogging {
events("passed", "failed", "skipped")
}
}Declare extra Gradle plugins by ID and version in [mni.plugins]. IDEA synchronization reads the source directories and dependencies after extensions apply.
JDK and repeatable builds
MNI builds use JDK 21. The CLI checks MCFPP_JAVA_HOME, JDK21_HOME, JAVA_HOME, and the current Java installation in that order.
Prepare dependencies online before a cached build:
mcfpp install
mcfpp build --locked --offline--locked uses existing valid lockfiles. --offline uses cached Gradle files and dependencies. mcfpp test runs Java tests. src/test/mcfpp is reserved for source tests.