Added copyFramework()

This commit is contained in:
dankito 2020-10-23 01:28:17 +02:00
parent e43be8f0aa
commit c19603012a
2 changed files with 42 additions and 1 deletions

View File

@ -87,6 +87,26 @@ kotlin {
} }
task copyFramework {
def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
def target = project.findProperty('kotlin.target') ?: 'ios'
def framework = kotlin.targets."$target".binaries.getFramework(buildType)
dependsOn framework.linkTask
doLast {
def srcFile = framework.outputFile
def targetDir = getProperty('configuration.build.dir')
copy {
from srcFile.parent
into targetDir
include "${frameworkName}.framework/**"
include "${frameworkName}.framework.dSYM"
}
}
}
// Task to generate iOS framework for xcode projects. // Task to generate iOS framework for xcode projects.
task packForXcode(type: Sync) { task packForXcode(type: Sync) {

View File

@ -79,3 +79,24 @@ task packForXcode(type: Sync) {
// Run packForXcode when building. // Run packForXcode when building.
tasks.build.dependsOn packForXcode tasks.build.dependsOn packForXcode
task copyFramework {
def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
def target = project.findProperty('kotlin.target') ?: 'ios'
def framework = kotlin.targets."$target".binaries.getFramework(buildType)
dependsOn framework.linkTask
doLast {
def srcFile = framework.outputFile
def targetDir = getProperty('configuration.build.dir')
copy {
from srcFile.parent
into targetDir
include "${frameworkName}.framework/**"
include "${frameworkName}.framework.dSYM"
}
}
}