Gradle User Guide

A better way to build

Version 1.0-rc-1-20120418144325+0900

Hans Dockter

Adam Murdoch

Translated by

Hayashi Masatoshi [FAMILY Given]

Sekiya Kazuchika [FAMILY Given]

Sue Nobuhiro [FAMILY Given]

Mochida Shinya [FAMILY Given]

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.

このドキュメントは、個人利用目的および第三者に配布するためにコピーして使用できます。ただし、印刷するにせよ電子媒体を使用するにせよ、以下の点に留意してください。どのような形態であれ使用料を課さないこと。また、このコピーライト条項を配布物に含めること。

目次

翻訳版について
1. はじめにIntroduction
1.1. このユーザーガイドについてAbout this user guide
2. 概要Overview
2.1. 特長Features
2.2. なぜGroovyなのか?Why Groovy?
3. チュートリアルTutorials
3.1. 始めてみようGetting Started
4. GradleのインストールInstalling Gradle
4.1. 必要環境Prerequisites
4.2. ダウンロードDownload
4.3. 解凍Unpacking
4.4. 環境変数Environment variables
4.5. 正しくインストールされたことをテストするRunning and testing your installation
4.6. JVMオプションJVM options
5. Troubleshooting
5.1. Working through problems
5.2. Getting help
6. ビルドスクリプトの基本Build Script Basics
6.1. プロジェクトとタスクProjects and tasks
6.2. Hello world
6.3. タスク定義のショートカットA shortcut task definition
6.4. ビルドスクリプトはコードですBuild scripts are code
6.5. タスクの依存関係Task dependencies
6.6. 動的なタスクDynamic tasks
6.7. 既存のタスクを操作するManipulating existing tasks
6.8. 略記法Shortcut notations
6.9. Extra task properties
6.10. Antタスクの使用Using Ant Tasks
6.11. メソッドの使用Using methods
6.12. デフォルトタスクDefault tasks
6.13. DAGによる設定Configure by DAG
6.14. 次のステップは?Where to next?
7. JavaクイックスタートJava Quickstart
7.1. JavaプラグインThe Java plugin
7.2. 基本的なJavaプロジェクトA basic Java project
7.3. マルチプロジェクトのJavaビルドMulti-project Java build
7.4. 次のステップは?Where to next?
8. 依存関係管理の基本 Dependency Management Basics
8.1. 依存関係の管理とは What is dependency management?
8.2. 依存関係の宣言 Declaring your dependencies
8.3. 依存関係のコンフィグレーション Dependency configurations
8.4. 外部依存関係 External dependencies
8.5. リポジトリ Repositories
8.6. アーティファクトの公開 Publishing artifacts
8.7. 次のステップは? Where to next?
9. GroovyクイックスタートGroovy Quickstart
9.1. 基本的なGroovyプロジェクトA basic Groovy project
9.2. まとめSummary
10. WebアプリケーションクイックスタートWeb Application Quickstart
10.1. WARファイルのビルドBuilding a WAR file
10.2. Webアプリケーションの実行Running your web application
10.3. まとめSummary
11. Gradleのコマンドラインを使うUsing the Gradle Command-Line
11.1. 複数のタスクを実行するExecuting multiple tasks
11.2. タスクを除外してビルドするExcluding tasks
11.3. タスク名の省略Task name abbreviation
11.4. ビルドスクリプトを指定して実行するSelecting which build to execute
11.5. ビルドに関する情報を取得するObtaining information about your build
11.6. 空実行Dry Run
11.7. まとめSummary
12. GradleのGUIを使うUsing the Gradle Graphical User Interface
12.1. Task Tree(タスク・ツリー)Task Tree
12.2. Favorites(お気に入り)Favorites
12.3. Command Line(コマンドライン)Command Line
12.4. Setup(セットアップ)Setup
13. GradleデーモンThe Gradle Daemon
13.1. デーモン入門Enter the daemon
13.2. 実装ノートImplementation notes
13.3. 使い方とトラブルシューティングUsage and troubleshooting
13.4. デーモンのプロパティDaemon properties
14. いろんなあれこれについてのチュートリアルTutorial - 'This and That'
14.1. ディレクトリの作成Directory creation
14.2. GradleプロパティとシステムプロパティGradle properties and system properties
14.3. 外部のビルドスクリプトをプロジェクトに取り込むConfiguring the project using an external build script
14.4. 任意のオブジェクトを設定するConfiguring arbitrary objects
14.5. 外部スクリプトから任意のオブジェクトを設定するConfiguring arbitrary objects using an external script
14.6. キャッシングCaching
15. ビルド環境The build environment
15.1. gradle.propertiesを使用したビルド環境の構築Configuring the build environment via gradle.properties
15.2. プロクシ経由のWebアクセスAccessing the web via a proxy
16. ビルドスクリプトの記述Writing Build Scripts
16.1. Gradleビルド言語The Gradle build language
16.2. プロジェクトAPIThe Project API
16.3. スクリプトAPIThe Script API
16.4. Declaring variables
16.5. Groovyの基本 Some Groovy basics
17. タスク詳解More about Tasks
17.1. タスクの定義Defining tasks
17.2. タスクを参照するLocating tasks
17.3. タスクの設定を変更するConfiguring tasks
17.4. タスクに依存関係を追加するAdding dependencies to a task
17.5. タスクに説明書きを追加するAdding a description to a task
17.6. タスクの置き換えReplacing tasks
17.7. タスクをスキップするSkipping tasks
17.8. UP-TO-DATEなタスクをスキップするSkipping tasks that are up-to-date
17.9. タスクルールTask rules
17.10. まとめSummary
18. ファイルを取り扱う Working With Files
18.1. ファイルを参照する Locating files
18.2. ファイルコレクション File collections
18.3. ファイルツリー File trees
18.4. アーカイブの内容をファイルツリーとして使う Using the contents of an archive as a file tree
18.5. 入力ファイルセットを指定する Specifying a set of input files
18.6. ファイルをコピーする Copying files
18.7. Syncタスクを使う Using the Sync task
18.8. アーカイブを作成する Creating archives
19. ロギングLogging
19.1. ログレベルの選択Choosing a log level
19.2. ログメッセージを書くWriting your own log messages
19.3. 外部ツールやライブラリからのログについてLogging from external tools and libraries
19.4. Gradleがロギングするものを変更するChanging what Gradle logs
20. GradleからAntを使うUsing Ant from Gradle
20.1. ビルドでのAntタスクとタイプの利用Using Ant tasks and types in your build
20.2. AntビルドのインポートImporting an Ant build
20.3. AntプロパティとリファレンスAnt properties and references
20.4. APIAPI
21. Gradle Plugins
21.1. Applying plugins
21.2. What plugins do
21.3. Conventions
21.4. More on plugins
22. 標準GradleプラグインStandard Gradle plugins
22.1. 言語プラグインLanguage plugins
22.2. Experimental language plugins
22.3. 統合プラグインIntegration plugins
22.4. ソフトウェア開発プラグインSoftware development plugins
22.5. ベースプラグインBase plugins
22.6. サードパーティプラグインThird party plugins
23. JavaプラグインThe Java Plugin
23.1. 使用方法Usage
23.2. ソースセットSource sets
23.3. タスクTasks
23.4. プロジェクトレイアウトProject layout
23.5. 依存関係の管理Dependency management
23.6. 規約プロパティConvention properties
23.7. ソースセットの利用Working with source sets
23.8. JavadocJavadoc
23.9. CleanClean
23.10. リソースResources
23.11. CompileJavaCompileJava
23.12. テストTest
23.13. JarJar
23.14. アップロードUploading
24. GroovyプラグインThe Groovy Plugin
24.1. 使用方法Usage
24.2. タスクTasks
24.3. プロジェクトレイアウトProject layout
24.4. 依存関係の管理Dependency management
24.5. 規約プロパティConvention properties
24.6. ソースセットプロパティSource set properties
24.7. CompileGroovy
25. Scalaプラグイン The Scala Plugin
25.1. 使用方法 Usage
25.2. タスク Tasks
25.3. プロジェクトレイアウト Project layout
25.4. 依存関係の管理 Dependency Management
25.5. 規約プロパティ Convention Properties
25.6. ソースセットプロパティ Source set properties
25.7. Fast Scala Compiler
26. War プラグインThe War Plugin
26.1. 使用方法Usage
26.2. タスクTasks
26.3. プロジェクトレイアウトProject layout
26.4. 依存関係の管理Dependency management
26.5. 規約プロパティConvention properties
26.6. War
26.7. カスタマイズCustomizing
27. EarプラグインThe Ear Plugin
27.1. 使用方法Usage
27.2. タスクTasks
27.3. プロジェクトレイアウトProject layout
27.4. 依存関係の管理Dependency management
27.5. 規約プロパティConvention properties
27.6. Ear
27.7. カスタマイズCustomizing
27.8. カスタムのディスクリプタファイルを使うUsing custom descriptor file
28. Jetty プラグインThe Jetty Plugin
28.1. 使用方法Usage
28.2. タスクTasks
28.3. プロジェクトレイアウトProject layout
28.4. 依存関係の管理Dependency management
28.5. 規約プロパティConvention properties
29. CheckstyleプラグインThe Checkstyle Plugin
29.1. 使用方法Usage
29.2. タスクTasks
29.3. プロジェクトレイアウトProject layout
29.4. 依存関係の管理Dependency management
29.5. 設定

