/* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 1 9 ĠPract ice ĠIns ight ĠP ty ĠLtd . ĠAll ĠRights ĠReserved . Ċ Ġ*/ Ċ Ċ build script Ġ{ ĊĠ Ġrepositories Ġ{ ĊĠĠĠ Ġmaven Central () ĊĠĠĠ Ġmaven Ġ{ ĊĠĠĠĠĠ Ġ// ĠW T Ġpublished Ġreleases ĊĠĠĠĠĠ Ġset Url (" https :// s 3 . eu - central - 1 . amazonaws . com / artifacts . wi set ime . com / mvn 2 / plugins ") ĊĠĠĠĠĠ Ġcontent Ġ{ ĊĠĠĠĠĠĠĠ Ġinclude Group (" io . wi set ime ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ plugins Ġ{ ĊĠ Ġjava ĊĠ Ġidea ĊĠ Ġid (" fr . bro u ill ard . oss . gradle . j git ver ") Ġversion Ġ" 0 . 9 . 1 " ĊĠ Ġid (" com . google . cloud . tools . j ib ") Ġversion Ġ" 3 . 0 . 0 " ĊĠ Ġid (" com . github . ben - man es . versions ") Ġversion Ġ" 0 . 3 8 . 0 " ĊĠ Ġid (" io . wi set ime . version Checker ") Ġversion Ġ" 1 0 . 1 1 . 6 2 " ĊĠ Ġid (" io . free fair . lo mbok ") Ġversion Ġ" 5 . 3 . 0 " Ċ } Ċ Ċ apply ( from Ġ= Ġ"$ rootDir / gradle / conf / check style . gradle ") Ċ apply ( from Ġ= Ġ"$ rootDir / gradle / conf / jac oco . gradle ") Ċ Ċ java Ġ{ ĊĠ Ġtoolchain Ġ{ ĊĠĠĠ Ġlanguage Version . set ( Java Language Version . of ( 1 1 )) ĊĠĠĠ Ġvendor . set ( Jvm Vendor Spec . AD OP TOP EN JDK ) ĊĠĠĠ Ġimplementation . set ( Jvm Implementation . J 9 ) ĊĠ Ġ} ĊĠ Ġconsistent Resolution Ġ{ ĊĠĠĠ Ġuse Compile Classpath Versions () ĊĠ Ġ} Ċ } Ċ Ċ group Ġ= Ġ" io . wi set ime " Ċ Ċ j ib Ġ{ ĊĠ Ġcontainer Ġ{ ĊĠĠĠ Ġports Ġ= ĠlistOf (" 9 1 0 0 ") ĊĠĠĠ Ġmain Class Ġ= Ġ" io . wi set ime . connector . sql _ time _ post . Connector Launcher " ĊĠĠĠ Ġj vm Flags Ġ= ĠlistOf ("- server ", Ġ"- D java . awt . headless = true ") ĊĠ Ġ} ĊĠ Ġfrom Ġ{ ĊĠĠĠ Ġimage Ġ= Ġ" gcr . io / wise - pub / connect - java - 1 1 - j 9 @ sha 2 5 6 : 9 8 ec 5 f 0 0 5 3 9 bd ff eb 6 7 8 c 3 b 4 a 3 4 c 0 7 c 7 7 e 4 4 3 1 3 9 5 2 8 6 ecc 6 a 0 8 3 2 9 8 0 8 9 b 3 d 0 ec " ĊĠ Ġ} ĊĠ Ġto Ġ{ ĊĠĠĠ Ġproject . after Evaluate Ġ{ Ġ// Ġ<-- Ġso Ġwe Ġevaluate Ġversion Ġafter Ġit Ġhas Ġbeen Ġset ĊĠĠĠĠĠ Ġimage Ġ= Ġ" wi set ime / wi set ime - sql - time - post - connector :${ project . version }" ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ repositories Ġ{ ĊĠ Ġmaven Central () ĊĠ Ġmaven Ġ{ ĊĠĠĠ Ġ// ĠOur Ġpublished Ġreleases Ġrepo ĊĠĠĠ Ġset Url (" https :// s 3 . eu - central - 1 . amazonaws . com / artifacts . wi set ime . com / mvn 2 / releases ") ĊĠĠĠ Ġcontent Ġ{ ĊĠĠĠĠĠ Ġinclude Group (" io . wi set ime ") ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ tasks . with Type ( com . google . cloud . tools . j ib . gradle . J ib Task :: class . java ) Ġ{ ĊĠ Ġdepends On ( tasks . compile Java ) ĊĠ Ġonly If Ġ{ ĊĠĠĠ Ġval Ġversion Calculator Ġ= Ġfr . bro u ill ard . oss . j git ver . Git Version Calculator . location ( project . rootDir ) ĊĠĠĠĠĠ Ġ. setAuto Increment Patch ( false ) ĊĠĠĠĠĠ Ġ. set Use Dirty ( true ) ĊĠĠĠ Ġval Ġbranch Name Ġ= Ġversion Calculator . meta ( fr . bro u ill ard . oss . j git ver . metadata . Met adat as . BRANCH _ NAME ). orElse ("") ĊĠĠĠ Ġbranch Name Ġ== Ġ" master " ĊĠ Ġ} Ċ } Ċ Ċ if Ġ( gradle . start Parameter . task Requests . toString (). contains (" dependency Updates ")) Ġ{ ĊĠ Ġ// Ġadd Ġex clusions Ġfor Ġreporting Ġon Ġupdates Ġand Ġvulner abilities ĊĠ Ġapply ( from Ġ= Ġ"$ rootDir / gradle / version Plugin Config . gradle ") Ċ } Ċ Ċ dependencies Ġ{ ĊĠ Ġimplementation (" io . wi set ime : wi set ime - connector : 3 . 0 . 1 3 ") ĊĊĠ Ġimplementation (" com . google . inject : gu ice : 5 . 0 . 1 ") Ġ{ ĊĠĠĠ Ġexclude ( group Ġ= Ġ" com . google . gu ava ", Ġmodule Ġ= Ġ" gu ava ") ĊĠ Ġ} ĊĠ Ġimplementation (" com . google . gu ava : gu ava : 3 0 . 1 - jre ") ĊĊĠ Ġimplementation (" org . code j argon : fluent jdbc : 1 . 8 . 6 ") ĊĠ Ġimplementation (" com . zaxxer : Hikari CP : 3 . 3 . 1 ") ĊĠ Ġimplementation (" com . microsoft . sql server : mss ql - jdbc : 6 . 4 . 0 . jre 8 ") ĊĠ Ġimplementation (" mysql : mysql - connector - java : 8 . 0 . 2 1 ") Ġ{ ĊĠĠĠ Ġexclude ( group Ġ= Ġ" com . google . protobuf ", Ġmodule Ġ= Ġ" protobuf - java ") ĊĠ Ġ} ĊĠ Ġimplementation (" org . postgresql : postgresql : 4 2 . 2 . 1 6 ") ĊĊĠ Ġimplementation (" org . yaml : s na key aml : 1 . 2 4 ") ĊĊĠ Ġtest Implementation (" org . junit . jupiter : junit - jupiter : 5 . 4 . 2 ") ĊĠ Ġtest Implementation (" org . mockito : mockito - core : 2 . 2 7 . 0 ") ĊĠ Ġtest Implementation (" org . assertj : assertj - core : 3 . 1 2 . 2 ") ĊĠ Ġtest Implementation (" org . fly way db : fly way - core : 7 . 5 . 4 ") ĊĠ Ġtest Implementation (" com . github . java faker : java faker : 0 . 1 7 . 2 ") Ġ{ ĊĠĠĠ Ġexclude ( group Ġ= Ġ" org . apache . commons ", Ġmodule Ġ= Ġ" commons - lang 3 ") ĊĠ Ġ} ĊĠ Ġtest Implementation (" io . wi set ime : wi set ime - test - support : 2 . 6 . 1 3 ") Ċ } Ċ Ċ configurations . all Ġ{ ĊĠ Ġresolution Strategy Ġ{ ĊĠĠĠ Ġeach Dependency Ġ{ ĊĠĠĠĠĠ Ġif Ġ( requested . group Ġ== Ġ" com . fasterxml . jackson . core ") Ġ{ ĊĠĠĠĠĠĠĠ Ġuse Version (" 2 . 1 2 . 3 ") ĊĠĠĠĠĠĠĠ Ġbecause (" use Ġconsistent Ġversion Ġfor Ġall Ġtrans itive Ġdependencies ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġif Ġ( requested . name Ġ== Ġ" commons - lang 3 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġuse Version (" 3 . 1 2 . 0 ") ĊĠĠĠĠĠĠĠ Ġbecause (" use Ġconsistent Ġversion Ġfor Ġall Ġtrans itive Ġdependencies ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ tasks . register < Default Task >(" print Version Str ") Ġ{ ĊĠ Ġdo Last Ġ{ ĊĠĠĠ Ġprintln ("${ project . version }") ĊĠ Ġ} Ċ } Ċ Ċ tasks . test Ġ{ ĊĠ Ġuse JUnit Platform () ĊĠ Ġtest Logging Ġ{ ĊĠĠĠ Ġ// Ġ" passed ", Ġ" skipped ", Ġ" failed " ĊĠĠĠ Ġevents (" skipped ", Ġ" failed ") ĊĠ Ġ} Ċ } Ċ Ċ tasks . clean Ġ{ ĊĠ Ġdelete ("${ project Dir }/ out ") Ċ } Ċ Ċ j git ver Ġ{ ĊĠ Ġauto Increment Patch ( false ) ĊĠ Ġstrategy ( fr . bro u ill ard . oss . j git ver . Str ategies . PATTERN ) ĊĠ Ġversion Pattern ("\ ${ meta . CURRENT _ VERSION _ MAJOR }. \ ${ meta . CURRENT _ VERSION _ MINOR }. \ ${ meta . COMMIT _ DISTANCE }") ĊĠ Ġregex Version Tag (" v (\\ d + \\. \\ d +( \\. 0 )? )") Ċ } Ċ