{"id":129796,"date":"2018-12-06T12:21:06","date_gmt":"2018-12-06T04:21:06","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=129796"},"modified":"2018-12-03T17:23:32","modified_gmt":"2018-12-03T09:23:32","slug":"gradle-5-0-java-11","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/gradle-5-0-java-11.html","title":{"rendered":"Gradle 5.0\u53d1\u5e03"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nJava\u5f00\u53d1\u4eba\u5458\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528JDK 11\u8fd0\u884cGradle\u6784\u5efa\u3002\u6d41\u884c\u7684\u5f00\u6e90\u6784\u5efa\u81ea\u52a8\u5316\u5de5\u5177(Gradle 5.0)\u7684\u6700\u65b0\u91cc\u7a0b\u7891\u7248\u672c\u8fd8\u9644\u5e26\u4e86\u4e00\u4e2a\u53ef\u7528\u4e8e\u751f\u4ea7\u7684Kotlin DSL\u3001\u4f9d\u8d56\u7248\u672c\u6821\u51c6\u548c\u4efb\u52a1\u8d85\u65f6\uff0c\u4ee5\u53ca\u957f\u5217\u8868\u589e\u5f3a\u529f\u80fd\u548c\u5347\u7ea7\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5728\u8fd9\u4e2a\u7248\u672c\u4e2d\uff0c\u771f\u6b63\u5438\u5f15\u773c\u7403\u7684\u662f\u5305\u542bKotlin DSL 1.0\u3002Kotlin DSL(\u7279\u5b9a\u4e8e\u57df\u7684\u8bed\u8a00)\u901a\u8fc7\u5728\u53d7\u652f\u6301\u7684ide\u4e2d\u201c\u589e\u5f3a\u7684\u7f16\u8f91\u4f53\u9a8c\u201d(\u6839\u636eGradle Kotlin DSL\u5165\u95e8)\u63d0\u4f9b\u4e86\u4f20\u7edfGroovy DSL(\u6700\u521d\u662f\u5728Gradle\u6700\u65e9\u7684\u7248\u672c\u4e2d\u5f15\u5165\u7684)\u7684\u66ff\u4ee3\u8bed\u6cd5\u3002Kotlin DSL\u76ee\u524d\u5b8c\u5168\u652f\u6301\u4e24\u4e2aide: IntelliJ IDEA\u548cAndroid Studio\uff0c\u4f46\u662f\u5176\u4ed6\u96c6\u6210\u5f00\u53d1\u73af\u5883\u53ef\u4ee5\u5bfc\u5165\u5e76\u4f7f\u7528\u57fa\u4e8eKotlin-DSL\u7684\u6784\u5efa\u3002<\/p>\n

\"\"<\/p>\n

Gradle\u56e2\u961f\u5728\u4e00\u7bc7\u535a\u5ba2\u6587\u7ae0<\/a>\u4e2d\u8bf4\uff0c\u4f7f\u7528Kotlin\u7f16\u5199\u6784\u5efa\u903b\u8f91\u201c\u5728ide\u4e2d\u63d0\u4f9b\u4e86\u663e\u8457\u7684\u989d\u5916\u7f16\u8f91\u5e2e\u52a9\uff0c\u5305\u62ec:\u6539\u8fdb\u7684\u5b8c\u6210\u3001\u9519\u8bef\u7a81\u51fa\u663e\u793a\u548c\u91cd\u6784\u5de5\u5177\u2026\u2026\u201d\u201c\u5982\u679c\u60a8\u66f4\u559c\u6b22Groovy\u7684\u7075\u6d3b\u6027\u548c\u52a8\u6001\u7279\u6027\uff0c\u90a3\u5b8c\u5168\u53ef\u4ee5\u2014\u2014Groovy DSL\u4e0d\u4f1a\u88ab\u5f03\u7528\uff0c\u201d\u4ed6\u4eec\u8865\u5145\u8bf4\u3002<\/p>\n

\u5728Gradle 5.0\u4e2d\u5f15\u5165\u7684\u4f9d\u8d56\u9879\u7248\u672c\u5bf9\u9f50\u4e5f\u662f\u8fd9\u4e2a\u516c\u544a\u4e2d\u7684\u4e00\u4e2a\u5f15\u4eba\u6ce8\u76ee\u7684\u5730\u65b9\u3002\u8be5\u529f\u80fd\u5141\u8bb8\u5c5e\u4e8e\u540c\u4e00\u903b\u8f91\u201c\u5e73\u53f0\u201d\u6216\u201c\u4e00\u8d77\u5de5\u4f5c\u201d\u7684\u6a21\u5757\u96c6\u7684\u4e0d\u540c\u6a21\u5757\uff0c\u56e0\u4e3a\u5b83\u4eec\u662f\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u53d1\u5e03\u7684\uff0c\u6216\u8005\u56e0\u4e3a\u6d4b\u8bd5\u663e\u793a\u5b83\u4eec\u662f\u4e00\u8d77\u5de5\u4f5c\u7684\uff0cGradle Docs\u9875\u9762<\/a>\u5bf9\u6b64\u8fdb\u884c\u4e86\u89e3\u91ca\u3002<\/p>\n

\u4f46\u662fJava jocks\u5c06\u5f88\u9ad8\u5174\u5728\u8fd9\u4e2a\u7248\u672c\u4e2d\u4e86\u89e3JDK\u652f\u6301\u3002\u6700\u521d\u7684Gradle\u63d2\u4ef6\u4e13\u6ce8\u4e8eJava\u3001Groovy\u548cScala\uff0c\u5b83\u4ecd\u7136\u88ab\u8ba4\u4e3a\u662fJVM\u7684\u4e3b\u8981\u6784\u5efa\u7cfb\u7edf\u3002<\/p>\n

Gradle\u4e00\u76f4\u652f\u6301\u8de8\u591a\u79cd\u8bed\u8a00\u548c\u5e73\u53f0\u7684\u6784\u5efa\u81ea\u52a8\u5316\uff0c\u4eceGroovy\u3001Java\u548cScala\u5f00\u59cb\uff0c\u73b0\u5728\u5305\u62ecAndroid\u548cC\/C++\u3002\u8be5\u7cfb\u7edf\u4e0e\u51e0\u4e2a\u5f00\u53d1\u5de5\u5177\u548c\u6301\u7eed\u96c6\u6210\u670d\u52a1\u5668\u7d27\u5bc6\u96c6\u6210\uff0c\u5305\u62ecEclipse\u3001IntelliJ\u548cJenkins\u3002<\/p>\n

Gradle\u56e2\u961f\u4e3a\u9700\u8981\u5c06\u8f83\u65e7\u7684Gradle 4.x\u7248\u672c\u8fc1\u79fb\u5230Gradle 5.0\u7684\u5f00\u53d1\u4eba\u5458\u53d1\u5e03\u4e86\u8be6\u7ec6\u6307\u5357<\/a>\u3002 \uff08\u201c\u8bf7\u8bb0\u4f4f\uff0c\u5bf9\u4e8e\u4efb\u4f55\u4ece4\u5f00\u59cb\u7684\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\uff0c\u90fd\u6709\u4e00\u4e9b\u91cd\u5927\u7684\u53d8\u5316\u548c\u9700\u8981\u8003\u8651\u7684\u95ee\u9898\uff0c\u201d\u4ed6\u4eec\u5199\u9053\u3002\uff09GitHub\u4e0a\u8fd8\u6709\u4e00\u4e2a\u5b89\u88c5\u6307\u5357<\/a>\uff0c\u4f9b\u60f3\u8981\u5f00\u59cb\u4f7f\u7528Gradle\u7684\u65b0\u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u8fd9\u4e2a\u7248\u672c\u4e2d\uff0c\u771f\u6b63\u5438\u5f15\u773c\u7403\u7684\u662f\u5305\u542bKotlin DSL 1.0\u3002Kotlin DSL(\u7279\u5b9a\u4e8e\u57df\u7684\u8bed\u8a00)\u901a\u8fc7\u5728\u53d7 […]<\/p>\n","protected":false},"author":63,"featured_media":129799,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-129796","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=129796"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129796\/revisions"}],"predecessor-version":[{"id":129905,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129796\/revisions\/129905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/129799"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=129796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=129796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=129796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}