ä»æ´ãªã¿ã¤ãã«ã§ããâ¦
incubatingãªAPI㧠plugins DSLã¨å¼ã°ãã¦ããæ¹æ³ã§ããplugins DSLã¯gradleã®plugin repositoryã«ãããã©ã°ã¤ã³ãid(ã¨ãã¼ã¸ã§ã³)ã ãã§å¼ã£å¼µã£ã¦ãããããã«ããæ¹æ³ã§ãgradleã®2.10ãããã«ç»å ´ãã¦ãã¾ããgradleã«ããã©ã«ãã«æ·»ä»ããã¦ãããã©ã°ã¤ã³ã¨gradle ã®plugin repository ã«ãããã©ã°ã¤ã³ä»¥å¤ããã®DSLã§æå®ããæ¹æ³ã¯ç»å ´ããå½åã¯ãªãã£ãã®ã§ãããæè¿ã¯settings.gradleã§é å¼µãã°ã§ããã¨ãããã¨(ããã¦ãmultipleãªããã¸ã§ã¯ãã«ãªãã¨ããã便å©ã«ãªãã¨ãããã¨)ãæãã¦ããã£ãã®ã§ãå¿ãã¦ãããããã«ã¡ã¢ãã¦ããã¾ãã
å®ä¾ã¨ãã¦JUnit5ã®ãã©ã°ã¤ã³ org.junit.platform.gradle.plugin
ã使ãã¾ãã
plugins
ãããã¯ã®ä¸ã«é©ç¨ãããã©ã°ã¤ã³ã®idãè¨å
¥ãã¾ãã
plugins { id 'java' id 'org.junit.platform.gradle.plugin' }
gradleã®æ¨å¥¨ãããã©ã°ã¤ã³ã®ååã¯ããã±ã¼ã¸åã¨åããããªååã§ãã id.namespace
+ id.name
ã®ããã§ããJUnit5ã®ãã©ã°ã¤ã³ã®å ´åã§ãã¨ã org.junit.platform.gradle
ã id.namespace
㧠plugin
ã id.name
ã§ããéã«è¨ãã°ãæå¾ã®ãããããå³ã id.name
å·¦ã id.namespace
ã§ãã
org.junit.platform.gradle.plugin
㯠gradle plugin repository ã«ã¯ãªãã®ã§ããã©ã°ã¤ã³ã«ä½¿ãããartifactã®è§£æ±ºãããªããã°ãªãã¾ãããartifactã解決ããæ¹æ³ã¨ã㦠pluginManagement
DSLãããããã settings.gradle
ãã¡ã¤ã«ã«è¨è¿°ãã¾ãã
pluginManagement { }
pluginManagement
DSLå
é¨ã§ã¯äºã¤ã®ãããã¯ãæ¸ãã¾ããä¸ã¤ã¯ repositories
ãããã¯ã§ããããã¡ãã¯ååãããããããã«ã¬ãã¸ããªã¼ã®URLãè¨è¿°ãã¦ããã¾ããããä¸ã¤ã¯ resolutionStrategy
ã§ããããã¡ãã«ã¯ãã©ã°ã¤ã³ã®ååããã©ã®artifactã使ãããè¨è¿°ãã¾ãã
repositories
ãããã¯ã«ã¯1ã¤ã®ãããã¯ã¨1ã¤ã®ã¡ã½ãããæä¾ããã¦ãã¾ãã maven
ãããã¯ã§ã¯gradle plugin repository以å¤ã®ã¬ãã¸ããªã¼ã®URLãè¨è¿°ãã¾ãã gradlePluginPotal
ã¡ã½ãããå¼ã³åºã㨠gradle plugin repository ã使ã宣è¨ãã§ãã¾ããgradle plugin repository ãä¸è¦ãªå ´å㯠gradlePluginPotal
ãå¼ã³åºããªããã°ããã§ãããªããmaven centralãjcenterãªã©ã®ããªãã¿ã®ã¡ã½ãããçãã¦ããªãã®ã§ãããããã®URLãæ¸ããªããã°ãªãã¾ãããJUnit5ã®ä¾ã§ã¯ããã©ã°ã¤ã³ã®jarã¯maven centralã«ããã®ã§ãmaven
ãããã¯ã®ä¸ã§maven central ã®URLãæå®ãã¾ãã
repositories {
maven {
url ('http://repo1.maven.org/maven2/')
}
gradlePluginPortal()
}
resolutionStrategy
ãããã¯ã®ä¸ã« eachPlugin
ãããã¯ãæ¸ãã¦ããã®ä¸ã§ãã©ã°ã¤ã³ã®id(ããã³ãã¼ã¸ã§ã³)ã¨ãã®æ±ãã決å®ãã¾ã
requested
ã¨ããããããã£ã«æå®ãããã©ã°ã¤ã³ã®idãªã©ã®èå¥ããæ
å ±ãå«ã¾ãã¦ãã¾ãã requested
ã®ä¸ã«ã¯3ã¤ã®ããããã£(id
ã module
ã version
)ãå«ã¾ãã¦ãã¾ãããå¤ãã®å ´å㯠id
以å¤ã¯ null
ã§ãã requested.id
ã®ä¸ã«ã¯æ¬¡ã®ããããã£ãå«ã¾ãã¦ãã¾ãã
id
:String
-id
ã®æåå表ç¾name
:String
-id
ã®name
(æå¾ã®ãããããå³)namespace
:String
-id
ã®namespace
(æå¾ã®ãããããå·¦)
ããã if
æãªã©ã§ãããã³ã°ããã¦ã eachPlugin
ãããã¯ã«çãã¦ãã useModule
ã¡ã½ãããã artifact ãæå®ãã¾ããartifact ã®æå®æ¹æ³ã¯ dependencies
ãããã¯ã§ã®æå®æ¹æ³ã¨åãã§ããJUnit5ã®ä¾ã§ã¯ãã©ã°ã¤ã³ã®idã org.junit.platform.gradle.plugin
ã®å ´åã« org.junit.platform:junit-platform-gradle-plugin:1.0.0
ã使ãããã®ã§ããã®ãããªãããã³ã°ã¨ useModule
ã®æå®ããã¾ã
resolutionStrategy { eachPlugin { if (requested.id.id == 'org.junit.platform.gradle.plugin') { useModule 'org.junit.platform:junit-platform-gradle-plugin:1.0.0' } } }
以ä¸ã®å 容ãåãããã¨æ¬¡ã®ãããªã¹ã¯ãªãããã§ãã¾ã
pluginManagement { repositories { maven { url 'http://repo1.maven.org/maven2/' } } resolutionStrategy { eachPlugin { if (requested.id.id == 'org.junit.platform.gradle.plugin') { useModule 'org.junit.platform:junit-platform-gradle-plugin:1.0.0' } } } }
ãªãã pluginManagement
ãããã¯ã¯ settings.gradle
ã®ä¸ã§ä¸çªæåã«æ¸ããªãã¨ãããªãããã§ã
ããã¾ã§è©¦ããæãã§ãããããã¨é¢åã§ãããã subprojects
ãããã¯ã§æ°ãããã©ã°ã¤ã³ãèªã¿è¾¼ã¾ããæ¹æ³ãªã©ãèããã¨ãè´ãæ¹ãªãã®ããªãã¨ããæ°æã¡ã«ãªãã¾ã
ãã¨ãéä¸æåã太ããªã£ã¦ãããã¾ãããåã ã®ã¿ã¤ãã«ãèããã®ãé¢åã§ããã¹ã¦h5ã§è¨è¿°ãã¦ãã¾ããâ¦