import Ġnl . jav ad ude . gradle . plugins . license . License Extension Ċ import Ġorg . gradle . rewrite . build . Gradle Version Data Ċ import Ġorg . gradle . rewrite . build . Gradle Versions CommandLine Argument Provider Ċ import Ġjava . util .* Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġjava ĊĠĠĠ Ġgro ovy ĊĠĠĠ Ġ` java - gradle - plugin ` ĊĠĠĠ Ġid (" com . gradle . plugin - publish ") Ġversion Ġ(" 0 . 1 3 . 0 ") ĊĠĠĠ Ġ// Ġid (" com . github . hi ery nom us . license ") Ġversion Ġ" 0 . 1 5 . 0 " Ġapply Ġfalse ĊĠĠĠ Ġ` maven - publish ` Ċ } Ċ Ċ apply ( plugin Ġ= Ġ" license ") Ċ Ċ plugin Bundle Ġ{ ĊĠĠĠ Ġwebsite Ġ= Ġ" https :// github . com / shadow x ie hao / repair er - gradle - plugin " ĊĠĠĠ Ġv cs Url Ġ= Ġ" https :// github . com / shadow x ie hao / repair er - gradle - plugin . git " ĊĠĠĠ Ġtags Ġ= ĠlistOf (" rewrite ", Ġ" refactor ing ", Ġ" java ", Ġ" check style "," repair er ") Ċ } Ċ Ċ // ĠFixed Ġversion Ġnumbers Ġbecause Ġcom . gradle . plugin - publish Ġwill Ġpublish Ġpom s Ġwith Ġrequested Ġrather Ġthan Ġresolved Ġversions Ċ val Ġrewrite Version Ġ= Ġ" 7 . 2 . 1 " Ċ val Ġprometheus Version Ġ= Ġ" 1 . 3 . 0 " Ċ val Ġnet ty Version Ġ= Ġ" 1 . 1 . 0 " Ċ val Ġrepair er Version =" 0 . 9 . 1 " Ċ val Ġrepair er Group =" com . v if im . repair er " Ċ Ċ group Ġ= Ġ"$ repair er Group " Ċ version Ġ= Ġ"$ repair er Version " Ċ gradle Plugin Ġ{ ĊĠĠĠ Ġplugins Ġ{ ĊĠĠĠĠĠĠĠ Ġcreate (" rewrite Metrics ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġid Ġ= Ġ" com . v if im . repair er - metrics " ĊĠĠĠĠĠĠĠĠĠĠĠ ĠdisplayName Ġ= Ġ" Rewrite Ġmetrics Ġpublishing " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdescription Ġ= Ġ" Publish Ġmetrics Ġabout Ġrefactoring Ġoperations Ġhappening Ġacross Ġyour Ġorganization ." ĊĠĠĠĠĠĠĠĠĠĠĠ Ġimplementation Class Ġ= Ġ" org . open rewrite . gradle . Rewrite Metrics Plugin " ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġcreate (" rewrite ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġid Ġ= Ġ" com . v if im . repair er " ĊĠĠĠĠĠĠĠĠĠĠĠ ĠdisplayName Ġ= Ġ" Repair er " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdescription Ġ= Ġ" Autom atically Ġeliminate Ġtechnical Ġde bt " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġimplementation Class Ġ= Ġ" org . open rewrite . gradle . Rewrite Plugin " ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġmaven Central () ĊĠĠĠ Ġmaven Local () Ċ } Ċ Ċ configurations . all Ġ{ ĊĠĠĠ Ġresolution Strategy Ġ{ ĊĠĠĠĠĠĠĠ Ġcache Changing Modules For ( 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ Ġcache Dynamic Versions For ( 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ java Ġ{ ĊĠĠĠ Ġsource Compatibility Ġ= ĠJava Version . VERSION _ 1 _ 8 ĊĠĠĠ Ġtarget Compatibility Ġ= ĠJava Version . VERSION _ 1 _ 8 Ċ } Ċ Ċ tasks . named < Java Compile >(" compile Java ") Ġ{ ĊĠĠĠ Ġoptions . is Fork Ġ= Ġtrue ĊĠĠĠ Ġoptions . fork Options . executable Ġ= Ġ" javac " ĊĠĠĠ Ġoptions . compiler Args . addAll ( listOf ("-- release ", Ġ" 8 ")) Ċ } Ċ Ċ val Ġplugin : ĠConfiguration Ġby Ġconfigurations . creating Ċ Ċ configurations . get ByName (" compile Only "). extends From ( plugin ) ĊĊĊ Ċ // Ġconfigurations . all Ġ{ Ċ // ĠĠĠĠ Ġresolution Strategy . each Dependency Ġ{ Ċ // ĠĠĠĠĠĠĠĠ Ġif Ġ( requested . group Ġ== Ġ" org . open rewrite ") Ġ{ Ċ // ĠĠĠĠĠĠĠĠĠĠĠĠ Ġuse Version ( rewrite Version ) Ċ // ĠĠĠĠĠĠĠĠ Ġ} Ċ // ĠĠĠĠ Ġ} Ċ // Ġ} Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġplugin (" org . open rewrite : rewrite - java :$ rewrite Version ") ĊĠĠĠ Ġplugin (" io . micro meter . prometheus : prometheus - r socket - client :$ prometheus Version ") ĊĠĠĠ Ġplugin (" io . r socket : r socket - transport - netty :$ netty Version ") ĊĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - java - 1 1 :$ rewrite Version ") ĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - java - 8 :$ rewrite Version ") ĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - xml :$ rewrite Version ") ĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - maven :$ rewrite Version ") ĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - properties :$ rewrite Version ") ĊĠĠĠ Ġimplementation (" org . open rewrite : rewrite - yaml :$ rewrite Version ") ĊĊĠĠĠ Ġapi ( project (": rewrite - java - repair er ")) ĊĠĠĠ Ġ// Ġapi (" org . open rewrite : rewrite - java :$ rewrite Version ") ĊĠĠĠ Ġapi (" io . micro meter . prometheus : prometheus - r socket - client :$ prometheus Version ") ĊĠĠĠ Ġapi (" io . r socket : r socket - transport - netty :$ netty Version ") ĊĊĠĠĠ Ġtest Implementation ( gradle Test Kit ()) ĊĠĠĠ Ġtest Implementation (" org . codehaus . groovy : groovy - all : 2 . 5 . 1 0 ") ĊĠĠĠ Ġtest Implementation (" org . sp ock framework : sp ock - core : 1 . 3 - groovy - 2 . 5 ") Ċ } Ċ Ċ tasks . plugin UnderTest Metadata Ġ{ ĊĠĠĠ Ġplugin Classpath . from ( plugin ) Ċ } Ċ Ċ // Ġproject . root Project . tasks . get ByName (" post Release "). depends On ( project . tasks . get ByName (" publish Plugins ")) Ċ Ċ tasks . named < Test >(" test ") Ġ{ ĊĠĠĠ Ġsystem Property ( ĊĠĠĠĠĠĠĠ ĠGradle Versions CommandLine Argument Provider . PROPERTY _ NAME , ĊĠĠĠĠĠĠĠ Ġproject . find Property (" tested Gradle Version ") Ġ?: Ġgradle . gradle Version ĊĠĠĠ Ġ) Ċ } Ċ Ċ tasks . register < Test >(" test Gradle Releases ") Ġ{ ĊĠĠĠ Ġj vm Argument Providers . add ( Gradle Versions CommandLine Argument Provider ( Gradle Version Data :: get Released Versions )) Ċ } Ċ Ċ tasks . register < Test >(" test Gradle Night lies ") Ġ{ ĊĠĠĠ Ġj vm Argument Providers . add ( Gradle Versions CommandLine Argument Provider ( Gradle Version Data :: get Night ly Versions )) Ċ } Ċ Ċ configure < License Extension > Ġ{ ĊĠĠĠ Ġext . set (" year ", ĠCalendar . getInstance (). get ( Calendar . YEAR )) ĊĠĠĠ Ġskip Existing Headers Ġ= Ġtrue ĊĠĠĠ Ġheader Ġ= Ġproject . root Project . file (" gradle / license Header . txt ") ĊĠĠĠ Ġmapping ( map Of (" kt " Ġto Ġ" SL ASH STAR _ STYLE ", Ġ" java " Ġto Ġ" SL ASH STAR _ STYLE ")) ĊĠĠĠ Ġstrict Check Ġ= Ġtrue Ċ } ĊĊ Ċ publishing Ġ{ ĊĠĠĠ Ġrepositories Ġ{ Ċĉ ĉ maven Local () Ċ ĉ } ĊĠĠĠ Ġpublications Ġ{ ĊĠĠĠĠĠĠĠ Ġcreate < Maven Publication >(" maven ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠgroupId Ġ= Ġ"$ repair er Group " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġartifact Id Ġ= Ġ" repair er " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġversion Ġ= Ġ"$ repair er Version " ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom ( components [" java "]) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }