{"id":44361,"date":"2020-07-06T23:01:39","date_gmt":"2020-07-06T14:01:39","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=44361"},"modified":"2020-07-07T11:34:24","modified_gmt":"2020-07-07T02:34:24","slug":"hilt-9-creating-extensions","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=44361","title":{"rendered":"[Hilt] 9. Creating Extensions"},"content":{"rendered":"<p><a href=\"https:\/\/dagger.dev\/hilt\/creating-extensions\">https:\/\/dagger.dev\/hilt\/creating-extensions<\/a><\/p>\n<hr \/>\n<p><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-236x300.png\" alt=\"\" width=\"236\" height=\"300\" class=\"aligncenter size-medium wp-image-44317\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-236x300.png 236w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-768x975.png 768w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-807x1024.png 807w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c.png 1145w\" sizes=\"(max-width: 236px) 100vw, 236px\" \/><\/a><\/p>\n<h2>\ubaa8\ub4c8\uacfc Entry point \uc0dd\uc131\ud558\uae30<\/h2>\n<p>Hilt\ub294 \ud45c\uc900 \ucef4\ud3ec\ub10c\ud2b8\uc640 \ud074\ub798\uc2a4 \uacbd\ub85c\uc5d0\uc11c \ubaa8\ub4c8 \ubc0f Entry point\uac00 \uc120\ud0dd\ub418\ub294 \ubc29\uc2dd\uc73c\ub85c \uc778\ud574 Hilt\uc640 \ud1b5\ud569\ud558\ub824\ub294 \ud655\uc7a5(extension) \ub610\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc5d0 \ud2b9\ud788 \uc801\ud569\ud558\ub2e4.<\/p>\n<p>\uadf8\ub7ec\ub098, @InstallIn \ubaa8\ub4c8\uc744 \uc0dd\uc131\ud558\ub294 \ud655\uc7a5 \ub610\ub294 Entry point\ub294 Hilt\uac00 \uc62c\ubc14\ub974\uac8c \uc120\ud0dd\ud560 \uc218 \uc788\ub3c4\ub85d \uc0dd\uc131\ub41c \ud074\ub798\uc2a4\uc5d0 \ucd94\uac00 \uc815\ubcf4\ub97c \ub123\uc5b4\uc57c \ud55c\ub2e4.<\/p>\n<h3>@GeneratesRootInput<\/h3>\n<p>Hilt\ub294 \ud074\ub798\uc2a4 \uacbd\ub85c\uc5d0\uc11c \ubaa8\ub4c8\uacfc Entry point\ub97c \uc554\uc2dc\uc801\uc73c\ub85c \uc120\ud0dd\ud558\uae30 \ub54c\ubb38\uc5d0, Dagger \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc0dd\uc131\ud558\uae30 \uc804\uc5d0 \ud655\uc7a5\uc774 \ucf54\ub4dc\ub97c \uc0dd\uc131 \ud560 \ub54c\uae4c\uc9c0 \uae30\ub2e4\ub824\uc57c \ud558\ub294\uc9c0 \uc54c\uae30 \uc704\ud55c \ucd94\uac00 \uc815\ubcf4\uac00 \ud544\uc694\ud558\ub2e4. \uc774\uac83\uc740 \ucf54\ub4dc \uc0dd\uc131\uc744 \ud2b8\ub9ac\uac70\ud558\ub294 \uc5b4\ub178\ud14c\uc774\uc158 \ud074\ub798\uc2a4\uc5d0 @GeneratesRootInput\uc744 \ub2ec\uc544\uc11c \uc218\ud589\ub41c\ub2e4.<\/p>\n<p>\uc608\ub97c \ub4e4\uc5b4, \ub204\uad70\uac00 @GenerateMyModule \uc5b4\ub178\ud14c\uc774\uc158\uc744 \uc0ac\uc6a9\ud560 \ub54c\ub9c8\ub2e4 \ud655\uc7a5\uc5d0\uc11c \ubaa8\ub4c8\uc744 \uc0dd\uc131 \ud55c \uacbd\uc6b0, @GenerateMyModule \uc5b4\ub178\ud14c\uc774\uc158\uc744 \ub2e4\uc74c\uacfc \uac19\uc774 \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre class=\"lang: decode:true \">@GeneratesRootInput annotation class GenerateMyModule {}<\/pre>\n<p>\uc5b4\ub178\ud14c\uc774\uc158\uc744 \ub2ec\uc9c0 \uc54a\ub294\ub2e4\uace0 \ud574\uc11c, Hilt\uac00 \ubc18\ub4dc\uc2dc \ubaa8\ub4c8\uc744 \ub193\uce58\ub294 \uac83\uc740 \uc544\ub2c8\ub2e4. \ub2e4\ub978 \ud56d\ubaa9\uc774 \uc0dd\uc131\ub418\uae30\ub97c \uae30\ub2e4\ub9ac\ub294 \uacbd\uc6b0\uc5d0\ub3c4 \uc5ec\uc804\ud788 \ubaa8\ub4c8\uc744 \ucc59\uae38\uc218 \uc788\uae30 \ub54c\ubb38\uc774\ub2e4. \uc774\uac83\ub3c4 \ubb3c\ub860 \uc2e0\ub8b0\ud560 \uc218 \uc5c6\ub2e4.<\/p>\n<h3>@OriginatingElement<\/h3>\n<p>\ud14c\uc2a4\ud2b8 \ud398\uc774\uc9c0\uc5d0 \uc124\uba85 \ub41c\ub300\ub85c \ud14c\uc2a4\ud2b8\uc758 \ub0b4\uc7ac\ub41c \ubaa8\ub4c8\uc740 \ud14c\uc2a4\ud2b8\ub97c \ub458\ub7ec\uc2f8\ub294 \uacf3\uc5d0 \uaca9\ub9ac\ub41c\ub2e4. \uadf8\ub7ec\ub098 \ud14c\uc2a4\ud2b8\ub97c \uc704\ud574 \uc0dd\uc131 \ub41c \ubaa8\ub4c8\uc740 \ub0b4\uc7ac\ub41c \ud074\ub798\uc2a4\ub85c \uc0dd\uc131 \ub420 \uc218 \uc5c6\ub2e4. \uc774\ub97c \uc62c\ubc14\ub974\uac8c \uc9c0\uc6d0\ud558\ub824\uba74 \uc0dd\uc131\ub41c \ucf54\ub4dc\uc5d0 \ucd5c\uc0c1\uc704 \ud074\ub798\uc2a4\uac00 \uac12\uc778 @OriginatingElement \uc5b4\ub178\ud14c\uc774\uc158\uc744 \ub2ec\uc544\uc57c \ud55c\ub2e4. \ub0b4\uc7ac\ub41c \uacc4\uce35\uc774 \ub9ce\uc744 \uc218 \uc788\uc73c\ubbc0\ub85c \uc774 \ud074\ub798\uc2a4\ub294 \ud56d\uc0c1 \ud074\ub798\uc2a4\uc640 \ub3d9\uc77c\ud558\uc9c4 \uc54a\ub2e4.<\/p>\n<p>\uc608\ub97c \ub4e4\uc5b4, \ud655\uc7a5\uc740 \ub2e4\uc74c \ucf54\ub4dc\uc5d0 \uc758\ud574 \ud2b8\ub9ac\uac70 \ub418\uace0 FooTest_FooModule\uc774\ub77c\ub294 \ubaa8\ub4c8\uc744 \uc0dd\uc131\ud55c\ub2e4\uace0 \uac00\uc815\ud558\uc790.<\/p>\n<pre class=\"lang: decode:true \">@HiltAndroidTest\r\nclass FooTest {\r\n    @GenerateMyModule\r\n    val foo: Foo = Foo()\r\n    ...\r\n}<\/pre>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc0dd\uc131\ub41c FooTest_FooModule\uc5d0 \ub2e4\uc74c\uacfc \uac19\uc774 \uc5b4\ub178\ud14c\uc774\uc158\uc744 \ub2ec\uc544\uc57c \ud55c\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang: decode:true\">@HiltAndroidTest\r\nclass FooTest {\r\n    @GenerateMyModule\r\n    val foo: Foo = Foo()\r\n    ...\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dagger.dev\/hilt\/creating-extensions \ubaa8\ub4c8\uacfc Entry point \uc0dd\uc131\ud558\uae30 Hilt\ub294 \ud45c\uc900 \ucef4\ud3ec\ub10c\ud2b8\uc640 \ud074\ub798\uc2a4 \uacbd\ub85c\uc5d0\uc11c \ubaa8\ub4c8 \ubc0f Entry point\uac00 \uc120\ud0dd\ub418\ub294 \ubc29\uc2dd\uc73c\ub85c \uc778\ud574 Hilt\uc640 \ud1b5\ud569\ud558\ub824\ub294 \ud655\uc7a5(extension) \ub610\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc5d0 \ud2b9\ud788 \uc801\ud569\ud558\ub2e4. \uadf8\ub7ec\ub098, @InstallIn \ubaa8\ub4c8\uc744 \uc0dd\uc131\ud558\ub294 \ud655\uc7a5 \ub610\ub294 Entry point\ub294 Hilt\uac00 \uc62c\ubc14\ub974\uac8c \uc120\ud0dd\ud560 \uc218 \uc788\ub3c4\ub85d \uc0dd\uc131\ub41c \ud074\ub798\uc2a4\uc5d0 \ucd94\uac00 \uc815\ubcf4\ub97c \ub123\uc5b4\uc57c \ud55c\ub2e4. @GeneratesRootInput Hilt\ub294 \ud074\ub798\uc2a4 \uacbd\ub85c\uc5d0\uc11c \ubaa8\ub4c8\uacfc Entry point\ub97c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[28],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44361"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44361"}],"version-history":[{"count":2,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44361\/revisions"}],"predecessor-version":[{"id":44397,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44361\/revisions\/44397"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}