import Ġorg . anti _ ad . mc . configure Compilation Ċ import Ġorg . anti _ ad . mc . configure Dependencies Ċ import Ġorg . jetbrains . kotlin . gradle . tasks . Kotlin Compile Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġ` java - library ` ĊĠĠĠ Ġ` maven - publish ` ĊĠĠĠ Ġidea ĊĠĠĠ Ġantlr Ċ Ċ } Ċ Ċ configure Compilation ( true ) Ċ configure Dependencies () Ċ Ċ group Ġ= Ġ" org . anti - ad . mc " ĊĊĊ Ċ dependencies Ġ{ ĊĊĠĠĠ Ġval Ġantlr Version Ġ= Ġ" 4 . 9 . 2 " ĊĠĠĠ Ġ" antlr " (" org . antlr : antlr 4 :$ antlr Version ") ĊĠĠĠ Ġ" implementation " (" org . antlr : antlr 4 - runtime :$ antlr Version ") ĊĠĠĠ Ġ" implementation " (" org . jetbrains . kotlin x : kotlin x - serialization - json : 1 . 3 . 0 ") ĊĠĠĠ Ġ" compile Only Api "( group Ġ= Ġ" org . apache . logging . log 4 j ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġname Ġ= Ġ" log 4 j - api ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġversion Ġ= Ġ" 2 . 1 4 . 1 ") ĊĠĠĠ Ġ" compile Only Api "( group Ġ= Ġ" org . lwjgl ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġname Ġ= Ġ" lwjgl - glfw ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġversion Ġ= Ġ" 3 . 2 . 2 ") Ċ } ĊĊ Ċ apply ( plugin Ġ= Ġ" kotlin x - serialization ") Ċ Ċ val Ġcompile Kotlin : ĠKotlin Compile Ġby Ġtasks Ċ compile Kotlin . kotlin Options Ġ{ ĊĠĠĠ Ġlanguage Version Ġ= Ġ" 1 . 5 " ĊĠĠĠ Ġfree Compiler Args Ġ= Ġfree Compiler Args Ġ+ ĠlistOf ("- X opt - in = kotlin . Requires Opt In ") Ċ } Ċ Ċ tasks . named < Ant lr Task >(" generate Grammar Source "). configure Ġ{ ĊĠĠĠ Ġval Ġpkg Ġ= Ġ" org . anti _ ad . mc . common . gen " ĊĠĠĠ Ġoutput Directory Ġ= Ġfile (" build / generated - src / antlr / main /${ pkg . replace ('.', Ġ'/') }") ĊĠĠĠ Ġarguments Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġ"- visitor ", Ġ"- package ", Ġpkg , ĊĠĠĠĠĠĠĠ Ġ"- X exact - output - dir " ĊĠĠĠ Ġ) Ċ } Ċ Ċ tasks . named (" compile Kotlin ") Ġ{ ĊĠĠĠ Ġdepends On (" generate Grammar Source ") Ċ } Ċ Ċ tasks . named (" compile Java ") Ġ{ ĊĠĠĠ Ġdepends On (" generate Grammar Source ") Ċ } ĊĊ Ċ tasks . with Type < Java Compile >(). configure Each Ġ{ ĊĠĠĠ Ġdepends On (" generate Grammar Source ") Ċ } Ċ Ċ plugins . with Id (" idea ") Ġ{ ĊĠĠĠ Ġconfigure < org . gradle . plugins . ide . idea . model . Ide a Model > Ġ{ ĊĠĠĠĠĠĠĠ Ġafter Evaluate Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodule . source Dirs . add ( file (" src / main / antlr ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodule . source Dirs . add ( file (" build / generated - src / antlr / main ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// module . generated Source Dirs . add ( file (" build / generated - src / antlr / main ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ val Ġjavadoc Ġ= Ġtasks . named < Javadoc >(" javadoc ") Ġ{ ĊĠĠĠ Ġthis . title Ġ= Ġ" Inventory ĠPro files ĠNext ĠAPI " ĊĊĠĠĠ Ġsource Ġ= Ġproject . file Tree (" src / main / java / org / anti _ ad / mc / ip n / api /") ĊĊĠĠĠ Ġclasspath Ġ= Ġproject . file Tree ("/") Ġ{ ĊĠĠĠĠĠĠĠ Ġinclude (" src / main / java /") ĊĠĠĠ Ġ} ĊĠĠĠ Ġclasspath Ġ+= Ġconfigurations . compile Classpath . get () Ċ Ċ } Ċ Ċ tasks . create < Jar >(" package Javadoc ") Ġ{ ĊĠĠĠ Ġfrom ( javadoc ) ĊĠĠĠ Ġarchive Classifier . set (" javadoc ") Ċ } Ċ Ċ tasks . named < Default Task >(" build ") Ġ{ ĊĠĠĠ Ġdepends On (" javadoc ") ĊĠĠĠ Ġdepends On (" package Javadoc ") Ċ } ĊĊ