Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Androidエンジニア目線のKMM / iOSエンジニア目線のKMM

Androidエンジニア目線のKMM / iOSエンジニア目線のKMM

watanave

May 19, 2021
Tweet

More Decks by watanave

Other Decks in Programming

Transcript

  1. ϥΠϒϥϦબఆ͸৻ॏʹ w 🙅+BWB੡ϥΠϒϥϦ͸࢖͑ͳ͍ w %BHHFSˠ,PJO ,PEFJO w 3FUSP fi Uˠ,UPS

    w 3PPNˠ4RMEFMJHIU w IUUQTHJUIVCDPN""LJSB,PUMJO.VMUJQMBUGPSN-JCSBSJFT
  2. ,PUMJOͱ4XJGU͸ࣅͯΔʁ WBM⁶MFU GVOD⁶GVO 7PJE⁶6OJU QSPUPDPM⁶JOUFSGBDF TXJUDI⁶XIFO 
 FOVN⁶TFBMEDMBTTʁ ͋Δఔ౓ͷֶशίετ͸ඞཁ͔΋ fun

    test(str: String?) { str?.count() // ·͘͞͠OptionalνΣΠϯʂ str!!.count() // ڧ੍Unwra p if (str == null) retur n // ͜͜͸OptionalνΣΠϯ͍Βͳ͍ͷ⁉ str.count( ) } Ұݟɺҙຯෆ໌ͳεϚʔτΩϟετ
  3. (SBEMFͱ͍͏ϏϧυγεςϜ val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =

    if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true ) ::iosArm6 4 els e ::iosX6 4 iosTarget("ios") { binaries { framework { baseName = "shared " } } } ,..ͷϞδϡʔϧ⁶9DPEFͷλʔήοτʁʁʁ
  4. ,PUMJOίʔυΛͲ͏΍࣮ͬͯߦ͢Δʁ w GSBNFXPSLΛJNQPSU͢Δ IUUQTLPUMJOMBOHPSHEPDTNPCJMFJOUFHSBUFJOFYJTUJOHBQQIUNMDPOOFDUUIFGSBNFXPSLUPZPVSJPTQSPKFDU val packForXcode by tasks.creating(Sync::class) { group

    = "build " val mode = System.getenv("CONFIGURATION") ?: "DEBUG " val targetName = "ios " val framework = kotlin.targets.getByName<KotlinNative > inputs.property("mode", mode ) dependsOn(framework.linkTask ) val targetDir = File(buildDir, "xcode-frameworks" ) from({ framework.outputDirectory } ) into(targetDir ) }
  5. ·ͱΊ w "OESPJEΤϯδχΞࢹ఺Ͱ͸ w ,..͸ϚϧνϞδϡʔϧϓϩδΣΫτ w ϥΠϒϥϦબఆͱίϧʔνϯ͸ؾΛ഑Δ΂͠ w J04ΤϯδχΞ w

    ,PUMJO(SBEMFͷֶशίετ͸͋Δ w ͦ͜͸"OESPJEΤϯδχΞʹ೚ͤΔͱ͍͏બ୒ࢶ΋͋Δ w ,PUMJOͷίʔυ͸0CK$ޓ׵ w J04 ,PUMJO/BUJWF ͚ͩϏϧυෆՄɾίʔυิ׬ෆೳ͸ͨ·ʹ͋Δʁ