{"id":3033,"date":"2021-01-06T11:25:48","date_gmt":"2021-01-06T03:25:48","guid":{"rendered":"http:\/\/122.152.205.50\/wordpress\/?p=3033"},"modified":"2021-01-09T13:28:50","modified_gmt":"2021-01-09T05:28:50","slug":"%e8%87%aa%e5%ae%9a%e4%b9%89gradle%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033","title":{"rendered":"\u81ea\u5b9a\u4e49gradle\u63d2\u4ef6"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_16 counter-hierarchy counter-decimal ez-toc-grey\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#%E4%B8%80%E3%80%81%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" title=\"\u4e00\u3001\u53c2\u8003\u8d44\u6599\">\u4e00\u3001\u53c2\u8003\u8d44\u6599<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#%E4%BA%8C%E3%80%81%E6%AD%A5%E9%AA%A4\" title=\"\u4e8c\u3001\u6b65\u9aa4\">\u4e8c\u3001\u6b65\u9aa4<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#1%E6%96%B0%E5%BB%BA%E6%8F%92%E4%BB%B6%E7%B1%BB\" title=\"1.\u65b0\u5efa\u63d2\u4ef6\u7c7b\">1.\u65b0\u5efa\u63d2\u4ef6\u7c7b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#2%E6%96%B0%E5%BB%BA%E6%8F%92%E4%BB%B6%E7%B1%BB%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6\" title=\"2.\u65b0\u5efa\u63d2\u4ef6\u7c7b\u7684\u914d\u7f6e\u6587\u4ef6\">2.\u65b0\u5efa\u63d2\u4ef6\u7c7b\u7684\u914d\u7f6e\u6587\u4ef6<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#3%E5%8F%91%E5%B8%83%E6%8F%92%E4%BB%B6\" title=\"3.\u53d1\u5e03\u63d2\u4ef6\">3.\u53d1\u5e03\u63d2\u4ef6<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=3033\/#4%E5%BC%95%E7%94%A8%E6%8F%92%E4%BB%B6\" title=\"4.\u5f15\u7528\u63d2\u4ef6\">4.\u5f15\u7528\u63d2\u4ef6<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/span>\u4e00\u3001\u53c2\u8003\u8d44\u6599<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/weixin_37292229\/article\/details\/77196808\">https:\/\/blog.csdn.net\/weixin_37292229\/article\/details\/77196808<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.cnblogs.com\/tony-yang-flutter\/p\/12528673.html\">https:\/\/www.cnblogs.com\/tony-yang-flutter\/p\/12528673.html<\/a>\uff08\u5341\u5206\u8be6\u7ec6\uff09<\/p>\n\n\n\n<h2 id=\"mce_7\"><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81%E6%AD%A5%E9%AA%A4\"><\/span>\u4e8c\u3001\u6b65\u9aa4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3><span class=\"ez-toc-section\" id=\"1%E6%96%B0%E5%BB%BA%E6%8F%92%E4%BB%B6%E7%B1%BB\"><\/span>1.\u65b0\u5efa\u63d2\u4ef6\u7c7b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u65b0\u5efaandroid module\uff0c\u65b0\u5efa\/src\/main\/groovy\u76ee\u5f55\uff0c\u5e76\u5728\u5176\u4e0b\u521b\u5efa\u5305\u540d\uff0c\u521b\u5efagroovy\u7c7b\uff0c\u5b9e\u73b0Plugin\u63a5\u53e3\u3002\u8fd9\u91cc\u7684Project\u5373\u6307\u5f15\u5165\u6b64\u63d2\u4ef6\u7684gradle\u6240\u5c5e\u7684module\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\n    void apply(Project project) {\n    \/\/gradle\u8bed\u6cd5\u5c3d\u60c5\u7684\u5199\u4ee3\u7801\n}<\/code><\/pre>\n\n\n\n<h3><span class=\"ez-toc-section\" id=\"2%E6%96%B0%E5%BB%BA%E6%8F%92%E4%BB%B6%E7%B1%BB%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6\"><\/span>2.\u65b0\u5efa\u63d2\u4ef6\u7c7b\u7684\u914d\u7f6e\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u65b0\u5efa \\src\\main\\resources\\META-INF\\gradle-plugins\u76ee\u5f55\uff0c\u521b\u5efapluginName.properties\u6587\u4ef6\uff0c\u5199\u5165\u63d2\u4ef6\u7c7b\u7684\u5168\u7c7b\u540d\u3002\u8fd9\u4e2a pluginName \u5c31\u662f\u7528\u6237\u4f7f\u7528\u8fd9\u4e2a\u63d2\u4ef6\u7684\u65f6\u5019\uff0c\u5728gradle \u91ccapply plugin: ' pluginName '\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>implementation-class=com.szlanyou.router.plugin.MergeKeysPlugin<\/code><\/pre>\n\n\n\n<h3 id=\"mce_19\"><span class=\"ez-toc-section\" id=\"3%E5%8F%91%E5%B8%83%E6%8F%92%E4%BB%B6\"><\/span>3.\u53d1\u5e03\u63d2\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u901a\u8fc7maven\u63d2\u4ef6\u5c06\u63d2\u4ef6\u53d1\u5e03\u5230maven\u4ed3\u5e93\u3002<\/p>\n\n\n\n<h3 id=\"mce_20\"><span class=\"ez-toc-section\" id=\"4%E5%BC%95%E7%94%A8%E6%8F%92%E4%BB%B6\"><\/span>4.\u5f15\u7528\u63d2\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u7684gradle\u91cc\u5f15\u7528<\/p>\n\n\n<p>classpath 'com.szlanyou.lyrouter:libMergeKeysPlugin:0.0.8'<\/p>\n\n\n\n<p>\u5728\u4f7f\u7528\u63d2\u4ef6\u7684\u7ec4\u4ef6\u7684gradle\u91cc<\/p>\n\n\n<p>apply plugin: 'mergekeys'<\/p>\n\n\n\n<p><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"3033\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55 \u4e00\u3001\u53c2\u8003\u8d44\u6599\u4e8c\u3001\u6b65\u9aa41.\u65b0\u5efa\u63d2\u4ef6\u7c7b2.\u65b0\u5efa\u63d2\u4ef6\u7c7b\u7684\u914d\u7f6e\u6587\u4ef63.\u53d1\u5e03\u63d2\u4ef64.\u5f15\u7528\u63d2\u4ef6 \u4e00\u3001\u53c2\u8003\u8d44 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[56],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/3033"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3033"}],"version-history":[{"count":25,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/3033\/revisions"}],"predecessor-version":[{"id":3058,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/3033\/revisions\/3058"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3033"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}