GarouDan
02/09/2019, 8:25 PMtask 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'
}
}
}
the correct translation of this:
task("copyFramework") {
val buildType = (project.findProperty("kotlin.build.type") ?: "DEBUG").toString()
val target = project.findProperty("kotlin.target") ?: "ios"
dependsOn((kotlin.targets["$target"].compilations["main"] as KotlinNativeCompilation).linkTaskName("FRAMEWORK", buildType))
doLast {
val srcFile = (kotlin.targets["$target"].compilations["main"] as KotlinNativeCompilation).getBinary("FRAMEWORK", buildType)
val targetDir = System.getProperty("configuration.build.dir")
copy {
from(srcFile.parent) {
into(targetDir)
include("main.framework/**")
include("main.framework.dSYM")
}
}
}
}