-
-
Save manijshrestha/564177ad61044f3e9b560d01700b0486 to your computer and use it in GitHub Desktop.
Kotlin Multiplatform framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task packForXCode(type: Sync) { | |
final File frameworkDir = new File(buildDir, "xcode-frameworks") | |
final String mode = System.getenv('CONFIGURATION')?.toUpperCase() ?: 'DEBUG' | |
inputs.property "mode", mode | |
dependsOn kotlin.targets.iOS.compilations.main.linkTaskName("FRAMEWORK", mode) | |
from { kotlin.targets.iOS.compilations.main.getBinary("FRAMEWORK", mode).parentFile } | |
into frameworkDir | |
doLast { | |
new File(frameworkDir, 'gradlew').with { | |
text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n" | |
setExecutable(true) | |
} | |
} | |
} | |
tasks.build.dependsOn packForXCode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment