{"id":134,"date":"2023-02-18T19:38:38","date_gmt":"2023-02-18T11:38:38","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=134"},"modified":"2023-02-26T15:05:27","modified_gmt":"2023-02-26T07:05:27","slug":"gradle-include-thirdpart-library-and-compile-provided-usage","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/18\/gradle-include-thirdpart-library-and-compile-provided-usage\/","title":{"rendered":"Gradle\u5f15\u7528\u7b2c\u4e09\u65b9\u5e93\u603b\u7ed3\uff0c\u4ee5\u53cacompile\u3001provided\u4f7f\u7528"},"content":{"rendered":"<ul>\n<li>compile\uff1a\u7f16\u8bd1\u671f\u4f9d\u8d56\u3001\u8fd0\u884c\u671f\u4f9d\u8d56<\/li>\n<li>provided\/providedCompile\uff1a\u7f16\u8bd1\u671f\u4f9d\u8d56\u3001\u8fd0\u884c\u671f\u4e0d\u4f9d\u8d56\uff0c\u4e0d\u4f1a\u6253\u5305\u8fdbapk\u6216aar<\/li>\n<\/ul>\n<p>\u65b9\u5f0f1\uff1a\u5f15\u7528\u8fdc\u7a0b\u4ed3\u5e93\u5305\u540d+\u7248\u672c<\/p>\n<pre><code>compile &#039;com.android.support:support-v4:23.3.0&#039;<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u65b9\u5f0f2\uff1a\u5f15\u7528libs\u4e0b\u6240\u6709jar\u5305<\/p>\n<pre><code>compile fileTree(dir: &#039;libs&#039;, include: [&#039;*.jar&#039;])<\/code><\/pre>\n<p>\u65b9\u5f0f3\uff1a\u5f15\u7528\u5355\u4e2ajar\u5305<\/p>\n<pre><code>compile files(&#039;libs\/fastjson-1.1.53.android.jar&#039;)<\/code><\/pre>\n<p>\u65b9\u5f0f4\uff1a\u5f15\u7528\u5355\u4e2aaar\u6587\u4ef6\uff0c\u6ce8\u610f\u5e76\u4e0d\u80fd\u50cf\u65b9\u5f0f2\u90a3\u6837\u81ea\u52a8\u5f15\u7528\u5168\u90e8\u7684aar\uff0c\u800c\u9700\u8981\u5bf9\u6bcf\u4e2aaar\u5206\u522b\u8fdb\u884c\u5f15\u7528<\/p>\n<pre><code>compile(name: &#039;aar_file_name&#039;, ext: &#039;aar&#039;)<\/code><\/pre>\n<p>\u65b9\u5f0f5\uff1a\u5f15\u7528Module<\/p>\n<pre><code>compile project(&#039;:module&#039;)<\/code><\/pre>\n<p>\u65b9\u5f0f6\uff1a\u4ec5\u4ec5\u5728\u7f16\u8bd1\u65f6\u4f7f\u7528\uff0c\u4f46\u6700\u7ec8\u4e0d\u4f1a\u88ab\u7f16\u8bd1\u5230apk\u6216aar\u4e2d<\/p>\n<pre><code>provided files(&#039;libs\/glide-3.7.0.jar&#039;)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>compile\uff1a\u7f16\u8bd1\u671f\u4f9d\u8d56\u3001\u8fd0\u884c\u671f\u4f9d\u8d56 provided\/providedCompile\uff1a\u7f16\u8bd1\u671f\u4f9d\u8d56\u3001\u8fd0\u884c\u671f\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[64],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-android-build","tag-gradle"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}