{"id":20874,"date":"2023-02-09T01:58:41","date_gmt":"2023-02-09T01:58:41","guid":{"rendered":"https:\/\/www.booksofall.com\/tw\/?post_type=product&#038;p=20874"},"modified":"2023-02-09T01:58:42","modified_gmt":"2023-02-09T01:58:42","slug":"gradle-user-guide","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/","title":{"rendered":"Gradle User Guide"},"content":{"rendered":"<h3>What is Gradle?<\/h3>\n<p><a href=\"https:\/\/gradle.org\/\">Gradle<\/a> is an open-source build automation tool flexible enough to build almost any type of software. Gradle makes few assumptions about what you\u2019re trying to build or how to build it. This makes Gradle particularly flexible.<\/p>\n<h4>Design<\/h4>\n<p>Gradle bases its design on the following fundamentals:<\/p>\n<h5>High performance<\/h5>\n<p>Gradle avoids unnecessary work by only running tasks that need to do work because inputs or outputs have changed. Gradle uses various caches to reuse outputs from previous builds. With a shared build cache, you can even reuse outputs from other machines.<\/p>\n<h5>JVM foundation<\/h5>\n<p>Gradle runs on the <a href=\"https:\/\/www.javatpoint.com\/jvm-java-virtual-machine\">JVM<\/a>. This is a bonus for users familiar with Java since build logic can use the standard <a href=\"https:\/\/www.simplilearn.com\/tutorials\/java-tutorial\/java-api\">Java APIs<\/a>. It also makes it easy to run Gradle on different platforms.<\/p>\n<h5>Conventions<\/h5>\n<p>Gradle makes common types of projects easy to build through conventions. <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/plugins\/mmcblfncjaclajmegihojiekebofjcen\">Plugins<\/a> set sensible defaults to keep build scripts minimal. But these conventions don\u2019t limit you: you can configure settings, add your own tasks, and make many other customizations in your builds.<\/p>\n<h5>Extensibility<\/h5>\n<p>Most builds have special requirements that require custom build logic. You can readily extend Gradle to provide your own build logic with custom tasks and plugins. See Android builds for an example: they add many new build concepts such as flavors and build types.<\/p>\n<h5>IDE support<\/h5>\n<p>Several major IDEs provide interaction with Gradle builds, including <a href=\"https:\/\/developer.android.com\/studio\">Android Studio<\/a>, IntelliJ IDEA, Eclipse, VSCode, and NetBeans. Gradle can also generate the solution files required to load a project into Visual Studio.<\/p>\n<h5>Insight<\/h5>\n<p>Build Scan\u2122 provides extensive information about a build that you can use to identify issues. You can use Build Scans to identify problems with a build\u2019s performance and even share them for debugging help.<\/p>\n<h4>Terminology<\/h4>\n<p>It\u2019s helpful to know the following terminology before you dive into the details of Gradle.<\/p>\n<h5>Projects<\/h5>\n<p>Projects are the things that Gradle builds. Projects contain a build script, which is a file located in the project\u2019s root directory usually named build.gradle or build.gradle.kts. Builds scripts define tasks, dependencies, plugins, and other configuration for that project. A single build can contain one or more projects and each project can contain their own subprojects.<\/p>\n<h5>Tasks<\/h5>\n<p>Tasks contain the logic for executing some work\u2014compiling code, running tests or deploying software. In most use cases, you\u2019ll use existing tasks. Gradle provides tasks that implement many common build system needs, like the built-in Java Test task that can run tests. Plugins provide even more types of tasks.<\/p>\n<p>Tasks themselves consist of:<\/p>\n<ul>\n<li>Actions: pieces of work that do something, like copy files or compile source<\/li>\n<li>Inputs: values, files and directories that the actions use or operate on<\/li>\n<li>Outputs: files and directories that the actions modify or generate<\/li>\n<\/ul>\n<h5>Plugins<\/h5>\n<p>Plugins allow you to introduce new concepts into a build beyond tasks, files and dependency configurations. For example, most language plugins add the concept of source sets to a build.<\/p>\n<p>Plugins provide a means of reusing logic and configuration across multiple projects. With plugins, you can write a task once and use it in multiple builds. Or you can store common configuration, like logging, dependencies, and version management, in one place. This reduces duplication in build scripts. Appropriately modeling build processes with plugins can greatly improve ease of use and efficiency.<\/p>\n<h5>Build Phases<\/h5>\n<p>Gradle evaluates and executes build scripts in three build phases of the Build Lifecycle:<\/p>\n<h5>Initialization<\/h5>\n<p>Sets up the environment for the build and determine which projects will take part in it.<\/p>\n<h5>Configuration<\/h5>\n<p>Constructs and configures the task graph for the build. Determines which tasks need to run and in which order, based on the task the user wants to run.<\/p>\n<h5>Execution<\/h5>\n<p>Runs the tasks selected at the end of the configuration phase.<\/p>\n<h5>Builds<\/h5>\n<p>A build is an execution of a collection of tasks in a Gradle project. You run a build via the command line interface (CLI) or an IDE by specifying task selectors. Gradle configures the build and selects the tasks to run. Gradle runs the smallest complete set of tasks based on the requested tasks and their dependencies.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe frameborder=\"0\" allowtransparency=\"true\" allowFullscreen=\"true\" style=\"width: 100%; height: 700px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/userguide-192db899dl?enforceShowPromotionBar=true&#038;p=1\"><\/iframe><\/p>\n","protected":false},"featured_media":20878,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":""},"product_brand":[],"product_cat":[322],"product_tag":[],"class_list":{"0":"post-20874","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-groovy","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Gradle User Guide - BooksOfAll Traditional Chinese<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gradle User Guide - BooksOfAll Traditional Chinese\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Traditional Chinese\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-09T01:58:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png\" \/>\n<meta name=\"twitter:label1\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/\",\"url\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/\",\"name\":\"Gradle User Guide - BooksOfAll Traditional Chinese\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png\",\"datePublished\":\"2023-02-09T01:58:41+00:00\",\"dateModified\":\"2023-02-09T01:58:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png\",\"width\":\"406\",\"height\":\"490\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/tw\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/tw\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Gradle User Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/#website\",\"url\":\"https:\/\/www.booksofall.com\/tw\/\",\"name\":\"BooksOfAll Traditional Chinese\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/tw\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/#organization\",\"name\":\"BooksOfAll Traditional Chinese\",\"url\":\"https:\/\/www.booksofall.com\/tw\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/www.booksofall.com\/tw\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Traditional Chinese\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/tw\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gradle User Guide - BooksOfAll Traditional Chinese","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/","og_locale":"zh_TW","og_type":"article","og_title":"Gradle User Guide - BooksOfAll Traditional Chinese","og_url":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/","og_site_name":"BooksOfAll Traditional Chinese","article_modified_time":"2023-02-09T01:58:42+00:00","og_image":[{"url":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png","twitter_misc":{"\u9810\u4f30\u95b1\u8b80\u6642\u9593":"3 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/","url":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/","name":"Gradle User Guide - BooksOfAll Traditional Chinese","isPartOf":{"@id":"https:\/\/www.booksofall.com\/tw\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png","datePublished":"2023-02-09T01:58:41+00:00","dateModified":"2023-02-09T01:58:42+00:00","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/"]}]},{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#primaryimage","url":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png","contentUrl":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2023\/02\/img_63e44ecc70aeb.png","width":"406","height":"490"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/tw\/gradle-user-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/tw\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/tw\/categories\/"},{"@type":"ListItem","position":3,"name":"Gradle User Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/tw\/#website","url":"https:\/\/www.booksofall.com\/tw\/","name":"BooksOfAll Traditional Chinese","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/tw\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/tw\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/tw\/#organization","name":"BooksOfAll Traditional Chinese","url":"https:\/\/www.booksofall.com\/tw\/","logo":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.booksofall.com\/tw\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/tw\/wp-content\/uploads\/sites\/3\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Traditional Chinese"},"image":{"@id":"https:\/\/www.booksofall.com\/tw\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/product\/20874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/media\/20878"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/media?parent=20874"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/product_brand?post=20874"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/product_cat?post=20874"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/tw\/wp-json\/wp\/v2\/product_tag?post=20874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}