Gradle 菴ソ逕ィ譁ケ豕

Gradle縺ィ縺ッシ

繝サApache Ant
繝サApache Maven
縺ィ蜷後§縺繍ava繝薙Ν繝峨ヤ繝シ繝ォ
繝励Ο繧ー繝ゥ繝溘Φ繧ー險隱曩roovy縺ァ繝薙Ν繝画焔鬆繧定ィ倩ソー縺ァ縺阪k

險ュ螳

繧、繝ウ繧ケ繝医シ繝ォ

繝サ蜈ャ蠑上し繧、繝縺九i縲沓inary only縲阪r驕ク謚橸シ繝繧ヲ繝ウ繝ュ繝シ繝
繝サ隗」蜃 萓具シ壹後ョ繧ケ繧ッ繝医ャ繝予gradle-3.4.1-bin\gradle-3.4.1縲
繝サ繝輔か繝ォ繝繧剃ササ諢上ョ蝣エ謇縺ク 萓具シ壹轡:\gradle-3.4.1\bin縲
繝サ迺ー蠅螟画焚シ嗔ath縺ォ霑ス蜉 萓具シ壹轡:\gradle-3.4.1\bin縲

繝薙Ν繝芽ィュ螳壹ヵ繧。繧、繝ォ

Gradle 險ュ螳壽婿豕/build.gradle縲榊盾辣ァ

險ュ螳壽ュ蝣ア繝輔ぃ繧、繝ォ

Gradle 險ュ螳壽婿豕/setting.gradle縲榊盾辣ァ

螳溯。

繧ウ繝槭Φ繝我ク隕ァ

繧ウ繝槭Φ繝 讖溯ス
-version
-v
繝舌シ繧ク繝ァ繝ウ陦ィ遉コ
init --type java-library 繝励Ο繧ク繧ァ繧ッ繝井ス懈
java Java繧ス繝シ繧ケ繧ウ繝シ繝峨ョ繧ウ繝ウ繝代う繝ォ
Jar縺ョ菴懈
窶サ髱昿xecutable
compileJava Java繧ス繝シ繧ケ繧ウ繝シ繝峨ョ繧ウ繝ウ繝代う繝ォ
class繝輔ぃ繧、繝ォ縺ョ菴懈
processResources 驟榊ク逕ィ繝ェ繧ス繝シ繧ケ繝輔ぃ繧、繝ォ縺ョ菴懈
窶サ縲慶lass縲阪ヵ繧ゥ繝ォ繝蜀
classes Java繧ス繝シ繧ケ繧ウ繝シ繝峨ョ繧ウ繝ウ繝代う繝ォ
驟榊ク逕ィ繝ェ繧ス繝シ繧ケ繝輔ぃ繧、繝ォ縺ョ菴懈
compileJavaシprocessResources
run Main繝。繧ス繝繝峨r謖√▽繧ッ繝ゥ繧ケ縺ョ螳溯。
application繝励Λ繧ー繧、繝ウ縲[ainClassName險ュ螳壹′蠢隕
test JUnit縺ォ繧医k繝繧ケ繝亥ョ溯。
jar
javadoc Javadoc縺ョ菴懈
build 繝薙Ν繝
clean 繝薙Ν繝峨↓繧医j菴懈舌&繧後◆繝輔ぃ繧、繝ォ繧貞炎髯、
蜀阪ン繝ォ繝峨ョ蜑阪↓菴ソ逕ィ
eclipse Eclipse繝励Ο繧ク繧ァ繧ッ繝育畑繝輔ぃ繧、繝ォ逕滓
tasks 繧ソ繧ケ繧ッ荳隕ァ陦ィ遉コ
(task蜷) 繧ソ繧ケ繧ッ螳溯。

繝励Ο繧ク繧ァ繧ッ繝井ス懈

gradle init --type java-library
螳溯。檎オ先棡(繝輔ぃ繧、繝ォ)
build.gradle
settings.gradle
gradlew
gradlew.bat
.gradle
笏3.4.1
縲笏杷ile-changes
縲縲笏罵ast-build.bin
縲笏杯askHistory
縲縲笏杷ileHashes.bin
縲縲笏杷ileSnapshots.bin
縲縲笏杯askHistory.bin
縲縲笏杯askHistory.lock
笏巴uildOutputCleanup
縲笏巴uilt.bin
縲笏把ache.properties
縲笏把ache.properties.lock
gradle
笏背rapper
縲笏波radle-wrapper.jar
縲笏波radle-wrapper.properties
src
笏芭ain
縲笏破ava
縲縲笏猫ibrary.java
笏杯est
縲笏破ava
縲縲笏猫ibraryTest.java

繝輔ぃ繧、繝ォ/繝輔か繝ォ繝 蜀螳ケ
縲.gradle縲阪ヵ繧ゥ繝ォ繝 繧ソ繧ケ繧ッ縺ァ逕滓舌&繧後◆繝輔ぃ繧、繝ォ遲峨′菫晏ュ倥&繧後k
縲携radle縲阪ヵ繧ゥ繝ォ繝 繝ゥ繝繝代シ繝輔ぃ繧、繝ォ(Gradle迺ー蠅髢「騾」)遲
縲茎rc縲阪ヵ繧ゥ繝ォ繝 繧ス繝シ繧ケ繧ウ繝シ繝蛾未騾」繝輔ぃ繧、繝ォ
gradlew縲“radlew.bat Gradle繧ウ繝槭Φ繝峨ヵ繧。繧、繝ォ
build.gradle 繝薙Ν繝画ュ蝣ア繝輔ぃ繧、繝ォ
settings.gradle 險ュ螳壽ュ蝣ア繝輔ぃ繧、繝ォ

繧ソ繧ケ繧ッ

窶サbuild.gradle
task hello <<{
縲println 'hello'
}

螳溯。檎オ先棡(逕サ髱「)
> gradle hello
:hello
hello
BUILD SUCCESSFUL

螳溯。檎オ先棡(繝輔ぃ繧、繝ォ)
build.gradle
.gradle
縲笏3.4.1
縲縲笏杷ile-changes
縲縲笏杯askHistory
縲縲縲笏杯askHistory.lock
縲縲笏杷ile-changes
縲縲縲笏罵ast-build.bin
縲笏巴uildOutputCleanup
縲縲笏巴uilt.bin
縲縲笏把ache.properties
縲縲笏把ache.properties.lock

Gradle Wrapper

窶サbuild.gradle
task wrapper(type: Wrapper) {
縲gradleVersion = '1.11'
}
螳溯。檎オ先棡(逕サ髱「)
> gradle wrapper
:wrapper
BUILD SUCCESSFUL

螳溯。檎オ先棡(繝輔ぃ繧、繝ォ)
build.gradle
gradlew
gradlew.bat
.gradle
縲笏3.4.1
縲縲笏杷ile-changes
縲縲縲笏罵ast-build.bin
縲縲笏杯askHistory
縲縲縲笏杷ileHashes.bin
縲縲縲笏杷ileSnapshots.bin
縲縲縲笏杯askHistory.bin
縲縲縲笏杯askHistory.lock
縲笏巴uildOutputCleanup
縲縲笏巴uilt.bin
縲縲笏把ache.properties
縲縲笏把ache.properties.lock
gradle
縲笏背rapper
縲縲笏波radle-wrapper.jar
縲縲笏波radle-wrapper.properties

Follow me!

蜑阪ョ險倅コ

Gradle 險ュ螳壽婿豕

谺。縺ョ險倅コ

Spring Boot 1 險ュ螳