Hi guys, I trying to convert this task to the `kts...
# gradle
g
Hi guys, I trying to convert this task to the
kts
mode but I’m having a hard time.
Copy code
task copyFramework {
    def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
    def target = project.findProperty('kotlin.target') ?: 'ios'
    dependsOn kotlin.targets."$target".compilations.main.linkTaskName('FRAMEWORK', buildType)

    doLast {
        def srcFile = kotlin.targets."$target".compilations.main.getBinary('FRAMEWORK', buildType)
        def targetDir = getProperty('configuration.build.dir')
        copy {
            from srcFile.parent
            into targetDir
            include 'app.framework/**'
            include 'app.framework.dSYM'
        }
    }
}
I was trying something like:
Copy code
task("copyFramework") {
	val buildType = project.findProperty("kotlin.build.type") ?: "DEBUG"
	val target = project.findProperty("kotlin.target") ?: "ios"
	dependsOn(kotlin.targets["$target"].compilations["main"].linkTaskName("FRAMEWORK", buildType))

	doLast {
		val srcFile = kotlin.targets["$target"].compilations["main"].getBinary("FRAMEWORK", buildType)
		val targetDir = System.getProperty("configuration.build.dir")
		copy {
			from(srcFile.parent) {
				into(targetDir)
				include("app.framework/**")
				include("app.framework.dSYM")
			}
		}
	}
}
but the linkTaskName is not being recognized. Could you help me to translate this task?