use crate::core::config::ResolvedCrateConfig;
use crate::core::template_versions;
pub(super) fn emit_gradle_build(config: &ResolvedCrateConfig) -> String {
let crate_name = &config.name;
let kotlin_version = template_versions::maven::KOTLIN_JVM_PLUGIN;
let marker = crate::core::hash::SELF_MARKING_HEADER_LINE;
format!(
r#"{marker}
// To build for a different host triple, replace `linuxX64()` with
// `macosX64()` or `macosArm64()` and update the linkerOpts path accordingly.
plugins {{
kotlin("multiplatform") version "{kotlin_version}"
}}
kotlin {{
linuxX64 {{
compilations["main"].cinterops {{
val {crate_name} by creating {{
defFile = project.file("{crate_name}.def")
}}
}}
binaries {{
sharedLib()
}}
}}
}}
"#
)
}