From c19603012a8c63bd5375da4bd2d8e3cea26195d3 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 23 Oct 2020 01:28:17 +0200 Subject: [PATCH] Added copyFramework() --- common/build.gradle | 20 +++++++++++++++++++ ui/BankingUiNativeIntegration/build.gradle | 23 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/common/build.gradle b/common/build.gradle index 69a64e34..f0db888e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -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) { diff --git a/ui/BankingUiNativeIntegration/build.gradle b/ui/BankingUiNativeIntegration/build.gradle index 27a39781..1d21b247 100644 --- a/ui/BankingUiNativeIntegration/build.gradle +++ b/ui/BankingUiNativeIntegration/build.gradle @@ -78,4 +78,25 @@ task packForXcode(type: Sync) { } // Run packForXcode when building. -tasks.build.dependsOn packForXcode \ No newline at end of file +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" + } + } +} \ No newline at end of file