Configuration

30. CodeNarcプラグインThe CodeNarc Plugin
30.1. 使用方法Usage
30.2. タスクTasks
30.3. プロジェクトレイアウトProject layout
30.4. 依存関係の管理Dependency management
30.5. 設定

Configuration

31. FindBugsプラグインThe FindBugs Plugin
31.1. 使用方法Usage
31.2. タスクTasks
31.3. 依存関係の管理Dependency management
31.4. 設定

Configuration

32. JDependプラグインThe JDepend Plugin
32.1. 使用方法Usage
32.2. タスクTasks
32.3. 依存関係の管理Dependency management
32.4. 設定

Configuration

33. PMDプラグインThe PMD Plugin
33.1. 使用方法Usage
33.2. タスクTasks
33.3. 依存関係の管理Dependency management
33.4. 設定

Configuration

34. SonarプラグインThe Sonar Plugin
34.1. 使用方法 Usage
34.2. マルチプロジェクトビルドの解析 Analyzing Multi-Project Builds
34.3. カスタムソースセットの解析 Analyzing Custom Source Sets
34.4. カスタムSonarプロパティの設定 Setting Custom Sonar Properties
34.5. タスク Tasks
35. OSGiプラグインThe OSGi Plugin
35.1. 使用方法Usage
35.2. 暗黙的に適用されるプラグインImplicitly applied plugins
35.3. タスクTasks
35.4. 依存関係の管理Dependency management
35.5. 規約オブジェクトConvention object
35.6.
36. Eclipse プラグインThe Eclipse Plugin
36.1. 使用方法Usage
36.2. タスクTasks
36.3. 設定Configuration
36.4. 生成されたファイルをカスタマイズするCustomizing the generated files
37. IDEAプラグイン The IDEA Plugin
37.1. Usage 使用方法
37.2. タスク Tasks
37.3. 設定 Configuration
37.4. 生成するファイルのカスタマイズ Customizing the generated files
37.5. その他の注意事項 Further things to consider
38. Antlrプラグイン The Antlr Plugin
38.1. 使用方法 Usage
38.2. タスク Tasks
38.3. プロジェクトレイアウト Project layout
38.4. 依存関係管理 Dependency management
38.5. 規約プロパティ Convention properties
38.6. ソースセットプロパティ Source set properties
39. プロジェクトレポートプラグインThe Project Report Plugin
39.1. 使用法 Usage
39.2. タスク Tasks
39.3. プロジェクトレイアウト Project layout
39.4. 依存関係 Dependency management
39.5. 規約プロパティ Convention properties
40. 通知プラグインThe Announce Plugin
40.1. 使用方法Usage
40.2. タスク Tasks
40.3. プロジェクトレイアウト Project layout
40.4. 依存関係 Dependency management
40.5. 規約プロパティ Convention properties
41. ビルド通知プラグインThe Build Announcements Plugin
41.1. 使用方法Usage
42. アプリケーション プラグインThe Application Plugin
42.1. 使用方法Usage
42.2. タスクTasks
42.3. 規約プロパティConvention properties
42.4. ディストリビューションに他のリソースを含める Including other resources in the distribution
43. 依存関係の管理 Dependency Management
43.1. はじめにIntroduction
43.2. 依存関係管理の概要Dependency management overview
43.3. 依存関係のコンフィグレーション Dependency configurations
43.4. 依存関係の宣言方法 How to declare your dependencies
43.5. 依存関係の使い方Working with dependencies
43.6. リポジトリ Repositories
43.7. How dependency resolution works
43.8. 依存関係のキャッシュ The dependency cache
43.9. 推移的依存関係を管理するための戦略 Strategies for transitive dependency management
44. アーティファクトの公開 Publishing artifacts
44.1. はじめにIntroduction
44.2. アーティファクトとコンフィギュレーションArtifacts and configurations
44.3. アーティファクトの宣言 Declaring artifacts
44.4. アーティファクトの公開 Publishing artifacts
44.5. プロジェクトライブラリについての追記事項More about project libraries
45. MavenプラグインThe Maven Plugin
45.1. 使用方法Usage
45.2. タスクTasks
45.3. 依存関係管理Dependency management
45.4. 規約プロパティConvention properties
45.5. 規約メソッドConvention methods
45.6. Mavenリポジトリとの相互作用Interacting with Maven repositories
46. 署名プラグイン The Signing Plugin
46.1. 使用方法 Usage
46.2. 署名者の資格情報 Signatory credentials
46.3. 署名対象を指定する Specifying what to sign
46.4. 署名を公開する Publishing the signatures
46.5. POMファイルに署名する Signing POM files
47. C++ Support
47.1. Usage
47.2. Source code locations
47.3. Compiling
47.4. Configuring the compiler
47.5. Working with shared libraries
47.6. Dependencies
47.7. Publishing
48. ビルドのライフサイクルThe Build Lifecycle
48.1. ビルドフェーズBuild phases
48.2. 設定ファイルSettings file
48.3. マルチプロジェクトのビルドMulti-project builds
48.4. 初期化Initialization
48.5. シングルプロジェクトの設定と実行Configuration and execution of a single project build
48.6. ライフサイクルからの通知に応答するResponding to the lifecycle in the build script
49. マルチプロジェクトのビルドMulti-project Builds
49.1. クロスプロジェクト設定Cross project configuration
49.2. サブプロジェクトの設定Subproject configuration
49.3. マルチプロジェクトのビルド実行ルールExecution rules for multi-project builds
49.4. 絶対パスによるタスクの実行Running tasks by their absolute path
49.5. プロジェクトとタスクのパスProject and task paths
49.6. 依存関係 - なんの依存関係?Dependencies - Which dependencies?
49.7. プロジェクト依存関係Project lib dependencies
49.8. マルチプロジェクトのビルドとテスティングMulti-Project Building and Testing
49.9. プロパティとメソッドの継承Property and method inheritance
49.10. まとめSummary
50. カスタムタスクの作成Writing Custom Task Classes
50.1. タスククラスのパッケージングPackaging a task class
50.2. 単純タスクの作成Writing a simple task class
50.3. スタンドアロンプロジェクトA standalone project
51. カスタムプラグインの作成Writing Custom Plugins
51.1. プラグインのパッケージングPackaging a plugin
51.2. シンプルなプラグインの作成Writing a simple plugin
51.3. ビルドから入力を得るGetting input from the build
51.4. カスタムタスクやプラグインでファイルを扱うWorking with files in custom tasks and plugins
51.5. スタンドアロンプロジェクトA standalone project
51.6. 複数のドメインオブジェクトの管理Maintaining multiple domain objects
52. ビルドロジックの体系化Organizing Build Logic
52.1. プロパティとメソッドの継承Inherited properties and methods
52.2. 設定のインジェクションInjected configuration
52.3. buildSrcプロジェクトのソースをビルドするBuild sources in the buildSrc project
52.4. 別のGradleビルドを、現在のビルドから呼び出して実行するRunning another Gradle build from a build
52.5. ビルドスクリプトで外部ライブラリを使うときの依存関係設定External dependencies for the build script
52.6. Antオプショナルタスクの依存関係Ant optional dependencies
52.7. まとめSummary
53. 初期化スクリプトInitialization Scripts
53.1. 基本的な使い方Basic usage
53.2. 初期化スクリプトを使う Using an init script
53.3. 初期化スクリプトを記述する Writing an init script
53.4. 初期化スクリプトの外部依存関係External dependencies for the init script
54. Gradleラッパー The Gradle Wrapper
54.1. 設定Configuration
54.2. Unixファイルパーミッション Unix file permissions
54.3. 環境変数Environment variable
55. Embedding Gradle
55.1. Introduction to the Tooling API
55.2. Quickstart
A. Gradleサンプル集 Gradle Samples
A.1. サンプル Sample customBuildLanguage
A.2. サンプル Sample customDistribution
A.3. サンプル Sample customPlugin
A.4. サンプル Sample java/multiproject
B. 陥りがちな罠 Potential Traps
B.1. Groovyスクリプトの変数 Groovy script variables
B.2. 設定フェーズと実行フェーズ Configuration and execution phase
C. Gradle コマンドラインGradle Command Line
C.1. 非推奨のコマンドラインオプションDeprecated command-line options
C.2. デーモン コマンドラインオプション:Daemon command-line options:
C.3. システムプロパティSystem properties
C.4. 環境変数Environment variables
D. IDE対応の現状と、IDEによらない開発支援Existing IDE Support and how to cope without it
D.1. IntelliJ
D.2. Eclipse
D.3. IDEサポートなしでGradleを使うUsing Gradle without IDE support
用語集 / Glossary

