Save 37% off PRO during our Black Friday Sale! »

conanが使いづらいのでpoacを作っている話 / conan-to-poac

conanが使いづらいのでpoacを作っている話 / conan-to-poac

Learn Languages 2018 in ODC でのプレゼン資料です

C62fe8f90cf120dcc0a894461990e3e2?s=128

Ken Matsui

August 26, 2018
Tweet

Transcript

  1. DPOBO͕࢖͍ʹ͍͘ͷͰQPBDΛ࡞ͬͨ࿩ NBULFO

  2. DPOBO͕࢖͍ʹ͍͘ͷͰQPBDΛ࡞ͬͨ࿩ NBULFO ࡞͍ͬͯΔ

  3. ࣗݾ঺հ ▸ দҪɹ݈ʢ,FO.BUTVJʣ ▸ ໋ཱؗେֶ৘ใཧ޻ֶ෦̎೥ੜ ▸ ೥౓ະ౿ΫϦΤʔλ ▸ $ &MJYJS

    &MN
  4. ▸ /PEFKTͷOQN΍ZBSO ▸ &MJYJSͷIFY ▸ $ ͷDPOBO ▸ 3VTUͷDBSHP ▸

    )BTLFMMͷDBCBM ৭ʑͳύοέʔδϚωʔδϟ
  5. $ ͷDPOBO͸࢖͍ͮΒ͍

  6. ύοέʔδͷࢦఆ͕Θ͔ΓͮΒ͍ DPOBOpMFUYU <SFRVJSFT>
 )FMMP!NFNTIBSEUFTUJOH ύοέʔδ໊ όʔδϣϯ Ϣʔβ໊ νϟϯωϧ!?

  7. ύοέʔδͷݕࡧํ๏͕Θ͔ΓͮΒ͍ url= h)ps:/ /api.bintray.com/conan/conan/conan-transit conan remote add conan-transit $url conan

    search "Hello" -r=conan-transit
  8. Ͳ͜Λݕࡧ͢Ε͹Α͍ͷ͔Θ͔ΓͮΒ͍

  9. Ͳ͜Λݕࡧ͢Ε͹Α͍ͷ͔Θ͔ΓͮΒ͍

  10. Ͳ͜Λݕࡧ͢Ε͹Α͍ͷ͔Θ͔ΓͮΒ͍

  11. Ͳ͜Λݕࡧ͢Ε͹Α͍ͷ͔Θ͔ΓͮΒ͍

  12. Ͳ͜Λݕࡧ͢Ε͹Α͍ͷ͔Θ͔ΓͮΒ͍

  13. ϓϩδΣΫτ໊ poac

  14. ϓϩδΣΫτ໊ͷ༝དྷᶃ Plus of Cͷpocͩͱ঎ඪ͕େྔʹऔΒΕ͍ͯͯා͔ͬͨ

  15. ϓϩδΣΫτ໊ͷ༝དྷᶃ ൃԻʹӨڹΛ༩͑ͳͦ͞͏ͳ฼ԻΛೖΕͯɼpoacʹͨ͠

  16. ϓϩδΣΫτ໊ͷ༝དྷᶄ ίϚϯυͱͯ͠Կ౓΋ೖྗ͢ΔͷͰɼ
 ଧͪ΍͘͢ɼยख͚ͩʹෛ୲͕ภΒͳ͍ࣄΛॏࢹ ྲྀΕΔΑ͏ʹଧͭ͜ͱ͕Մೳ P, O ӈख A, C ࠨख

  17. ϓϩδΣΫτ໊ͷ༝དྷᶅ /p/͸࠷΋໌Δ͍ҹ৅Λ༩͑Δ ग़యɿ೔ຊޠΦϊϚτϖͷجຊײ৘࣍ݩͱ೔ຊޠԻײૉͷجຊϨϕϧʹ͍ͭͯ (http://hdl.handle.net/10112/12311)

  18. ϓϩδΣΫτ໊ͷ༝དྷᶅ /p/͸࠷΋ॊΒ͔͍ҹ৅Λ༩͑Δ ग़యɿ೔ຊޠΦϊϚτϖͷجຊײ৘࣍ݩͱ೔ຊޠԻײૉͷجຊϨϕϧʹ͍ͭͯ (http://hdl.handle.net/10112/12311)

  19. ެ։ GitHub: https://github.com/poacpm Website: https://poac.pm (pm = package manager)

  20. શମͷ֓ཁ Elm Frontend Elixir Backend 4FSWFS Kubernetes AWS EC2 $MJFOU

    C++
  21. ΫϥΠΞϯταΠυ main.cpp inference.hpp install.hpp exception [ subcmd or option?, arg2,

    arg3 ] subcmd or option? -> install [ arg2, arg3 ] $ poac install arg2 arg3
  22. ΫϥΠΞϯταΠυͷਪ࿦աఔ template <typename S, typename OpTypeE, typename VS, typename =

    std::enable_if_t<std::is_rvalue_reference_v<VS&&>> > auto _apply(S&& func, const OpTypeE& cmd, VS&& arg) { return branch(std::move(func), cmd, std::move(arg)); } template <typename S, typename VS, typename = std::enable_if_t<std::is_rvalue_reference_v<VS&&>> > std::string apply(S&& func, const S& cmd, VS&& arg) { namespace except = core::exception; if (auto itr = subcmd_map.find(cmd); itr != subcmd_map.end()) return _apply(std::move(func), itr->second, std::move(arg)); else if (itr = option_map.find(cmd); itr != option_map.end()) return _apply(std::move(func), itr->second, std::move(arg)); else throw except::invalid_first_arg("Invalid argument"); }
  23. ΫϥΠΞϯταΠυͷਪ࿦աఔ // Create function pointer table: { &func<0>, &func<1>, ...

    } // Execute function: &func<idx>[idx]() template <size_t... Is, typename VS, typename = std::enable_if_t<std::is_rvalue_reference_v<VS&&>>> static auto execute(std::index_sequence<Is...>, int idx, VS&& vs) { // Return ""(empty string) because match the type to the other two functions. return make_array({ +[](VS&& vs){ return (op_type_list_t::at_t<Is>()(std::move(vs)), ""); }... })[idx] (std::move(vs)); } template <size_t... Is> static auto summary(std::index_sequence<Is...>, int idx) { return make_array({ +[]{ return op_type_list_t::at_t<Is>::summary(); }... })[idx](); } template <size_t... Is> static auto options(std::index_sequence<Is...>, int idx) { return make_array({ +[]{ return op_type_list_t::at_t<Is>::options(); }... })[idx](); }
  24. αϒίϚϯυ ▸ JOTUBMM   ύοέʔδΛΠϯετʔϧ ▸ VOJOTUBMM  

    ύοέʔδΛΞϯΠϯετʔϧ ▸ TFBSDI   ύοέʔδΛݕࡧ ▸ JOJU    QPBDZNMϑΝΠϧΛੜ੒ ▸ OFX   ϓϩδΣΫτςϯϓϨʔτΛੜ੒ ▸ QVCMJTI   ࣗ࡞ύοέʔδΛެ։ ▸ MPHJO   ϩάΠϯ͢Δ ▸ SPPU   QPBDͷΠϯετʔϧઌύεΛදࣔ ▸ DBDIF   DBDIFͷૢ࡞Λߦ͏ ▸ VQEBUF   ύοέʔδΛΞοϓσʔτ ▸ EPD    υΩϡϝϯτΛੜ੒ ▸ CVJME   Ϗϧυ͢Δ ▸ SVO    Ϗϧυͱ࣮ߦΛߦ͏ ͕࣌ؒ
 ͋Ε͹
 ࣮૷༧ఆ
  25. αϒίϚϯυ ▸ ύοέʔδͷΠϯετʔϧઌΛϓϩδΣΫτ͚ͩʹہॴԽͰ͖Δʢ؀ ڥΛԚ͞ͳ͍ʣɼ΋͘͠͸άϩʔόϧԽ΋Ͱ͖Δ ▸ $ ͷ௕೥ͷૉ੖Β͍͠ࢿ࢈ΛҰͭͷج൫ͰవΊ্͛Δ͜ͱ͕Ͱ͖Δ ▸ ΧϨϯτσΟϨΫτϦʹґଘؔ܎ΛవΊΔͱɼΠϯΫϧʔυαʔνύ εͳͲΛࢦఆ͢Δඞཁ͕͋Δ͕ɼͦΕΒΛϥοϐϯάͯ͠Ϣʔβ͕ҙ

    ࣝ͢Δ͜ͱͳ͘ɼϏϧυ΍࣮ߦͳͲΛϚωδϝϯτͯ͘͠ΕΔ ▸ DBDIFΛར༻͢Δ͜ͱͰɼߴ଎ͳΠϯετʔϧɾϏϧυ͕Ͱ͖Δ ▸ υΩϡϝϯτͷੜ੒Λߦͳͬͯ͘ΕΔ
  26. αʔόʔαΠυ Website্ͰͰ͖Δ͜ͱɾ࣮ݱ͢Δ͜ͱ ▸ (JU)VCΞΧ΢ϯτΛ࢖༻ͯ͠ΞΧ΢ϯτ࡞੒ ͱϩάΠϯ ▸ ύοέʔδͷݕࡧɾμ΢ϯϩʔυ ▸ $-*༻ͷ"DDFTTUPLFOͷੜ੒ ▸

    υΩϡϝϯτͷӾཡ
  27. ࠷ऴ໨ඪ ▸ $ Ͱͷ։ൃʹ͓͍͔ͯܽͤͳ͍
 ύοέʔδϚωʔδϟ ▸ υΩϡϝϯτΛಡ·ͳͯ͘΋࢖༻Ͱ͖Δ௚ײతͳ ΠϯλϑΣʔε ▸ ՄೳͰ͋Ε͹ɼೖ໳ॻͰऔΓѻΘΕΔਫ४ͷ


    ҆ఆੑɾ৴པੑ