val Ġmaven _ group : ĠString Ġby Ġproject Ċ val Ġmod _ version : ĠString Ġby Ġproject Ċ val Ġarch ives _ base _ name : ĠString Ġby Ġproject Ċ val Ġm inecraft _ version : ĠString Ġby Ġproject Ċ val Ġyarn _ mappings : ĠString Ġby Ġproject Ċ val Ġloader _ version : ĠString Ġby Ġproject Ċ val Ġfabric _ version : ĠString Ġby Ġproject Ċ Ċ val Ġcommon Ġ= Ġproject (": MC API - common ") Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġid (" fabric - loom ") Ġversion Ġ" 0 . 2 . 6 - SNAPSHOT " ĊĠĠĠ Ġ` maven - publish ` Ċ } Ċ Ċ java Ġ{ ĊĠĠĠ Ġsource Compatibility Ġ= ĠJava Version . VERSION _ 1 _ 8 ĊĠĠĠ Ġtarget Compatibility Ġ= ĠJava Version . VERSION _ 1 _ 8 Ċ } Ċ Ċ base Ġ{ ĊĠĠĠ Ġarch ives Base Name Ġ= Ġarch ives _ base _ name Ċ } Ċ Ċ group Ġ= Ġmaven _ group Ċ version Ġ= Ġmod _ version Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġmaven Local () ĊĠĠĠ Ġmaven ( url Ġ= Ġ" http :// maven . fabric mc . net ") Ġ{ ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġ" Fabric " ĊĠĠĠ Ġ} Ċ } Ċ Ċ minecraft Ġ{ Ċ } Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġ// to Ġchange Ġthe Ġversions Ġsee Ġthe Ġgradle . properties Ġfile ĊĠĠĠ Ġm inecraft (" com . moj ang : minecraft :${ minecraft _ version }") ĊĠĠĠ Ġmappings (" net . fabric mc : yarn :${ yarn _ mappings }: v 2 ") ĊĠĠĠ Ġmod Compile (" net . fabric mc : fabric - loader :${ loader _ version }") ĊĊĠĠĠ Ġ// ĠFabric ĠAPI . ĠThis Ġis Ġtechnically Ġoptional , Ġbut Ġyou Ġprobably Ġwant Ġit Ġanyway . ĊĠĠĠ Ġmod Compile (" net . fabric mc . fabric - api : fabric - api :${ fabric _ version }") ĊĠĠĠ Ġcompile ( common ) ĊĊĠĠĠ Ġ// ĠP SA : ĠSome Ġolder Ġmods , Ġcompiled Ġon ĠL oom Ġ 0 . 2 . 1 , Ġmight Ġhave Ġoutdated ĠMaven ĠPO Ms . ĊĠĠĠ Ġ// ĠYou Ġmay Ġneed Ġto Ġforce - disable Ġtransit iveness Ġon Ġthem . ĊĠĠĠ Ġtest Compile (" junit : junit : 4 . 1 2 ") Ċ } Ċ Ċ tasks . get ByName < Process Resources >(" process Resources ") Ġ{ ĊĠĠĠ Ġfiles Matching (" fabric . mod . json ") Ġ{ ĊĠĠĠĠĠĠĠ Ġexpand ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmutable Map Of (" version " Ġto Ġversion ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ // ĠL oom Ġwill Ġautomatically Ġattach Ġsources Jar Ġto Ġa ĠRemap Sources Jar Ġtask Ġand Ġto Ġthe Ġ" build " Ġtask Ċ // Ġif Ġit Ġis Ġpresent . Ċ // ĠIf Ġyou Ġremove Ġthis Ġtask , Ġsources Ġwill Ġnot Ġbe Ġgenerated . Ċ val Ġsources Jar Ġ= Ġtasks . create < Jar >(" sources Jar ") Ġ{ ĊĠĠĠ Ġarchive Classifier . set (" sources ") ĊĠĠĠ Ġfrom ( source Sets [" main "]. all Source ) Ċ } Ċ Ċ val Ġbuild Final Ġ= Ġtasks . create < Zip >(" build Final ") Ġ{ ĊĠĠĠ Ġfrom ( zip Tree (( common . tasks . get (" jar ") Ġas ĠJar ). archive File )) ĊĠĠĠ Ġfrom ( zip Tree (( tasks . get (" remap Jar ") Ġas ĠZip ). archive File )) ĊĊĠĠĠ Ġarchive FileName . set ("$ archives _ base _ name -$ mod _ version . jar ") ĊĠĠĠ Ġdestination Directory . set ( file ("$ build Dir / dist ")) Ċ } Ċ Ċ build Final . depends On (" remap Jar ") Ċ tasks . get (" build "). depends On ( build Final ) Ċ