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

実践!「みてね」における自動生成活用例

shunsuke sato
September 21, 2020

 実践!「みてね」における自動生成活用例

shunsuke sato

September 21, 2020
Tweet

More Decks by shunsuke sato

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ໊લ: ࠤ౻ढ़ี • TwitterͳͲ: @ushisantoasobu • ॴଐ: ʢגʣϛΫγΟ

    ΈͯͶࣄۀ෦ • ։ൃ: iOSΛϝΠϯʹɺAndroid / Rails ͳͲ • झຯ: αοΧʔʢϑοταϧʣͱ ίʔώʔ
  2. ΞδΣϯμ • ʮࣗಈੜ੒ʯʹڵຯΛ͖͔͚࣋ͬͨͬ • ͜ͷτʔΫͰѻ͏ʮࣗಈੜ੒ʯͱ͸ • ΈͯͶʹ͓͚Δࣗಈੜ੒׆༻ྫ 3ͭ • Sourcery

    / Stencil ͷجຊతͳ࿩ • Sourcery / Stencil ͷTIPS • ࣗಈੜ੒Λ1೥ӡ༻ͯ͠Έͯͷॴײ • ·ͱΊ
  3. 4PVSDFSZ4UFODJMิ଍ • ઌ΄Ͳ͸SourceryͷCLIΛར༻ͯࣗ͠ಈੜ੒Λߦͳ͕ͬͨɺ࣮ࡍʹӡ༻͢Δࡍ͸
 ʮ”Run Script”ʹίϚϯυΛهड़ͯ͠Ϗϧυຖʹ࣮ߦʯͱͳΔ͸ͣ • “sources” / “templates” /

    “output” ͳͲͷҾ਺͸”.sourcery.yml”ʹ·ͱΊΔ͜ͱ͕Ͱ͖Δ • ΈͯͶͰ͸ग़ྗઌ͕ෳ਺ʢΞϓϦ/ςετʣඞཁͷͨΊ”.sourcery.yml”͸࢖͑ͳ͍ • ࢀߟ -> https://github.com/krzysztofzablocki/Sourcery/issues/727
  4. • ࣗಈੜ੒ͷର৅͔Β֎͢ = ର৅ϑΝΠϧΛʮࡉ͔͘ʯద༻͢Δ͜ͱ΋Ͱ͖Δ • બ୒ύλʔϯ • ઐ༻ͷprotocolΛ࡞੒͠ద༻͢ΔʢͦͷprotocolΛࣗಈੜ੒ର৅ͷ໨ҹͱ͢Δʣ • আ֎ύλʔϯ

    • ʢҰൠతͰ͸ͳ͍͕ɺΈͯͶͰ͸ͪ͜ΒͰӡ༻͍ͯ͠Δʣ • আ֎͢Δ class/struct/protocolʢͳͲʣ ໊ΛςϯϓϨʔτϑΝΠϧʹʮϕλॻ͖ʯͯ͠ɺif จͳͲͰআ֎͢Δ ࣗಈੜ੒ΛͲ͜·Ͱ࢓্͛Δ΂͖͔