Hi, is anyone aware from kts to groovy translation...
# kotlin-native
s
Hi, is anyone aware from kts to groovy translation? I tried converting kotlin DSL files to Groovy, but it is showing errors? The kts function is as follows:
Copy code
tasks {
    withType<KotlinCompile> {
        kotlinOptions.jdkHome = rootProject.extra["JDK_18"] as String
        kotlinOptions.languageVersion = "1.2"
        kotlinOptions.apiVersion = "1.2"
        kotlinOptions.freeCompilerArgs += listOf("-Xskip-metadata-version-check")
    }

    named<ProcessResources>("processResources") {
        val propertiesToExpand = mapOf("projectVersion" to project.version)
        for ((name, value) in propertiesToExpand) {
            inputs.property(name, value)
        }
        filesMatching("project.properties") {
            expand("projectVersion" to project.version)
        }
    }

    named<Jar>("jar") {
        callGroovy("manifestAttributes", manifest, project)
    }

    named<ValidateTaskProperties>("validateTaskProperties") {
        failOnWarning = true
    }

    named<DokkaTask>("dokka") {
        outputFormat = "markdown"
        includes = listOf("$projectDir/Module.md")
    }
}
I wanted it to convert it Groovy: tasks {
Copy code
withType(KotlinCompile) {
        kotlinOptions.jdkHome = rootProject.ext["JDK_18"] as String
        kotlinOptions.languageVersion = "1.2"
        kotlinOptions.apiVersion = "1.2"
        kotlinOptions.freeCompilerArgs += ["-Xskip-metadata-version-check"]
    }

    processResources {
        val propertiesToExpand = {"projectVersion" = project.version}
        for ((name, value) in propertiesToExpand) {
            inputs.property(name, value)
        }
        filesMatching("project.properties") {
            expand("projectVersion" to project.version)
        }
    }

    jar {
        callGroovy("manifestAttributes", manifest, project)
    }

    validateTaskProperties {
        failOnWarning = true
    }

    dokka {
        outputFormat = "markdown"
        includes = ["$projectDir/Module.md"]
    }
}
n
This isn't the right channel. You will want to post this in the #gradle channel.
s
Yup sorry for that. I did. Thanks for the info 😄