例目次

6.1. 初めてのビルドスクリプト / The first build script
6.2. ビルドスクリプトの実行 / Execution of a build script
6.3. タスク定義のショートカット / A task definition shortcut
6.4. GradleタスクでGroovyを使う / Using Groovy in Gradle's tasks
6.5. GradleタスクでGroovyを使う / Using Groovy in Gradle's tasks
6.6. タスク間の依存関係を宣言する / Declaration of dependencies between tasks
6.7. 遅延評価のdependsOn - タスクがまだ宣言されていない場合 / Lazy dependsOn - the other task does not exist (yet)
6.8. 動的なタスク定義 / Dynamic creation of a task
6.9. APIからタスクにアクセスする - 依存関係の追加 / Accessing a task via API - adding a dependency
6.10. APIからタスクにアクセスする - アクションの追加 / Accessing a task via API - adding behaviour
6.11. ビルドスクリプトのプロパティとして既存のタスクにアクセスする / Accessing task as a property of the build script
6.12. Adding extra properties to a task
6.13. AntBuilderを使ってant.loadfileターゲットを実行する / Using AntBuilder to execute ant.loadfile target
6.14. メソッドを抽出してビルドロジックを整理する / Using methods to organize your build logic
6.15. デフォルトタスクの定義 / Defining a default tasks
6.16. 選択したタスクによって異なる結果を得る / Different outcomes of build depending on chosen tasks
7.1. Javaプラグインの使用 / Using the Java plugin
7.2. Javaプロジェクトのビルド / Building a Java project
7.3. Mavenリポジトリの追加 / Adding Maven repository
7.4. 依存関係の追加 / Adding dependencies
7.5. MANIFEST.MFのカスタマイズ / Customization of MANIFEST.MF
7.6. テスト用システムプロパティの追加 / Adding a test system property
7.7. JARファイルの公開 / Publishing the JAR file
7.8. Eclipseプラグイン / Eclipse plugin
7.9. Javaの例 - 完全なビルドファイル / Java example - complete build file
7.10. マルチプロジェクトビルド - 階層レイアウト / Multi-project build - hierarchical layout
7.11. マルチプロジェクトビルド - settings.gradleファイル / Multi-project build - settings.gradle file
7.12. マルチプロジェクトビルド - 共通設定 / Multi-project build - common configuration
7.13. マルチプロジェクトビルド - プロジェクト間の依存関係 / Multi-project build - dependencies between projects
7.14. マルチプロジェクトビルド - 配布ファイル / Multi-project build - distribution file
8.1. 依存関係の宣言 / Declaring dependencies
8.2. 外部依存関係の定義 / Definition of an external dependency
8.3. 外部依存関係定義のショートカット形式 / Shortcut definition of an external dependency
8.4. Mavenセントラルリポジトリの使用 / Usage of Maven central repository
8.5. リモートMavenリポジトリの使用 / Usage of a remote Maven repository
8.6. リモートIvyリポジトリの使用 / Usage of a remote Ivy directory
8.7. ローカルのIvyディレクトリを使う / Usage of a local Ivy directory
8.8. Ivyリポジトリに公開する / Publishing to an Ivy repository
8.9. Mavenリポジトリへの公開 / Publishing to a Maven repository
9.1. Groovyプラグイン / Groovy plugin
9.2. Groovyへの依存関係 / Dependency on Groovy 1.6.0
9.3. Groovy用のビルドファイル(全体) / Groovy example - complete build file
10.1. Warプラグイン / War plugin
10.2. JettyプラグインによるWebアプリケーションの実行 / Running web application with Jetty plugin
11.1. Executing multiple tasks
11.2. タスクの除外 / Excluding tasks
11.3. タスク名の省略 / Abbreviated task name
11.4. キャメルケースのタスク名を省略 / Abbreviated camel case task name
11.5. ビルドスクリプトを指定してビルドするプロジェクトを選択する / Selecting the project using a build file
11.6. ディレクトリを指定してビルドするプロジェクトを選択する / Selecting the project using project directory
11.7. プロジェクトに関する情報を取得する / Obtaining information about projects
11.8. プロジェクトに説明を添付する / Providing a description for a project
11.9. タスクに関する情報を取得する / Obtaining information about tasks
11.10. タスクレポートの内容を変更する / Changing the content of the task report
11.11. タスクに関してもっと多くの情報を取得する / Obtaining more information about tasks
11.12. 依存関係の情報を取得する / Obtaining information about dependencies
11.13. プロパティに関する情報 / Information about properties
12.1. GUIの起動Launching the GUI
14.1. mkdirでディレクトリを作成する / Directory creation with mkdir
14.2. gradle.propertiesでプロパティを設定する / Setting properties with a gradle.properties file
14.3. 外部のビルドスクリプトファイルでプロジェクトの設定を行う / Configuring the project using an external build script
14.4. 任意のオブジェクトを設定する / Configuring arbitrary objects
14.5. 外部スクリプトから任意のオブジェクトを設定する / Configuring arbitrary objects using a script
15.1. HTTPプロクシの設定Configuring an HTTP proxy
15.2. HTTPSプロクシの設定Configuring an HTTPS proxy
16.1. Projectオブジェクトへのアクセス / Accessing property of the Project object
16.2. Using local variables
16.3. Using extra properties
16.4. Groovy JDKのメソッド / Groovy JDK methods
16.5. プロパティアクセサ / Property accessors
16.6. カッコなしのメソッド呼び出し / Method call without parentheses
16.7. マップリテラル、リストリテラル / List and map literals
16.8. メソッドのクロージャ引数 / Closure as method parameter
16.9. クロージャのdelegate / Closure delegates
17.1. タスクを定義する / Defining tasks
17.2. タスクを定義する - 文字列を使用 / Defining tasks - using strings
17.3. その他のタスク定義方法 / Defining tasks with alternative syntax
17.4. タスクにプロパティとしてアクセスする / Accessing tasks as properties
17.5. tasksコレクションからタスクにアクセスする / Accessing tasks via tasks collection
17.6. パスを使ってタスクにアクセスする / Accessing tasks by path
17.7. copyタスクの作成 / Creating a copy task
17.8. タスクの設定 - 様々な方法 / Configuring a task - various ways
17.9. タスクの設定 - 流れるインターフェース / Configuring a task - fluent interface
17.10. タスクの設定 - クロージャの使用 / Configuring a task - with closure
17.11. タスクの設定 - configure()メソッド / Configuring a task - with configure() method
17.12. クロージャを伴うタスク定義 / Defining a task with closure
17.13. 別プロジェクトのタスクとの依存関係を定義する / Adding dependency on task from another project
17.14. taskオブジェクトを使った依存関係定義 / Adding dependency using task object
17.15. クロージャを使った依存関係定義 / Adding dependency using closure
17.16. タスクに説明書きを追加する / Adding a description to a task
17.17. タスクの上書き / Overwriting a task
17.18. 述語でタスクをスキップ / Skipping a task using a predicate
17.19. StopExecutionExceptionでタスクをスキップ / Skipping tasks with StopExecutionException
17.20. タスクの有効化と無効化 / Enabling and disabling tasks
17.21. 生成タスク / A generator task
17.22. タスクの入力と出力を宣言 / Declaring the inputs and outputs of a task
17.23. タスクルール / Task rule
17.24. ルールベース・タスクの依存関係 / Dependency on rule based tasks
18.1. ファイルを参照する / Locating files
18.2. ファイルコレクションの作成 / Creating a file collection
18.3. ファイルコレクションを使う / Using a file collection
18.4. ファイルコレクションを実装する / Implementing a file collection
18.5. ファイルツリーを作成する / Creating a file tree
18.6. ファイルツリーを使う / Using a file tree
18.7. アーカイブをファイルツリーとして使う / Using an archive as a file tree
18.8. ファイルセットを指定する / Specifying a set of files
18.9. ファイルセットを指定する / Specifying a set of files
18.10. Copyタスクでファイルをコピーする / Copying files using the copy task
18.11. Copyタスクのコピー元と宛先を指定する / Specifying copy task source files and destination directory
18.12. コピーするファイルを選択する / Selecting the files to copy
18.13. copy()メソッドでファイルをコピーする / Copying files using the copy() method
18.14. コピー時にファイルをリネームする / Renaming files as they are copied
18.15. コピー時にファイルをフィルタリングする / Filtering files as they are copied
18.16. 入れ子構造のコピー仕様 / Nested copy specs
18.17. Syncタスクで依存関係をコピーする / Using the Sync task to copy dependencies
18.18. ZIPアーカイブの作成 / Creating a ZIP archive
18.19. ZIPアーカイブの作成 / Creation of ZIP archive
18.20. アーカイブタスクの設定 - カスタムアーカイブ名 / Configuration of archive task - custom archive name
18.21. アーカイブタスクの設定 - appendix & classifier / Configuration of archive task - appendix & classifier
19.1. ログに標準出力を使う / Using stdout to write log messages
19.2. 自分でログメッセージを書く / Writing your own log messages
19.3. SLF4Jでログを出力する / Using SLF4J to write log messages
19.4. 標準出力のキャプチャ設定 / Configuring standard output capture
19.5. タスク実行時の標準出力キャプチャ設定 / Configuring standard output capture for a task
19.6. Gradleがロギングするものを変更する / Customizing what Gradle logs
20.1. Antタスクの利用 / Using an Ant task
20.2. Antタスクにネストされたテキストを渡す / Passing nested text to an Ant task
20.3. Antタスクにネストされた要素を渡す / Passing nested elements to an Ant task
20.4. Antタイプの利用 / Using an Ant type
20.5. カスタムAntタスクの利用 / Using a custom Ant task
20.6. カスタムAntタスクに対するクラスパスの宣言 / Declaring the classpath for a custom Ant task
20.7. カスタムAntタスクと依存関係管理を併用 / Using a custom Ant task and dependency management together
20.8. Antビルドのインポート / Importing an Ant build
20.9. Antターゲットに依存するタスク / Task that depends on Ant target
20.10. Antターゲットにふるまいを追加 / Adding behaviour to an Ant target
20.11. Ant target that depends on Gradle task
20.12. Antプロパティの設定 / Setting an Ant property
20.13. Antプロパティの取得 / Getting an Ant property
20.14. Antリファレンスの設定 / Setting an Ant reference
20.15. Antリファレンスの取得 / Getting an Ant reference
21.1. Applying a plugin
21.2. Applying a plugin by type
21.3. Applying a plugin by type
21.4. Tasks added by a plugin
21.5. Changing plugin defaults
21.6. Plugin convention object
23.1. Javaプラグインの使用 / Using the Java plugin
23.2. Javaソースレイアウトのカスタマイズ / Custom Java source layout
23.3. ソースセットへのアクセス / Accessing a source set
23.4. ソースセットのソースディレクトリの設定 / Configuring the source directories of a source set
23.5. ソースセットの定義 / Defining a source set
23.6. ソースセットの依存関係定義 / Defining source set dependencies
23.7. ソースセットのコンパイル / Compiling a source set
23.8. ソースセットのJARを生成 / Assembling a JAR for a source set
23.9. ソースセットのJavadocを生成 / Generating the Javadoc for a source set
23.10. ソースセットのテストを実行 / Running tests in a source set
23.11. MANIFEST.MFのカスタマイズ / Customization of MANIFEST.MF
23.12. manifestオブジェクトの作成 / Creating a manifest object.
23.13. 特定のアーカイブ用にMANIFEST.MFを分離 / Separate MANIFEST.MF for a particular archive
23.14. 特定のアーカイブ用にMANIFEST.MFを分離 / Separate MANIFEST.MF for a particular archive
24.1. Groovyプラグインの使用 / Using the Groovy plugin
24.2. Groovyソースレイアウトのカスタマイズ / Custom Groovy source layout
24.3. Groovyプラグインの設定 / Configuration of Groovy plugin
24.4. Groovyプラグインの設定 / Configuration of Groovy plugin
25.1. Scalaプラグインを使う / Using the Scala plugin
25.2. Scalaソースレイアウトのカスタマイズ / Custom Scala source layout
25.3. 使用するScalaのバージョンを指定する。 / Declaring the Scala version to use
25.4. Fast Scala Compilerを有効にする / Enabling the Fast Scala Compiler
26.1. Using the War plugin
26.2. Customization of war plugin
27.1. Earプラグインの利用 / Using the Ear plugin
27.2. Earプラグインのカスタマイズ / Customization of ear plugin
28.1. Using the Jetty plugin
29.1. Checkstyleプラグインの使用 / Using the Checkstyle plugin
30.1. CodeNarcプラグインの使用 / Using the CodeNarc plugin
31.1. FindBugsプラグインの使用 / Using the FindBugs plugin
32.1. JDependプラグインの使用 / Using the JDepend plugin
33.1. PMDプラグインの使用 / Using the PMD plugin
34.1. Sonarプラグインの適用 / Applying the Sonar plugin
34.2. Sonar接続設定のコンフィグレーション / Configuring Sonar connection settings
34.3. Sonarプロジェクト設定のコンフィグレーション / Configuring Sonar project settings
34.4. マルチプロジェクトビルドにおけるグローバルコンフィグレーション / Global configuration in a multi-project build
34.5. マルチプロジェクトビルドにおける共通のプロジェクトコンフィグレーション / Common project configuration in a multi-project build
34.6. マルチプロジェクトビルドにおけるプロジェクト個別コンフィグレーション / Individual project configuration in a multi-project build
34.7. 解析対象の言語のコンフィグレーション / Configuring the language to be analyzed
34.8. プロパティ文法の利用 / Using property syntax
34.9. カスタムソースセットの解析 / Analyzing custom source sets
34.10. カスタムグローバルプロパティ設定 / Setting custom global properties
34.11. カスタムプロジェクトプロパティ設定 / Setting custom project properties
35.1. OSGiプラグインの利用 / Using the OSGi plugin
35.2. OSGiのMANIFEST.MFファイルの設定 / Configuration of OSGi MANIFEST.MF file
36.1. Eclipseプラグインの使用方法 / Using the Eclipse plugin
36.2. classpath の一部を上書き / Partial Overwrite for Classpath
36.3. project の一部を上書き / Partial Overwrite for Project
36.4. 依存関係のエクスポート / Export Dependencies
36.5. 依存関係のエクスポート / Export Dependencies
36.6. XML のカスタマイズ / Customizing the XML
36.7. XML のカスタマイズCustomizing the XML
37.1. IDEAプラグインを使う / Using the IDEA plugin
37.2. モジュールの部分的な上書き / Partial Overwrite for Module
37.3. プロジェクトの部分的な上書き / Partial Overwrite for Project
37.4. Export Dependencies
37.5. XMLをカスタマイズする / Customizing the XML
38.1. Antlrプラグインの利用 / Using the Antlr plugin
38.2. Antlrバージョン宣言 / Declare Antlr version
40.1. 通知プラグインの / Using the announce plugin
40.2. 通知プラグインの設定 / Configure the announce plugin
40.3. 通知プラグインの使用 / Using the announce plugin
41.1. ビルド通知プラグインの利用 / Using the build announcements plugin
41.2. 初期化スクリプトからビルド通知プラグインを使う / Using the build announcements plugin from an init script
42.1. Using the application plugin
42.2. Configure the application main class
42.3. 他タスクの出力をアプリケーションのディストリビューションに含める / Include output from other tasks in the application distribution
42.4. ディストリビューションのファイルを自動的に作成する / Automatically creating files for distribution
43.1. コンフィグレーションの定義 / Definition of a configuration
43.2. コンフィグレーションにアクセスする / Accessing a configuration
43.3. コンフィグレーションの設定変更 / Configuration of a configuration
43.4. モジュール依存関係 / Module dependencies
43.5. アーティファクトオンリー記法 / Artifact only notation
43.6. classifierつきの依存関係 / Dependency with classifier
43.7. コンフィグレーションの外部依存関係の使用 / Usage of external dependency of a configuration
43.8. クライアントモジュール依存関係 - 推移的な依存関係 / Client module dependencies - transitive dependencies
43.9. プロジェクト依存関係 / Project dependencies
43.10. ファイル依存関係 / File dependencies
43.11. 生成されたファイルの依存関係 / Generated file dependencies
43.12. Gradle API依存関係 / Gradle API dependencies
43.13. 内部Groovy依存関係 / Gradle's Groovy dependencies
43.14. 推移的な依存関係の除外 / Excluding transitive dependencies
43.15. 依存関係のオプショナル属性 / Optional attributes of dependencies
43.16. 依存関係のコレクション、配列 / Collections and arrays of dependencies
43.17. 依存関係のコンフィギュレーション / Dependency configurations
43.18. プロジェクト依存関係のコンフィギュレーション / Dependency configurations for project
43.19. Configuration.copy
43.20. 定義した依存関係へアクセスする / Accessing declared dependencies
43.21. Configuration.files
43.22. Configuration.files with spec
43.23. Configuration.copy
43.24. Configuration.copy vs. Configuration.files
43.25. Mavenセントラルリポジトリを追加する / Adding central Maven repository
43.26. ローカルのMavenキャッシュをリポジトリに使う / Adding the local Maven cache as a repository
43.27. カスタムMavenリポジトリを追加する / Adding custom Maven repository
43.28. JARファイル用のMavenリポジトリを追加する / Adding additional Maven repositories for JAR files
43.29. パスワード保護されたMavenリポジトリへのアクセス / Accessing password protected Maven repository
43.30. フラットディレクトリ・リゾルバ / Flat repository resolver
43.31. Ivyリポジトリ / Ivy repository
43.32. Ivyリポジトリとレイアウトパターン / Ivy repository with pattern layout
43.33. Ivyリポジトリとカスタムパターン / Ivy repository with custom patterns
43.34. Ivyリポジトリ / Ivy repository
43.35. リポジトリアクセス / Accessing a repository
43.36. リポジトリ設定 / Configuration of a repository
43.37. カスタムリポジトリの定義 / Definition of a custom repository
43.38. 動的バージョンのキャッシュ制御 / Dynamic version cache control
43.39. 変更性モジュールのキャッシュ制御 / Changing module cache control
44.1. アーカイブタスクを使ってアーティファクトを宣言する / Defining an artifact using an archive task
44.2. アーティファクトをファイルで宣言する / Defining an artifact using a file
44.3. アーティファクトのカスタマイズ / Customizing an artifact
44.4. ファイルでアーティファクトを宣言するMapスタイルの文法 / Map syntax for defining an artifact using a file
44.5. アップロードタスクの設定 / Configuration of the upload task
45.1. Mavenプラグインの利用 / Using the Maven plugin
45.2. スタンドアロンPOMの生成 / Creating a stand alone pom.
45.3. リモートMavenリポジトリへのファイルアップロード / Upload of file to remote Maven repository
45.4. SSH経由でのファイルアップロード / Upload of file via SSH
45.5. POMのカスタマイズ / Customization of pom
45.6. ビルダースタイルでのPOMのカスタマイズ / Builder style customization of pom
45.7. 自動生成コンテンツの修正 / Modifying auto-generated content
45.8. Mavenインストーラのカスタマイズ / Customization of Maven installer
45.9. 複数POMの生成 / Generation of multiple poms
45.10. マッピングコンフィグレーションへのアクセス / Accessing a mapping configuration
46.1. 署名プラグインの使用 / Using the Signing plugin
46.2. コンフィグレーションに署名する / Signing a configuration
46.3. コンフィグレーションの出力に署名する / Signing a configuration output
46.4. タスクを署名する / Signing a task
46.5. タスクの出力に署名する / Signing a task output
46.6. 条件付き署名 / Conditional signing
46.7. Signing a POM for deployment
47.1. Using the 'cpp-exe' plugin
47.2. Using the 'cpp-lib' plugin
47.3. Supplying arbitrary args to the compiler
47.4. Declaring dependencies
47.5. Declaring project dependencies
47.6. Uploading exe or lib
48.1. シングルプロジェクトのビルド / Single project build
48.2. 階層構造のレイアウト / Hierarchical layout
48.3. フラットなレイアウト / Flat layout
48.4. プロジェクト・ツリーの属性を変更する / Modification of elements of the project tree
48.5. プロジェクトツリーの属性を変更する / Modification of elements of the project tree
48.6. 特定プロパティを持つプロジェクトにタスクを追加する / Adding of test task to each project which has certain property set
48.7. 通知 / Notifications
48.8. すべてのタスクにプロパティ値を設定する / Setting of certain property to all tasks
48.9. タスク実行の開始時および終了時にロギングを行う / Logging of start and end of each task execution
49.1. マルチプロジェクト・ツリー - warter & bluewhale プロジェクト / Multi-project tree - water & bluewhale projects
49.2. water(親プロジェクト)のビルドスクリプト / Build script of water (parent) project
49.3. マルチプロジェクトツリー - water, bluewhaleそしてkrill
49.4. Waterプロジェクトのビルドスクリプト / Water project build script
49.5. サブプロジェクト共通の振る舞いとすべてのプロジェクト共通の振る舞いをそれぞれ定義する / Defining common behaviour of all projects and subprojects
49.6. プロジェクト個別の振る舞いを定義する / Defining specific behaviour for particular project
49.7. krillプロジェクトに個別の振る舞いを定義する / Defining specific behaviour for project krill
49.8. プロジェクトに振る舞いを追加する(プロジェクト名によるフィルタリング) / Adding custom behaviour to some projects (filtered by project name)
49.9. プロジェクトに振る舞いを追加する(プロパティによるフィルタリング) / Adding custom behaviour to some projects (filtered by project properties)
49.10. サブプロジェクトからビルドを実行する / Running build from subproject
49.11. プロジェクトの評価と実行 / Evaluation and execution of projects
49.12. プロジェクトの評価と実行 / Evaluation and execution of projects
49.13. 絶対パスによるタスクの実行 / Running tasks by their absolute path
49.14. 依存関係とビルド実行順序 / Dependencies and execution order
49.15. 依存関係とビルド実行順序 / Dependencies and execution order
49.16. 依存関係とビルド実行順序 / Dependencies and execution order
49.17. 依存関係を宣言する
49.18. 依存関係を宣言する
49.19. プロジェクトにまたがるタスク間の依存関係 / Cross project task dependencies
49.20. 評価順序の依存関係 / Configuration time dependencies
49.21. 評価順序の依存関係 - evaluationDependsOn / Configuration time dependencies - evaluationDependsOn
49.22. 評価順序の依存関係 / Configuration time dependencies
49.23. 依存関係 - 実生活の例 - クロスプロジェクト設定 / Dependencies - real life example - crossproject configuration
49.24. プロジェクト依存関係 / Project lib dependencies
49.25. プロジェクト依存関係 / Project lib dependencies
49.26. 細かい依存関係の制御 / Fine grained control over dependencies
49.27. シングルプロジェクトのビルドとテスト / Build and Test Single Project
49.28. シングルプロジェクトの部分ビルドとテスト / Partial Build and Test Single Project
49.29. 依存プロジェクトのビルドとテスト / Build and Test Depended On Projects
49.30. 依存されているプロジェクトのビルドとテスト / Build and Test Dependent Projects
50.1. カスタムタスクの定義 / Defining a custom task
50.2. hello worldタスク / A hello world task
50.3. カスタマイズ可能なhello worldタスク / A customizable hello world task
50.4. カスタムタスクのビルド / A build for a custom task
50.5. カスタムタスク / A custom task
50.6. カスタムタスクを別のプロジェクトで使う / Using a custom task in another project
50.7. カスタムタスクのテスト / Testing a custom task
51.1. カスタムプラグイン / A custom plugin
51.2. カスタムプラグインのextension / A custom plugin extension
51.3. コンフィグレーションクロージャ付きのカスタムプラグイン / A custom plugin with configuration closure
51.4. ファイルプロパティの遅延評価 / Evaluating file properties lazily
51.5. カスタムプラグインに対するビルド / A build for a custom plugin
51.6. カスタムプラグインに対するワイヤリング / Wiring for a custom plugin
51.7. 別のプロジェクトでカスタムプラグインを使う / Using a custom plugin in another project
51.8. カスタムプラグインのテスト / Testing a custom plugin
51.9. ドメインオブジェクトの管理 / Managing domain objects
52.1. プロパティとメソッドの継承を使う / Using inherited properties and methods
52.2. プロパティとメソッドのインジェクション / Using injected properties and methods
52.3. カスタムbuildSrcビルドスクリプト / Custom buildSrc build script
52.4. buildSrcルートプロジェクトにサブプロジェクトを追加する / Adding subprojects to the root buildSrc project
52.5. 別のビルドを呼び出す / Running another build from a build
52.6. ビルドスクリプトのクラスパスを宣言する / Declaring external dependencies for the build script
52.7. 外部ライブラリをビルドスクリプトで使用する / A build script with external dependencies
52.8. Ant optional dependencies
53.1. プロジェクト評価前に初期化スクリプトで追加的な設定を行う / Using init script to perform extra configuration before projects are evaluated
53.2. 初期化スクリプトの外部依存関係定義 / Declaring external dependencies for an init script
53.3. 外部依存関係を持つ初期化スクリプト / An init script with external dependencies
54.1. ラッパータスク / Wrapper task
54.2. ラッパーにより生成されるファイル / Wrapper generated files
54.3. Configuration of wrapper task
B.1. 変数のスコープ:ローカルスコープとスクリプトスコープ / Variables scope: local and script wide
B.2. 設定フェーズと実行フェーズの区別 / Distinct configuration and execution phase