bdeg
01/27/2019, 4:45 PM//For ios target (emulator or real device)
final def iosTarget = System.getenv("SDK_NAME")?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
fromPreset(iosTarget, 'ios') {
compilations.main.outputKinds('FRAMEWORK')
}
in the new 1.3.20 mpp plugin ?
i tried:
def buildForDevice = project.findProperty("device")?.toBoolean() ?: false
(buildForDevice) ? iosArm64("ios") : iosX64("ios")
targets.compilations["ios"] {
compilations.main.outputKinds("framework")
binaries {
framework {
// Disable bitcode embedding for the simulator build.
if (!buildForDevice) {
embedBitcode("disable")
}
}
}
}
also:
def buildForDevice = project.findProperty("device")?.toBoolean() ?: false
def ios = (buildForDevice) ? iosArm64("ios") : iosX64("ios")
ios {
compilations.main.outputKinds("framework")
binaries {
framework {
// Disable bitcode embedding for the simulator build.
if (!buildForDevice) {
embedBitcode("disable")
}
}
}
}
Dominaezzz
01/27/2019, 4:48 PMbdeg
01/27/2019, 4:49 PMDominaezzz
01/27/2019, 4:50 PMbdeg
01/27/2019, 4:50 PMNo signature of method: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget.call() is applicable for argument types: (build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure10) values: [build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure10@2df85bc]
Possible solutions: wait(), any(), wait(long), each(groovy.lang.Closure), any(groovy.lang.Closure), collect()
Dominaezzz
01/27/2019, 4:51 PMios {
to ios.apply {
.bdeg
01/27/2019, 4:51 PMDominaezzz
01/27/2019, 4:52 PMbdeg
01/27/2019, 4:52 PMNo signature of method: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget.apply() is applicable for argument types: (build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure10) values: [build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure10@1e3f6442]
Possible solutions: any(), any(groovy.lang.Closure), every(), split(groovy.lang.Closure), every(groovy.lang.Closure)
Dominaezzz
01/27/2019, 4:55 PMios {
to configure([ios]) {
.bdeg
01/27/2019, 4:59 PMDominaezzz
01/27/2019, 5:01 PM*.kts
.bdeg
01/27/2019, 5:05 PMjvm("backend").compilations {
main {
defaultSourceSet {
dependencies {
api(kotlin('stdlib-jdk8'))
implementation(SpringDependencies.springBootStarter + ":${Configurations.springBootFrameworkVersion}")
}
}
}
test {
defaultSourceSet {
dependencies {
implementation(kotlin('test'))
implementation(kotlin('test-junit'))
implementation(SpringDependencies.springBootStarterTest + ":${Configurations.springBootFrameworkVersion}")
}
}
}
}
should work on groovy and kotlin right ?
but nope...
No signature of method: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinOnlyTarget.compilations() is applicable for argument types: (build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure11$_closure18) values: [build_1g1pdz1t0dhhtv87rzvo3hutq$_run_closure3$_closure11$_closure18@5a25c7bc]
Possible solutions: getCompilations()
strangly if i look at the source code there's a compilation property:
https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/kotlinTargets.ktDominaezzz
01/27/2019, 5:08 PM.compilations
to ``, main
to compilations["main"]
and test
to compilations["test"]
.*.kts
as the IDE is a bit more helpful with these things in kotlin.bdeg
01/27/2019, 5:20 PMDominaezzz
01/27/2019, 5:21 PMcoletz
01/27/2019, 5:59 PMapp
module (while I clearly see it)bdeg
01/27/2019, 6:03 PMrusshwolf
01/27/2019, 8:57 PMtargetFromPreset()
to get pretty much the equivalent of the old syntax:
kotlin {
final def iosTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
targetFromPreset(iosTarget, "ios") {
binaries {
framework("Shared")
}
}
...
}