Added copyFramework()
This commit is contained in:
parent
e43be8f0aa
commit
c19603012a
|
@ -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 packForXcode(type: Sync) {
|
||||
|
||||
|
|
|
@ -78,4 +78,25 @@ task packForXcode(type: Sync) {
|
|||
}
|
||||
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue