サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
WWDC25
gradle.monochromeroad.com
This chapter looks at some of the details of writing a build script. 本章では、ビルドスクリプトの記述についてもう少し詳しく見ていきます。 Gradle provides a domain specific language, or DSL, for describing builds. This build language is based on Groovy, with some additions to make it easier to describe a build. Gradleは、ビルドシステムを記述するためのドメイン特化言語(DSL)を提供します。 このビルド用言語は、Groovyをベースに、ビルドシステムの記述を簡単にするための機能をいくつか追加したものです。 A build script can c
In the introductory tutorial (6章ビルドスクリプトの基本) you learned how to create simple tasks. You also learned how to add additional behavior to these tasks later on, and you learned how to create dependencies between tasks. This was all about simple tasks, but Gradle takes the concept of tasks further. Gradle supports enhanced tasks, which are tasks that have their own properties and methods. This is real
You can locate a file relative to the project directory using the Project.file() method. Project.file() メソッドで、プロジェクトディレクトリからの相対参照でファイルを取得できます。 build.gradle // Using a relative path File configFile = file('src/config.xml') // Using an absolute path configFile = file(configFile.absolutePath) // Using a File object with a relative path configFile = file(new File('src/config.xml')) You can pass any ob
This interface is the main API you use to interact with Gradle from your build file. From a Project, you have programmatic access to all of Gradle's features. このインターフェースは、ビルドファイル内でGradleとやりとりする際、メインで使用するAPIです。Projectから、Gradleの全ての機能にプログラム的にアクセスできます。 There is a one-to-one relationship between a Project and a build.gradle file. During build initialisation, Gradle assembles a Project object for each p
The Java plugin adds Java compilation along with testing and bundling capabilities to a project. It serves as the basis for many of the other Gradle plugins. Javaプラグインは、プロジェクトにJavaのコンパイル、テスト、そしてビルド能力を与えます。このプラグインは、他の多くのGradleプラグインの基礎となっています。
There is a common situation where multiple tasks depend on the existence of a directory. Of course you can deal with this by adding a mkdir to the beginning of those tasks, but it's almost always a bad idea to repeat a sequence of code that you only need once (Look up the DRY principle). A better solution would use the dependsOn relationship between tasks to reuse the task to create the directory:
The gradle コマンドには次の使用方法があります:command has the following usage: コマンドライン・オプションは下記のgradleコマンドリストに示されている物が利用可能です。 The command-line options available for the gradle command are listed below: -?, -h, --help Shows a help message. ヘルプのメッセージを参照 -a, --no-rebuild Do not rebuild project dependencies. プロジェクトの依存関係をリビルドしません。 --all Shows additional detail in the task listing. See 「タスクの一覧Listing tasks」. タスク実行時の応答の詳
This chapter introduces the basics of the Gradle command-line. You run a build using the gradle command, which you have already seen in action in previous chapters. 本章では、Gradleのコマンドラインについて基本的な部分を紹介します。これまで動かしてきたように、Gradleのビルドはgradleコマンドで実行します。 You can execute multiple tasks in a single build by listing each of the tasks on the command-line. For example, the command gradle compile test will execute
This chapter introduces some of the basics of dependency management in Gradle. 本章では、Gradleにおける依存関係の管理について、基本的なところを紹介します。 Very roughly, dependency management is made up of two pieces. Firstly, Gradle needs to know about the things that your project needs to build or run, in order to find them. We call these incoming files the dependencies of the project. Secondly, Gradle needs to build and upload t
The powerful support for multi-project builds is one of Gradle's unique selling points. This topic is also the most intellectually challenging. マルチプロジェクトはビルドツールの知恵の絞りどころであり、とてもやりがいのあるテーマです。Gradleはマルチプロジェクトを強力にサポートしていて、ユニークなセールスポイントの一つとなっています。 A multi-project build in gradle consists of one root project, and one or more subprojects that may also have subprojects. While each subproject could configu
20.1. gradle.propertiesを使用したビルド環境の構築Configuring the build environment via gradle.properties Gradle provides several options that make it easy to configure the Java process that will be used to execute your build. While it's possible to configure these in your local environment via GRADLE_OPTS or JAVA_OPTS, certain settings like JVM memory settings, Java home, daemon on/off can be more useful if th
The Gradle Wrapper (henceforth referred to as the “wrapper”) is the preferred way of starting a Gradle build. The wrapper is a batch script on Windows, and a shell script for other operating systems. When you start a Gradle build via the wrapper, Gradle will be automatically downloaded and used to run the build. Gradleラッパー(以後ラッパーとします)は、Gradleのビルドを実行する方法として推奨されているものです。 ラッパーは、バッチスクリプト(Windows用)とシェルス
As we have seen, Gradle is a general-purpose build tool. It can build pretty much anything you care to implement in your build script. Out-of-the-box, however, it doesn't build anything unless you add code to your build script to do so. ここまで見てきたように、Gradleは汎用のビルドツールです。ビルドスクリプトで実装したいと思うようなものはほぼ何でもビルドできます。しかし、初期状態では、ビルドスクリプトに何かを行うためのコードを追加しない限り、何もビルドはしません。 Most Java projects are pretty similar as far
There are several places where you can put the source for the plugin. プラグインのソースを配置できる場所はいくつかあります。 ビルドスクリプトBuild scriptYou can include the source for the plugin directly in the build script. This has the benefit that the plugin is automatically compiled and included in the classpath of the build script without you having to do anything. However, the plugin is not visible outside the build script, a
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. このドキュメントは、個人利用目的および第三者に配布するためにコピーして使用できます。ただし、印刷するにせよ電子媒体を使用するにせよ、以下の点に留意してください。どのような形態であれ使用料を課さないこと。また、このコピーライト条項を配布物に含めること。 例目次 6.1. 初めてのビルドス
Everything in Gradle sits on top of two basic concepts: projects and tasks. Gradleの根本にあるのは、プロジェクトとタスクという二つの基本的な概念です。 Every Gradle build is made up of one or more projects. What a project represents depends on what it is that you are doing with Gradle. For example, a project might represent a library JAR or a web application. It might represent a distribution ZIP assembled from the JARs produced by
The Gradle application plugin extends the language plugins with common application related tasks. It allows running and bundling applications for the jvm. Gradle アプリケーション プラグインは言語プラグインを一般的なアプリケーションの関連タスクで拡張しています。 JVM 用アプリケーションの実行 及び ビルドが可能です。
Gradle offers a variety of ways to organize your build logic. First of all you can put your build logic directly in the action closure of a task. If a couple of tasks share the same logic you can extract this logic into a method. If multiple projects of a multi-project build share some logic you can define this method in the parent project. If the build logic gets too complex for being properly mo
※ 本ページは、Gradle - Documentationを翻訳したものです。 Gradleプロジェクトは、ドキュメントの品質を高めるよう日々努めています。 ドキュメント自身、Gradleによりビルドされており、すべてのコードスニペットおよびサンプルは、Gradleのコードベースが変更されるたびに自動的にテストされ、常に正しく保たれると同時に最新版の内容が反映されるようになっています。 ユーザーガイド ユーザーガイド (分割版HTML、1ページ統合版HTML、PDF)では、Gradleのコンセプト、機能、コアプラグインについて詳細に記述されています。 チュートリアルで基本的なタスクの動作を体験したり、インストール方法を知ることもできます。 もちろん、オライリーのGradleシリーズも忘れずにチェックしてください。 リファレンス資料 リファレンスとして最初に参照するべきドキュメントは、DS
Dependency management is a critical feature of every build, and Gradle has placed an emphasis on offering first-class dependency management that is both easy-to-understand and compatible with a wide variety of approaches. If you are familiar with the approach used by either Maven or Ivy you will be delighted to learn that Gradle is fully compatible with both approaches in addition to being flexibl
Home はじめにいくつかの基本ビルドスクリプトの構造核となる型コンテナ型補助タスク型タスク型Eclipse/IDEAモデル型Eclipse/IDEAタスク型ネィティブバイナリの核となる型ネィティブバイナリタスク型ビルドスクリプトのブロックBuild script blocksallprojects { }artifacts { }buildscript { }configurations { }dependencies { }repositories { }sourceSets { }subprojects { }publishing { }Core typesProjectTaskGradleSettingsScriptJavaToolChainSourceSetSourceSetOutputIncrementalTaskInputsConfigurationResolutionStr
Gradle requires a Java JDK or JRE to be installed, version 6 or higher (to check, use java -version). Gradle ships with its own Groovy library, therefore Groovy does noot need to be installed. Any existing Groovy installation is ignored by Gradle. Gradleを使用するには、バージョン6以上のJava JDKもしくはJREが必要です(java -versionで確認してください)。 GradleにはGroovyライブラリが同梱されているので、別途Groovyをインストールする必要はありません。すでにインストールされていたとしても、Gradleでは
このページを最初にブックマークしてみませんか?
『gradle.monochromeroad.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く