//! `gradle.properties` emitter — configures Gradle toolchain behavior.
//!
//! Emits `gradle.properties` to allow Gradle to auto-detect the host JDK
//! and fall back to auto-downloading from Adoptium when the requested
//! `jvmToolchain(N)` is not available. This prevents build failures on
//! hosts that don't have a specific JDK version installed.

/// Emit `gradle.properties` with toolchain fallback settings.
pub fn emit() -> String {
    r#"# Generated by alef. Do not edit by hand.

# Allow Gradle to auto-detect JDK installations when the requested
# toolchain version is not available. This prevents build failures on
# hosts with only newer or older JDK versions installed.
org.gradle.java.installations.auto-detect=true

# Configure Adoptium (Eclipse Temurin) as the download repository for
# missing JDK toolchains. When jvmToolchain(17) is requested but JDK 17
# is not found locally, Gradle will attempt to download it from this repo.
org.gradle.jvm.toolchain.download.repository=adoptium

# Increase heap for large multi-project builds.
org.gradle.jvmargs=-Xmx4g
"#
    .to_string()
}
