Gradle
ä»å¹´ãæ®ããããã¨ãªãã¾ããããä»å¹´æåã¨ãªãã¨ã³ããªã¼ã¯ã G*ã¢ããã³ãã«ã¬ã³ãã¼ 2014ãã®ç¬¬24æ¥ç®ã®è¨äºã§ãã æ©ããã®ã§ Gradle ãã¯ããã¦ãããã¾ããªãï¼å¹´ãçµã¨ãã¨ãã¦ãã¾ãã ä»å¹´ã¯é·å¹´ã®æ²é¡ã§ãã£ãæ¥åã¸ã®å°å ¥ã«ãæåããé常ã«å â¦
ä»å¹´ãæ®ããããã¨ãªãã¾ããããä»å¹´æåã¨ãªãã¨ã³ããªã¼ã¯ ãG* Advent Calendar 2013ãã®12æ¥ç®ã§ãã çãã Gradle 使ã£ã¦ã¾ããï¼ èªåã¯ã¨è¨ãã¨â¦ æ®å¿µãªãããä»å¹´ãæ¥åã¸ã®æ¬æ ¼å°å ¥ã¯ã§ããªãã£ãã®ã§ã æ¥å¹´ããã¯å°å ¥ãããã¨ããææ°è¾¼ã¿ãè¾¼â¦
ä»åã Java ã§å ¨ææ¤ç´¢ã§ãã åå㯠Apache Lucene ã試ãã¾ããã ãæ¤ç´¢ã¨ã³ã¸ã³ã®å¸¸èãApache Solrã§èº«ã«ã¤ããã ã¨ãããã¨ã§ Apache Solr ã®ãã¢ã試ãã¦ã¿ã¾ããã ãã¡ãããä»åã誰ã§ã 60ç§ã§ ãã¢ã試ããããã« Gradle ã¹ã¯ãªãããä½ã£ã¦ã¿â¦
ä»æ´ãªãã Java ã§å ¨ææ¤ç´¢ã§ããã¨ãããã Apache Lucene ã® ãã¢ã試ãã¦ã¿ããã¨æã£ãã®ã§ãããææ°ãªãªã¼ã¹ã® 3.5.0 ã®æ å ±ãè¦å½ãããªãã£ãã®ã§ããã®éã誰ã§ã 60ç§ã§ ãã¢ã試ããããã« Gradle ã¹ã¯ãªãããä½ã£ã¦ã¿ã¾ããã ãã¢ã®ããã« ãâ¦
Gradle ã§ã¡ã¼ã«ãéããã¨ããã ã¯ã©ã¹ãã¹é¢ä¿ã§ã¯ã¾ã£ã¦ãã¾ã£ãã®ã§ã¡ã¢ãã¦ãããã ã©ããããant.mail ã使ãããã«ã¯ EmailTask (Ant ã®ã©ã¤ãã©ãª) ãèªã¿è¾¼ãã ã¯ã©ã¹ãã¼ãã«ç´æ¥ JavaMail é¢ä¿ã®ã©ã¤ãã©ãªã追å ãããããªãã£ã½ãã ã¯ã©ã¹ãâ¦
ãGradle ã§ã«ãã¬ãã¸ãè¨æ¸¬ãã¦ã¿ããã«å¼ãç¶ã EMMA ã¨ããããã¨ããã§ããã訳ãã£ã¦ Gradle ã§ã®ã«ãã¬ãã¸è¨æ¸¬ã«ã¯ Cobertura ã使ããã¨ã«ãã¾ããã ã¨è¨ãã®ã Jenkins CI ã® EMMA ãã©ã°ã¤ã³ã¨ã¯ ãã¾ãç¸æ§ãè¯ããªãããã ããã§ãã ãªã㨠Jâ¦
Gradle 㧠FindBugs ããæ¹æ³ã«ã¤ãã¦ã¯ id:kyon_mm ãããæ¢ã« ãGradleã§ç°¡åã«FindBugsã使ããããã«ãã¦ã¿ããã§æ¸ããã¦ãã¾ããã æè§ãªã®ã§ãããå°ãããæãã«ãã¦ã¿ã¾ããã å¤æ´ç¹ã¯5ã¤... ã¤ã³ã¯ãªã¡ã³ã¿ã«ãã«ãã«å¯¾å¿ãã ã©ã¤ãã©ãªã®åå¾â¦
åå㯠Gradle ã§ãã¹ãã並åã§å®è¡ãã¦ã¿ã¾ãããããã¹ãã¨è¨ãã°ãã«ãã¬ãã¸ã測å®ããªãã¨... ã¨è¨ããã¨ã§ãä»å㯠Gradle 㧠ãã¹ããå®è¡ãã¦ããã®éã®ã«ãã¬ãã¸ã測å®ãã¦ã¿ããã¨ã«... Java ã®ã«ãã¬ãã¸ãã¼ã«ã¨è¨ãã° Cobertura EMMA ãæåâ¦
Gradle ã® Java ãã©ã°ã¤ã³ã«ã¯ ãã¹ãã並åã§å®è¡ããããã®æ©è½ãæ¨æºã§ç¨æããã¦ãã¾ãã é常㯠ãã¹ãç¨ã®ããã»ã¹ã¯ 1ã¤ããç«ã¡ä¸ããã¾ãããã test.maxParallelForks = 5ã®ããã«è¨å®ããã° æ大 ï¼ããã»ã¹ã§ä¸¦åå®è¡ã§ããããã«ãªãã¾ãã ãâ¦
Spock ã JUnit ã®ãããªãã¹ããã¬ã¼ã ã¯ã¼ã¯ã¯ ç¶ç¶çã¤ã³ãã°ã¬ã¼ã·ã§ã³ã§ ãã®ç価ãçºæ®ããã¾ãã ã¨è¨ããã¨ã§ãä»å㯠Jenkins CI 㧠Spock ãã¦ã¿ã¾ããã Jenkins CI 㧠Spock ããã° (ãã¡ãã å®è¡ã¯ Gradle ã§...) ãããªæãã§åºåãã¦ããã¾â¦
Spock 㯠Java 㧠BDD (Behavior Driven Development) ããããã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãã ãã¡ãããGroovy ã§ã... Java ã®éçºã§ã¯ ããªãã¿ã® IDE (Eclipse) ã ãã«ããã¼ã« (Ant, Maven, Gradle) ã«ã対å¿ãã¦ããã®ã§ãããã¸ã§ã¯ãã¸ã®å°å ¥ã¯ã¨ã£ã¦ãç°¡â¦
Gradle ã§ã Maven ã Ivy ã¨åãããã«ç°¡åã«ã©ã¤ãã©ãªã®ä¾åé¢ä¿ã解決ãããã¨ãã§ãã¾ãã å é¨çã« Ivy ãå©ç¨ãã¦ãããããªã®ã§åããã¨ãã§ãã¦å½ç¶ãªã®ã§ãã... ã¾ã㯠ãªãã¸ããªã®è¨å®ãã... ã©ã¤ãã©ãªã®åå¾å ã® Maven ãªãã¸ããªã®ãã¹ã â¦
id:kyon_mm ããã® ãGradleã§ç°¡åã«FindBugsã使ããããã«ãã¦ã¿ãã ãè¦ã¦ã ã¾ã㯠Code Quality ãã©ã°ã¤ã³ã試ãã¦ã¿ã¾ããã Code Quality ãã©ã°ã¤ã³ã使ãã°ãç°¡åã« Checkstyle ã CodeNarc ã§ã³ã¼ãã£ã³ã°è¦ç´ããã§ãã¯ã§ãã¦è¯ãã®ã§ããããâ¦
Amazon EC2 ã§ã¯ ã¤ã³ã¹ã¿ã³ã¹çææ ããã㯠ãã®åã« Key Pair ãçæã㦠ã¯ã©ã¤ã¢ã³ãã«ç§å¯éµããã¦ã³ãã¼ããã¾ãã EC2 ã¤ã³ã¹ã¿ã³ã¹ã«ã¯ ãã®ç§å¯éµã使ã£ã¦ SSH ã§ãã°ã¤ã³ããã®ã§ããã å®ã¯ ãã®è¡çºã« ä»ã¾ã§ ãã£ã¨éåæãæãã¦ãã¾ããã â¦
æè¿ãããããã¨è©±é¡ã®å¤ã Amazon EC2 ã§ãã... å®ã¯ éçºç¨éã¨ãã¦ãé常ã«ä¾¿å©ã«å©ç¨ã§ããã¨ãããã¨ã«æè¿æ°ãã¤ãã¯ããã¾ããã ãã®ä¸ã¤ã JAWS-UG Nagoyaåå¼·ä¼ ç¬¬1å ã§ãçºè¡¨ããã¦ããã ãã Jenkins CI ã®åæ£ãã«ã (ãã¬ã¼ã³è³æã¯è¿æ¥å ¬â¦
ãµã¼ãã®ä½æ¥ã¯ã»ã¨ãã©ãèªååããã¦ããã¨æãã¾ããã ãããããµã¼ãã«ãã°ã¤ã³ãã¦ã³ãã³ããå®è¡ããªãã¦ã¯ãªããªãã®ã§é¢åã§ãã ã¯ã©ã¤ã¢ã³ãããç´æ¥æä½ã§ããã°ããã®ã«... ã¨è¨ããã¨ã§ Gradle 㧠SSH ã§ããã ãã ãä»ã®ã¨ãã Gradle èªä½â¦
Gradle ã«ã大åæ £ãã¦ãããããããã å®éã«ããã¸ã§ã¯ãã§ä½¿ããããã«æºåããªãã¨... ã¾ã㯠Jenkins CI 㧠Gradle ãå©ç¨ã§ããããã«æºåãããããªã ä»æã®ããã¸ã§ã¯ãã§ã¯ Jenkins CI ãããå½ããåã§ãããã ã¨è¨ããã¨ã§ãä»å㯠Jenkins CIâ¦
ååã¾ã§ã¯ Configslurper ã使ã£ã¦ ç°å¢æ¯ã«æ§æãå¤æ´ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ããã @literalice ããã« Gradleã§ããããã£ãªã©ã®è¨å®æ å ±ãå¤åºããã¦åãæ¿ãã¦ä½¿ã 㧠ç°å¢æ¯ã«å¥ã® Gradle ãã¡ã¤ã«ãåãè¾¼ã㧠ããããã¨å¤æ´ããæ¹æ³ãæãã¦ããã£â¦
ååãåã å ã¨æ¢ã«ï¼åãæ¸ãã¦ãããªãããªãã§ããã è¨å®ãã¡ã¤ã«ãèªã¿è¾¼ã㧠æ¨æºåºåããã ãã®ãµã³ãã«ãªãã¦ä½ã®å½¹ã«ãç«ããªã... ã¨è¨ããã¨ã§ãä»å㯠èªã¿è¾¼ãã è¨å®ã ã¢ããªã±ã¼ã·ã§ã³ã®ããããã£ãã¡ã¤ã«ã« å±éãã¦ã¿ããã¨ã«... çµå± buâ¦
ãããªå¤§å¤ãªã¨ãã«ãªãã§ãã... ä½ãããªããã㯠èªåã«ã§ãããã¨ãç¶ãã¦ãããï¼ï¼ ã¨è¨ããã¨ã§... id:fumokmm ãããã ConfigSlurper ã§è¤æ°ã®è¨å®ãã¡ã¤ã«ã®å 容ã ãã¼ã¸ããæ¹æ³ãæãã¦ããã£ãã®ã§ãä»å㯠ç°å¢ãã¨ã®æ§æã ããã©ã«ãè¨å® eâ¦
æ®å¿µãªãã ã¦ã¼ã¶ã¬ã¤ããè¦ãéãã ç¾ãã¼ã¸ã§ã³ (1.0-milestone-1) ã® Gradle ã«ã¯ ç°å¢æ¯ã«æ§æãå¤æ´ã§ãããããªæ©è½ (Maven ã® profile ã®ãããªæ©è½) 㯠å®è£ ããã¦ããªãããã§ãã å®éã«å®åã§ä½¿ãå ´åã絶対ã«å¿ è¦ãªæ©è½ã ã¨æãã®ã§ãã ãªãâ¦
ã¨ã£ã¦ã便å©ãª Gradle ã§ããã å®ã¯ããããã¤ã³ã¹ãã¼ã«ããªãã¦ã 誰ã§ãç°¡åã« Gradle ã§ããã¨ãããã¨ãçãããåç¥ã§ããï¼ ãã㯠Gradle Wrapper ã¨ããæ©è½ã§ ã¦ã¼ã¶ã¼ã¬ã¤ã ï¼ãã¡ãï¼ ã«ãã¡ããã¨è¨è¼ããã¦ãã¾ãã ã¡ãªã¿ã«ããã®æ©è½ã¯ Gâ¦
ååãGitHub ã Maven ãªãã¸ããªã«ããæ¹æ³ãæ¸ãã¾ãããã ææç©ã GitHub ã¸å ¬éããã«ã¯ ã³ãã³ãã§ã®æä½ãå¿ è¦ãªããçµæ§é¢åã§ãã ããããæ¯ååãã³ãã³ããå®è¡ãããââ 0.1.0 ãªãªã¼ã¹ã ã¿ãããªããããããªã³ãããã³ã¡ã³ãã æ¸ããªãã¦â¦
æè¿ã¯ Gradle ãã¨ã£ã¦ããæ°ã«å ¥ããªã®ã§ ãã©ã°ã¤ã³ã®éçºãå°ããã¤è¡ã£ã¦ããã®ã§ããã æè§ä½æãããã©ã°ã¤ã³ãã©ã¤ãã©ãªã Maven ãªãã¸ããªã§å ¬éããªãã¨å©ç¨ãã¥ããã®ã§ ã©ããå ¬éã§ããå ´æããªããæ¢ãã¦ããã¨ãã Github ã Maven å ¬éãªâ¦
ä»å㯠Gradle ã®ãã«ãããã¸ã§ã¯ããã«ãã®æ©è½ã使ã£ã¦ å®éã« ç°¡åãªã·ã³ã°ã«ããã¸ã§ã¯ãããã«ãããã¸ã§ã¯ãã«ç§»è¡ãã¦ã¿ããã¨ã«... ãã¡ãã 対象ã¨ããããã¸ã§ã¯ã㯠Gradle ã§ãã«ãã§ãããã¨ãåæã§ãã ãã£ã¬ã¯ããªæ§æ㯠次ã®ããã« ããâ¦
Gradle ã®ãã«ãããã¸ã§ã¯ããã«ã㯠ã¨ã«ãããã°ãããã ãã®ãã«ãããã¸ã§ã¯ããã«ãæ©è½ã®ããã« Gradle ã«ä¹ãæãã ããã¸ã§ã¯ããããã¨èããã¨ãããã ãããç´å¾ã§ããã èªåã Gradle ã使ã£ã¦ã¿ããã¨æã£ãã®ã ãã®æ©è½ã®ããã ãã æ¬â¦
Gradle ã æ¨æºã§ã¯ ã½ã¼ã¹ 㨠Javadoc ãã¢ã¼ã«ã¤ãã㦠Maven ãªãã¸ããªã«å ¬éãã¦ãããªããããªã®ã§ããã®æ¹æ³ãã¡ã¢ãæ¬å½ã¯ãã©ã°ã¤ã³ãããã¨è¯ããã ãã©... apply plugin: 'maven' // xxx-javadoc.jar çæ task packageJavadoc(type: Jar, dependâ¦
Gradle ã« Java ãã©ã°ã¤ã³ãé©ç¨ãã㨠ãªãã Zip ã¿ã¹ã¯ã åæã«å®è¡ããã¦ãã¾ãã¾ãã ã¡ãã£ã¨æ©ãã§ããã®ã§ããããªã㨠ç¯äººã¯ Java ãã©ã°ã¤ã³ã® assemble ã¿ã¹ã¯ã ã£ãã®ã§ãã ããã ããã¯å ¨ç¶åé¡ã§ã¯ãªãããã¥ã¡ã³ãã«ãæ¸ãã¦ããæ´ã¨ãâ¦
ä»æ´ã§ãã Gradle ã«ã¤ãã¦... Gradle 㯠Make, Ant, Maven ã«ã¤ã 第4 ã®ãã«ããã¼ã«ã§ãã ä»ã®ãã«ããã¼ã«ããã®ç§»è¡ãå§ãã¦ããããã¸ã§ã¯ããããªãå¢ãã¦ãããæè¿ æ³¨ç®ããã¦ãããã¼ã«ã®ä¸ã¤ã§ãã Gradle ã®ç¹å¾´ãç°¡åã«è¨ã£ã¦ãã¾ãã¨ã Makeâ¦
çªç¶ã§ãããã¿ãªãã㯠task hello << { println 'Hello, world.' }㨠task hello { println 'Hello, world.' }ã®éãããããã¾ããï¼ ä¸è¨ã®éãã¯ãã£ãï¼æå ã ãã§ãã ã¨ãããããã®ãã£ãï¼æåã§ å ¨ãæå³ãå¤ãã£ã¦ãã¾ãã®ã§æ³¨æãã¾ãããã â¦