在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):AlecStrong/kotlin-native-cocoapods开源软件地址(OpenSource Url):https://github.com/AlecStrong/kotlin-native-cocoapods开源编程语言(OpenSource Language):Kotlin 94.8%开源软件介绍(OpenSource Introduction):DEPRECATED!Please use the official cocoapods support which is included in the regular kotlin multiplatform gradle plugin. kotlin-native-cocoapodsA Gradle plugin which handles creating a podspec for a local Kotlin/Native project. The generated podspec properly integrates your project with cocoapods, and release/debug fat binaries will be created and linked when you compile the xcode project. Using this plugin means you do not need to manually set up xcode or the Setupbuildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.alecstrong:cocoapods-gradle-plugin:0.3.3'
}
}
// Cocoapods plugin is only applicable for multiplatform projects with Kotlin/Native
apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply plugin: 'com.alecstrong.cocoapods'
// Optional configuration of plugin.
cocoapods {
version = "1.0.0-LOCAL" // Defaults to "1.0.0-LOCAL"
homepage = www.mywebsite.com // Default to empty
deploymentTarget = "10.0" // Defaults to "10.0"
authors = "Ben Asher" // Defaults to empty
license = "..." // Defaults to empty
summary = "..." // Defaults to empty
daemon = true // Defaults to false
wrapperExecutableName = "gradlew" // Defaults to "gradlew"
wrapperAdditionalArgs = "..." // Defaults to empty
} From this the plugin will generate a task
The above command is assuming a module structure where Then in your target 'MyProject' do
...
pod 'common', :path => 'Code/Kotlin/common'
end And that's it! From your iOS project you will be able to Custom TargetThe plugin also includes a custom target which sets up the source sets: kotlin {
targetForCocoapods('ios')
sourceSets {
iosMain { ... }
iosTest { ... }
}
} Doing this will also generate a Custom ArchitecturesBy default this packages a fat binary with x64, arm64, and arm32 architectures inside. To override this behavior pass a list of presets into the kotlin {
targetForCocoapods([presets.iosArm64, presets.iosX64], 'ios')
} Its also possible to use the full 1.3.20 DSL to customize the targets: kotlin {
targetForCocoapods([presets.iosArm64, presets.iosX64], 'ios') {
compilations.main.extraOpts '-module-name', 'CP'
}
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论