{"id":320271,"date":"2021-03-25T15:04:07","date_gmt":"2021-03-25T15:04:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320271"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320271","title":{"rendered":"\u0421\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Gradle \u0434\u043b\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u043f\u0438\u0448\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 Android, \u0432 \u043c\u0438\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 Gradle \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Gradle \u0441 \u0442\u0435\u043c\u0438, \u0443 \u043a\u043e\u0433\u043e \u043d\u0435\u0442 \u0447\u0451\u0442\u043a\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u043f\u0438\u0441\u0430\u0442\u044c build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rl\/lg\/nu\/rllgnup8zmby1tee7kxzsirglaa.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Gradle \u043f\u043e \u043d\u0430\u0438\u0442\u0438\u044e \u0438 \u043d\u0435 \u0438\u0437\u0443\u0447\u0430\u044e\u0442 \u0446\u0435\u043b\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0410 \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 build-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 Stack Overflow. \u0412\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 Gradle, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u044f\u0442\u0438 \u043b\u0435\u0442 \u043d\u0430 \u0430\u0443\u0442\u0441\u043e\u0440\u0441\u0435, \u044f \u0432\u0438\u0434\u0435\u043b \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0418 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443, \u0433\u0434\u0435-\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u042f \u043f\u0440\u043e\u0432\u0435\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0443 \u0438 \u0440\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e Gradle \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u0438\u0445 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043c\u0438\u0442\u0430\u043f\u043e\u0432. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u044d\u0442\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u0432 \u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"605c54d595bc5d2dedbee1e1\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/605c54d595bc5d2dedbee1e1\"><\/iframe><\/div>\n<p>  <\/p>\n<h1 id=\"nebolshoy-offtop-dlya-teh-komu-sovsem-nichego-ne-ponyatno-v-gradle-skriptah\">\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0444\u0444\u0442\u043e\u043f \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0432 Gradle-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445<\/h1>\n<p>  <\/p>\n<p>\u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 Android-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u044e\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0433\u043e\u0434\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Gradle. \u0418 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u044f \u0431\u044b\u043b \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0438\u0445. \u041d\u043e \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u0441\u0451 \u0436\u0435 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Gradle, \u0447\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0430\u0442\u044b\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u2014 \u044d\u0442\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043b\u044e\u0434\u044f\u043c, \u0442\u043e \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b <a href=\"https:\/\/www.youtube.com\/watch?v=WOBok2u-SL8\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Gradle \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/a> \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043c\u0435. \u0422\u0430\u043a \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 \u043c\u0438\u0442\u0430\u043f \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p><em>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0441\u043e\u0432\u0435\u0442\u0430\u043c.<br \/>  <\/em><\/p>\n<p>  <\/p>\n<h1 id=\"1-ne-redaktiruyte-gradle-skripty-cherez-ide\">#1 \u041d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 Gradle-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0447\u0435\u0440\u0435\u0437 IDE<\/h1>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jb\/ov\/2f\/jbov2fk8l4nrgch0f9cbfrqx-vg.png\" alt=\"Project structure\"><\/p>\n<p>  <\/p>\n<p>Android studio \u0443\u043c\u0435\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 build-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0410 \u043f\u0440\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 Gradle-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 IDE \u043d\u0430\u043c \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u043c\u0435\u043d\u044e &quot;File -&gt; Project structure&#8230;&quot;. \u0418 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0432\u043e\u0435\u0439 \u043a\u0430\u0440\u044c\u0435\u0440\u044b \u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u044d\u0442\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: <strong>IDE \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0447\u0435\u0441\u0442\u043d\u0443\u044e \u0444\u0430\u0437\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Gradle \u0438 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a-\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/strong>. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0447\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043f\u0435\u0440\u0435\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u0443.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0439 \u0441\u043e\u0432\u0435\u0442: \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0447\u0435\u0440\u0435\u0437 IDE, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h1 id=\"2-obraschayte-vnimanie-na-soglashenie-po-imenovaniyu-moduley\">#2 \u041e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h1>\n<p>  <\/p>\n<p>\u0412 Gradle \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u043c\u043e\u0434\u0443\u043b\u044f) \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f <code>name<\/code> \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <code>Project<\/code> \u0438\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u043b\u0435\u0436\u0438\u0442. \u0412 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044f \u0432\u0438\u0434\u0435\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 camel- \u0438\u043b\u0438 snake- \u043a\u0435\u0439\u0441\u0435: <code>MyAwesomeModule<\/code>, <code>my_awesome_module<\/code>. \u041d\u043e \u0435\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0438\u0435\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043e\u0431 \u0438\u043c\u0435\u043d\u0430\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439? \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Gradle \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0430\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442. \u041d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e <strong>\u043f\u0440\u043e\u0435\u043a\u0442\u044b Gradle \u043f\u0440\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 Maven \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c Maven<\/strong>. \u0418 \u0443 Maven \u0435\u0441\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043c\u0432\u043e\u043b <code>-<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f: <code>my-awesome-module<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"3-chto-vybrat-kotlin-vs-groovy\">#3 \u0427\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c: Kotlin vs Groovy<\/h1>\n<p>  <\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 Gradle \u0434\u043b\u044f DSL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u044f\u0437\u044b\u043a Groovy, \u043d\u043e \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Kotlin. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0447\u0442\u043e \u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u0418 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u044f \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Kotlin, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u0440\u0430\u0434\u0438 build-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u044f\u0437\u044b\u043a \u2014 Groovy. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e Android \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 DSL \u043d\u0430 Kotlin \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u043d\u0438\u0436\u0430\u0435\u0442 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432 Gradle. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0443 build-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 Kotlin \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 IDE \u0441 \u0430\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u043c, \u043d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043e\u043d\u0430 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0438\u043d\u0443\u0441\u0430 Kotlin \u044f \u0431\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 Groovy, \u0438 \u0434\u043b\u044f \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441\u0442\u0430\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 build-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u043d\u0430 Groovy, \u0442\u043e \u043c\u043e\u0433\u0443 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 Kotlin, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Kotlin, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<h1 id=\"4-kak-propisyvat-zavisimosti-v-mnogomodulnyh-proektah\">#4 \u041a\u0430\u043a \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y4\/w4\/vo\/y4w4vob2ps1lwvduhboid8h3f5i.png\" alt=\"Project structure\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f apk, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 feature-\u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. feature-\u043c\u043e\u0434\u0443\u043b\u0438, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0447\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430? \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432. \u041e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Gradle \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b, \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0442\u0430\u043a \u0447\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 (\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/docs.gradle.org\/current\/dsl\/org.gradle.api.artifacts.ResolutionStrategy.html\">resolution strategy<\/a>).<\/p>\n<p>  <\/p>\n<p>\u041d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0432\u0435\u0440\u0441\u0438\u0439 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/platforms.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Gradle<\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0440\u044e\u043a: \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0433\u0434\u0435-\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0438\u043c \u0438\u0437 build-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0422\u0443\u0442 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"java-platform-plugin\">Java platform plugin<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Gradle \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438. \u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_platform_plugin.html\">java platform plugin<\/a>. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y4\/6c\/km\/y46ckmreocnydbi051aihyfm-uo.png\" alt=\"Java platform plugin\"><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u0435 platform-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 maven \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0438\u043d\u0443\u0441\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043c\u0430\u0436\u043e\u0440\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0447\u0430\u0441\u0442\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0443 \u043a \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <\/p>\n<h2 id=\"opisanie-zavisimostey-v-extra-properties\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 extra properties<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0445\u0440\u0430\u043d\u044f\u0442 \u0432 extra properties \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0432\u0441\u0435\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 <a href=\"https:\/\/github.com\/material-components\/material-components-android\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u043e\u0442 Google<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u043e\u0442 \u043a\u0443\u0441\u043e\u043a build-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Google, \u0433\u0434\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>compatibility<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ext {     compileSdkVersion = 29     minSdkVersion = 14     targetSdkVersion = 29      androidXVersions = [             annotation: '1.0.1',             appCompat: '1.1.0'       \/\/ ...     ] } \/**  * Return the module dependency for the given compatibility library name.  *\/ def compatibility(name) {   switch (name) {     case &quot;annotation&quot;:       return &quot;androidx.annotation:annotation:${androidXVersions.annotation}&quot;     case &quot;appcompat&quot;:       return &quot;androidx.appcompat:appcompat:${androidXVersions.appCompat}&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043d\u0438\u043c \u0438\u0437 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">dependencies {     api compatibility(&quot;annotation&quot;)     api compatibility(&quot;appcompat&quot;)     api compatibility(&quot;cardview&quot;)     api compatibility(&quot;coordinatorlayout&quot;)     api compatibility(&quot;constraintlayout&quot;)     api compatibility(&quot;core&quot;)     api compatibility(&quot;dynamicanimation&quot;)     \/\/ ... }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"opisanie-zavisimostey-v-skriptovom-plagine\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435<\/h2>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441 extra properties \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/plugins.html#sec:script_plugins\">\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d<\/a>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0410 \u0443\u0436\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043b\u0438 \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c\u0443, \u0438\u043b\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0441\u0440\u0430\u0437\u0443 (\u0447\u0435\u0440\u0435\u0437 <code>allprojects {}<\/code>), \u0438\u043b\u0438 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f \u0442\u043e\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b.<\/p>\n<p>  <\/p>\n<h2 id=\"opisanie-zavisimostey-v-buildsrc\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 buildSrc<\/h2>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/organizing_gradle_projects.html#sec:build_sources\">buildSrc<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 classpath build-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c buildSrc \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0430\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/github.com\/chrisbanes\/insetter\">Insetter<\/a> Chris Banes \u0442\u0430\u043a \u0438 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 buildSrc, \u0438 \u043e\u043d \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u0438\u0434\u0435\u043d \u0432\u0441\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">object Versions {     const val minSdk = 23     const val compileSdk = 29     const val kotlin = &quot;1.4.20&quot;     const val kotlinCoroutines = &quot;1.4.0&quot;     const val okHttp = &quot;4.9.0&quot;     const val retrofit = &quot;2.9.0&quot;     const val moshi = &quot;1.11.0&quot; } object Dependencies {     object Kotlin {         const val stdlib = &quot;org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}&quot;         const val reflect = \u201corg.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}&quot;     }     object Google {         const val materialComponents = &quot;com.google.android.material:material:1.2.1&quot;         const val googleAuth = &quot;com.google.android.gms:play-services-auth:18.1.0&quot;         const val location = &quot;com.google.android.gms:play-services-location:17.1.0&quot;         const val tasks = &quot;com.google.android.gms:play-services-tasks:17.2.0&quot;     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c buildSrc \u0434\u043b\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0430\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u043b\u0438\u0442 \u0432 IDE:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c_\/oo\/r2\/c_oor2smgbbvmxmlv8_smqcq4lm.gif\"><\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 buildSrc \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u044d\u0448 \u0441\u0431\u043e\u0440\u043a\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u0432\u044b\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<p>  <\/p>\n<h2 id=\"kompozitnye-sborki\">\u041a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/composite_builds.html\">\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/a>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043a\u044d\u0448\u0430. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043a\u0440\u0430\u0442\u043a\u043e, \u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 buildSrc \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/badoo\/blog\/514094\/\">\u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 \u0431\u043b\u043e\u0433\u0430 Badoo<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/proandroiddev.com\/stop-using-gradle-buildsrc-use-composite-builds-instead-3c38ac7a2ab3\">\u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 Josef Raska<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u00ab\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438\u00bb (included build), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445. \u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>settings.gradle<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4h\/k0\/ts\/4hk0tsza9ei2ujzgz82g_q2yen8.png\"><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u0441\u0443\u043d\u0443\u0442\u044c \u0432 classpath build-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d, \u0430 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0438\u043c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432 buildSrc:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">\/\/ Build \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \/\/ .\/dependencies\/build.gradle.kts  plugins {     `kotlin-dsl` }  repositories {     jcenter()     google() }  gradlePlugin {     plugins {         register(&quot;dependencies&quot;) {             id = &quot;dependencies&quot;             implementationClass = \u201ccom.rmr.dependencies.DependenciesPlugin\u201d         }     } }<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"kotlin\">\/\/ \u041f\u043b\u0430\u0433\u0438\u043d \u0438\u0437 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \/\/ .\/dependencies\/src\/main\/kotlin\/com\/rmr\/depenendencies\/DependenciesPlugin.kt package com.rmr.dependencies  import org.gradle.api.Plugin import org.gradle.api.Project  class DependenciesPlugin : Plugin&lt;Project&gt; {      override fun apply(target: Project) {         \/\/ Do nothing, just load dependencies to classpath     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">plugins\u00a0{ id(&quot;dependencies&quot;) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u0430\u043a \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c buildSrc. <\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e <strong>\u0441\u043f\u043e\u0441\u043e\u0431 \u0441 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0430\u043c\u0438 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/strong>.<\/p>\n<p>  <\/p>\n<h1 id=\"5-kak-obnovlyat-zavisimosti\">#5 \u041a\u0430\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h1>\n<p>  <\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430\u0434\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. IDE \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0431\u043b\u043e\u043a\u0435 <code>dependencies {}<\/code>, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4y\/mr\/e0\/4ymre0djfwgbyinkcvqfdi6xpu0.png\" alt=\"New dependencies\"><\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u043c\u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430\u043c\u0438 \u0432 build-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u0430 \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0441 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0430\u043c\u0438, buildSrc \u0438\u043b\u0438 extra properties, \u0442\u043e IDE \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/ben-manes\/gradle-versions-plugin\">gradle-versions-plugin<\/a>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c task \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u042d\u0442\u043e\u0442 task \u043d\u0430\u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u043b\u044f\u043c\u0431\u0434\u0443 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">fun isNonStable(version: String): Boolean {     val stableKeyword = listOf(&quot;RELEASE&quot;, &quot;FINAL&quot;, &quot;GA&quot;).any { version.toUpperCase().contains(it) }     val regex = &quot;^[0-9,.v-]+(-r)?$&quot;.toRegex()     val isStable = stableKeyword || regex.matches(version)     return isStable.not() }  tasks.withType&lt;DependencyUpdatesTask&gt; {     rejectVersionIf {         isNonStable(candidate.version) &amp;&amp; !isNonStable(currentVersion)     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>.\/gradlew dependencyUpdates<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">The following dependencies have later milestone versions:  - androidx.constraintlayout:constraintlayout [2.0.1 -&gt; 2.0.4]      http:\/\/tools.android.com  - androidx.core:core-ktx [1.5.0-alpha05 -&gt; 1.5.0-beta03]      https:\/\/developer.android.com\/jetpack\/androidx\/releases\/core#1.5.0-beta03  - androidx.fragment:fragment-ktx [1.3.0-beta02 -&gt; 1.3.1]      https:\/\/developer.android.com\/jetpack\/androidx\/releases\/fragment#1.3.1  - androidx.lifecycle:lifecycle-runtime-ktx [2.2.0 -&gt; 2.3.0]      https:\/\/developer.android.com\/jetpack\/androidx\/releases\/lifecycle#2.3.0  - com.github.ben-manes:gradle-versions-plugin [0.36.0 -&gt; 0.38.0]  - com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin [0.36.0 -&gt; 0.38.0]  - com.github.bumptech.glide:glide [4.11.0 -&gt; 4.12.0]      https:\/\/github.com\/bumptech\/glide<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"6-staraytes-ne-ispolzovat-feature-flagi-v-build-config\">#6 \u0421\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c feature-\u0444\u043b\u0430\u0433\u0438 \u0432 build config<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 release, debug \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043b\u043e\u0433\u0438, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438, debug menu \u0434\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0442.\u0434. \u0418 \u0447\u0430\u0441\u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0444\u043b\u0430\u0433\u0438, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 build config, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">android {     buildTypes {         getByName(&quot;debug&quot;) {             buildConfigField(&quot;Boolean&quot;, &quot;ENABLE_DEBUG_SCREEN&quot;, &quot;true&quot;)         }         getByName(&quot;release&quot;) {             buildConfigField(&quot;Boolean&quot;, &quot;ENABLE_DEBUG_SCREEN&quot;, &quot;false&quot;)         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u0442\u0430\u043a\u0438\u0435 \u0444\u043b\u0430\u0433\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">if (BuildConfig.ENABLE_DEBUG_SCREEN) {  } else {  }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0443 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u043e\u0432 \u0438 \u0432\u0435\u0442\u043a\u0438 if\/else: <code>if\u00a0(enabled) {} else {}<\/code> \u0438\u043b\u0438 <code>if\u00a0(disabled) {} else {}<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u043e\u0434\u043d\u0430\u0436\u0434\u044b, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u0440\u0435\u043b\u0438\u0437 \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \u0434\u043b\u044f QA-\u043e\u0442\u0434\u0435\u043b\u0430 (\u0434\u0443\u043c\u0430\u044e, \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0431\u044b\u043b\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0438). \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e, \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u043c\u0430\u0440\u043a\u0435\u0442. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0440\u0435\u043b\u0438\u0437 (\u0437\u0434\u0435\u0441\u044c \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u00ab\u043c\u0435\u0440\u0442\u0432\u044b\u0439\u00bb \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f). \u041d\u0443 \u0438 \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u043e\u043c. \u0418 \u0432 Gradle \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c.<\/p>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 source set \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 build variant (&quot;src\/<strong>release<\/strong>\/java &#8230;&quot;, &quot;src\/<strong>debug<\/strong>\/java &#8230;&quot;). \u0410 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: <code>debugImplementation<\/code>, <code>releaseImplementation<\/code> \u0438 \u0442.\u0434. \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0431\u043e\u0440\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c debug menu \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f debug \u0438 QA-\u0441\u0431\u043e\u0440\u043e\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">dependencies {     val qaImplementation by configurations      debugImplementation(project(&quot;:feature-debug-screen&quot;))     qaImplementation(project(&quot;:feature-debug-screen&quot;)) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 stub \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 source set.<\/p>\n<p>  <\/p>\n<h1 id=\"7-neskolko-slov-pro-bazovuyu-strukturu-proekta\">#7 \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043f\u0440\u043e \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h1>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u043f\u043e \u0442\u0435\u043c\u0435, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 Gradle.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430? \u042f \u0431\u044b, \u043f\u043e\u043c\u0438\u043c\u043e app \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u043b \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>UI kit: \u0441\u0442\u0438\u043b\u0438, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0438 \u0442.\u0434.<\/strong> \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u044d\u043a\u0440\u0430\u043d\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435 (\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443 \u0432\u0430\u0441 \u0446\u0435\u043b\u0430\u044f \u0434\u0438\u0437\u0430\u0439\u043d-\u0441\u0438\u0441\u0442\u0435\u043c\u0430), \u0438 \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c feature-\u043c\u043e\u0434\u0443\u043b\u044c, \u0442\u043e \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u044b\u0439 UI kit. \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li><strong>Common \/ utils<\/strong>: \u0432\u0441\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043b\u044e\u0431\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u043d\u043e \u0438 \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0436\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0430\u0443\u0442\u0441\u043e\u0440\u0441\u0430 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0430 \u043d\u0435 \u043f\u0430\u043a\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c, \u0447\u0442\u043e \u0432 \u0435\u0433\u043e \u043a\u043e\u0434\u0435 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0431\u0438\u0437\u043d\u0435\u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"8-ne-zabyvayte-pro-matchingfallbacks\">#8 \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e matchingFallbacks<\/h1>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e, \u043f\u043e\u043c\u0438\u043c\u043e <code>debug<\/code> \u0438 <code>release<\/code>, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b \u0441\u0431\u043e\u0440\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>qa<\/code> \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432. \u0418 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0445 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c build-\u0441\u043a\u0440\u0438\u043f\u0442\u0435. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e build type \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435 build type, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">android {     buildTypes {         create(&quot;qa&quot;) {             setMatchingFallbacks(&quot;debug&quot;, &quot;release&quot;) \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f qa, \u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 debug, \u0437\u0430\u0442\u0435\u043c release         }     } }<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"9-ubirayte-nenuzhnye-build-variant\">#9 \u0423\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 build variant<\/h1>\n<p>  <\/p>\n<p>Build variant \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 product flavor \u0438 build type. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 build type \u2013 <code>debug<\/code> (\u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430), <code>release<\/code> (\u0441\u0431\u043e\u0440\u043a\u0430 \u0432 \u043c\u0430\u0440\u043a\u0435\u0442) \u0438 <code>qa<\/code> (\u0441\u0431\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f), \u0430 \u0432\u043e flavor \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430, \u2013 <code>production<\/code> \u0438 <code>staging<\/code> (\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435). \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 build variant \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nd\/pi\/he\/ndpihekrlekfyrziwb1oolp0lrg.png\" alt=\"Build variants\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u0432 \u043c\u0430\u0440\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430 \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 (<code>stagingRelease<\/code>). \u0418 \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c variant filter:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">android {     variantFilter {         if (name == &quot;stagingRelease&quot;) {             setIgnore(true)         }     } }<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"10-v-nekotoryh-modulyah-zavyazannyh-na-android-framework-mozhno-ne-ispolzovat-android-gradle-plugin\">#10 \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Android Framework, \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Android Gradle Plugin<\/h1>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u0432\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0437\u0430\u0432\u044f\u0437\u0430\u043d \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 Android Framework, \u0442\u043e \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a \u043d\u0435\u043c\u0443 Android Gradle Plugin \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043c \u0444\u0430\u0439\u043b \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430. \u041c\u043e\u0434\u0443\u043b\u0438 \u0441 AGP \u2014 \u0431\u043e\u043b\u0435\u0435 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435, \u0447\u0435\u043c \u0447\u0438\u0441\u0442\u044b\u0435 java\/kotlin \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b, \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0442.\u0434. \u041a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <code>Activity<\/code>, <code>Context<\/code> \u0438 \u0442.\u0434., \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Android Framework \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">dependencies {     compileOnly(&quot;com.google.android:android:4.1.1.4&quot;) }<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"11-kak-napisat-gradle-plagin-dlya-ci-na-primere-gitlab\">#11 \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Gradle-\u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f CI \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 gitlab<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 CI \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0442\u044f\u043d\u0435\u0442 \u043d\u0430 \u0446\u0435\u043b\u0443\u044e \u0443\u0432\u0435\u0441\u0438\u0441\u0442\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e. \u041d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u0435\u0451 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Gradle-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043e\u043a. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 \u0441\u043e\u0432\u0435\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442 CI, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \u043d\u0430 CI <code>versionCode<\/code> \u0441\u0442\u0430\u0432\u0438\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 1, 2, 3 \u0438 \u0442.\u0434. \u042f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <code>versionCode<\/code> \u0431\u0440\u0430\u043b\u0441\u044f CI job id \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f timestamp. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 <code>versionCode<\/code> \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043f\u043e\u0432\u044b\u0448\u0430\u043b\u0441\u044f \u0438 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u0433\u0434\u0435-\u0442\u043e \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435, \u043a\u0443\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0431\u043e\u0440\u043a\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u043d\u0430 CI. \u0410 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u043e\u043c\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c (\u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c, \u043d\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432). \u0421\u0442\u043e\u0438\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0431\u043e\u0440\u043e\u043a. \u0412\u0441\u044e \u044d\u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 Gradle-\u043f\u043b\u0430\u0433\u0438\u043d. \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Gitlab CI \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 <code>versionCode<\/code> \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f Gitlab. \u0412 \u0435\u0433\u043e API \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.gitlab.com\/ee\/api\/project_level_variables.html#update-variable\">\u043c\u0435\u0442\u043e\u0434<\/a> \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: <code>PUT \/projects\/:id\/variables\/:key<\/code>. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043b\u0438 <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/project\/settings\/project_access_tokens.html\">project access token<\/a>, \u0438\u043b\u0438 <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/profile\/personal_access_tokens.html\">personal access token<\/a> \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 gitlab.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u043f\u0438\u0441\u0430\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u043e \u0448\u0430\u0433\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-1-v-nastroykah-proekta-na-gitlab-sozdat-peremennye-okruzheniya\">\u0428\u0430\u0433 1: \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 gitlab \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <code>VERSION_CODE_NEXT<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a API gitlab:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/da\/hz\/mg\/dahzmgah3tgozixh85y_okjwi-w.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"shag-2-sozdat-kompozitnuyu-sborku\">\u0428\u0430\u0433 2: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443<\/h3>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>.\/includedBuilds\/ci<\/code>, \u0430 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b <code>build.gradle.kts<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">plugins {     `kotlin-dsl` }  kotlinDslPluginOptions {     experimentalWarning.set(false) }  repositories {     jcenter()     google() }  dependencies {     implementation(&quot;com.squareup.okhttp3:okhttp:4.9.0&quot;) }  gradlePlugin {     plugins {         register(&quot;gitlab-ci&quot;) {             id = &quot;gitlab-ci&quot;             implementationClass = &quot;com.redmadrobot.app.ci.CIPlugin&quot; \/\/ \u042d\u0442\u043e\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u044f\u0434\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b <code>.\/includedBuilds\/ci\/settings.gradle.kts<\/code>, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u0443 \u0432\u0430\u0441 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f clean \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b <code>settings.gradle.kts<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>includeBuild(&quot;includedBuilds\/ci&quot;)<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-3-napisat-plagin\">\u0428\u0430\u0433 3: \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d<\/h3>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <code>versionCode<\/code>, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 build-\u0441\u043a\u0440\u0438\u043f\u0442\u0435 (\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b: \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 classpath build-\u0441\u043a\u0440\u0438\u043f\u0442\u0430):<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">const val GITLAB_VARIABLE_NEXT_VERSION = &quot;VERSION_CODE_NEXT&quot; private const val DEFAULT_VERSION_CODE = 1  fun getVersionCode(): Int = if (isRunningOnCi()) {     getNextVersionCode() } else {     DEFAULT_VERSION_CODE }  private fun isRunningOnCi(): Boolean = System.getenv()[&quot;CI&quot;] != null  private fun getNextVersionCode(): Int {     return System.getenv()[GITLAB_VARIABLE_NEXT_VERSION]?.toInt()         ?: error(&quot;$GITLAB_VARIABLE_NEXT_VERSION must be specified&quot;) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 gitlab:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">fun updateGitlabVariable(variable: String, value: String) {     val projectId = System.getenv()[&quot;CI_PROJECT_ID&quot;]     val accessToken = System.getenv()[&quot;TOKEN_FOR_GITLAB_API&quot;]      val client = OkHttpClient()      val body = MultipartBody.Builder()         .setType(MultipartBody.FORM)         .addFormDataPart(&quot;value&quot;, value)         .build()      val request = Request.Builder()         .header(&quot;PRIVATE-TOKEN&quot;, accessToken)         .url(&quot;https:\/\/gitlab.com\/api\/v4\/projects\/$projectId\/variables\/$variable&quot;)         .method(&quot;PUT&quot;, body)         .build()      client.newCall(request).execute().use { response -&gt;         if (!response.isSuccessful) throw IOException(&quot;Couldn't update variable\u201d)     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0438\u0448\u0435\u043c task, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">open class IncrementVersionCode : DefaultTask() {      @TaskAction     fun action() {         val nextVersionCode = getDistributionVersionCode() + 1         updateGitlabVariable(             GITLAB_VARIABLE_NEXT_VERSION,             nextVersionCode.toString()         )     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 task \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">package com.redmadrobot.app.ci  import org.gradle.api.Plugin import org.gradle.api.Project  class CIPlugin : Plugin&lt;Project&gt; {      override fun apply(target: Project) {         target.tasks.register(&quot;incrementVersionCode&quot;, IncrementVersionCode::class.java)     } }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-4-podklyuchit-plagin\">\u0428\u0430\u0433 4: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d<\/h3>\n<p>  <\/p>\n<p>\u0412 build-\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f apk, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">plugins {     id(&quot;gitlab-ci&quot;) }  android {     defaultConfig {         versionCode = com.redmadrobot.app.ci.getVersionCode()     } }  project.afterEvaluate {     tasks[&quot;incrementVersionCode&quot;].mustRunAfter( \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 Firebase App Distribution         tasks[&quot;appDistributionUploadRelease&quot;],         tasks[&quot;appDistributionUploadQa&quot;]     ) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>.\/gradlew assembleRelease appDistributionUploadRelease incrementVersionCode<\/code> \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443, \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0432 \u0432\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 <code>.gitlab-ci.yml<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"v-zaklyuchenie\">\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 best practices \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Gradle, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0431\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c. \u0418\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0430\u0448\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"chto-eschyo-posmotret\">\u0427\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/h1>\n<p>  <\/p>\n<p>\u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u043a\u043b\u0430\u0434\u044b \u043f\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Gradle, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u043b \u0421\u0442\u0435\u043f\u0430\u043d \u0413\u043e\u043d\u0447\u0430\u0440\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u043e\u0434\u044b. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u0438\u0445, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=ez3mQoMZUBY\">Gradle pipeline optimisation: Beyond basics<\/a>;<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=Yft6h7JkWo0&amp;t=0s\">Gradle \u043e\u0442 A \u0434\u043e \u042f<\/a>;<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=oAQlKiF91Ks\">\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/a>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0418 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438: <a href=\"https:\/\/www.youtube.com\/watch?v=CbEqv1vXtOc\">\u0420\u0430\u0437\u0431\u043e\u0440 \u0434\u043e\u043a\u043b\u0430\u0434\u0430 \u0421\u0442\u0435\u043f\u0430\u043d\u0430 \u0413\u043e\u043d\u0447\u0430\u0440\u043e\u0432\u0430 \u00abGradle \u043e\u0442 \u0410 \u0434\u043e \u042f\u00bb<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/redmadrobot\/blog\/544630\/\"> https:\/\/habr.com\/ru\/company\/redmadrobot\/blog\/544630\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u043f\u0438\u0448\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 Android, \u0432 \u043c\u0438\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 Gradle \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Gradle \u0441 \u0442\u0435\u043c\u0438, \u0443 \u043a\u043e\u0433\u043e \u043d\u0435\u0442 \u0447\u0451\u0442\u043a\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u043f\u0438\u0441\u0430\u0442\u044c build-\u0441\u043a\u0440\u0438\u043f\u0442\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rl\/lg\/nu\/rllgnup8zmby1tee7kxzsirglaa.png\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320271","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320271"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320271\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}