import Ġorg . jetbrains . kotlin . gradle . tasks . Kotlin Compile Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġkotlin (" jvm ") Ġversion Ġ" 1 . 3 . 7 2 " ĊĠĠĠ Ġid (" com . diff plug . p 2 . asm aven ") Ġversion Ġ" 3 . 2 7 . 0 " ĊĠĠĠ Ġmaven Ċ } Ċ Ċ group Ġ= Ġ" de . fh do . lemma . ocl " Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġmaven Central () ĊĠĠĠ Ġmaven Local () Ċ } Ċ Ċ build script Ġ{ ĊĠĠĠ Ġval Ġextracted Ec lipse Dependencies Dir Ġ= Ġproject . file ("$ build Dir / extract ed Ec lipse Dependencies ") ĊĠĠĠ Ġextra . set (" extract ed Ec lipse Dependencies Dir ", Ġextracted Ec lipse Dependencies Dir ) ĊĊĠĠĠ Ġextra . set (" eclipse O cl Version ", Ġ" 6 . 1 5 . 0 ") Ċ } Ċ Ċ /** Ċ Ġ* ĠWe Ġuse Ġa Ġplugin Ġto Ġspecify Ġand Ġresolve ĠO CL - specific ĠEclipse Ġplugin Ġdependencies Ġthat Ġare Ġnot Ġprovided Ġvia ĠMaven Ċ Ġ* ĠCentral . ĠInstead , Ġthey Ġare Ġdownloaded Ġin Ġthe Ġform Ġof ĠJ AR Ġfiles Ġfrom Ġtheir Ġrespective ĠP 2 Ġrepository Ġhosted Ġby Ġthe Ċ Ġ* ĠEclipse ĠFoundation . ĠL ater Ġin Ġthe Ġbuild , Ġthe Ġdownloaded ĠJ AR s Ġcan Ġbe Ġused Ġas Ġ" normal " Ġdependencies Ġas Ġif Ġthey Ċ Ġ* Ġorigin ated Ġfrom ĠMaven ĠCentral . Ċ Ġ*/ Ċ apply ( plugin Ġ= Ġ" com . diff plug . p 2 . asm aven ") Ċ p 2 As Maven Ġ{ ĊĠĠĠ Ġval Ġec lipse O cl Version : ĠString Ġby Ġroot Project . extra ĊĊĠĠĠ Ġgroup (" eclipse - deps ") Ġ{ ĊĠĠĠĠĠĠĠ Ġrepo (" https :// download . eclipse . org / modeling / md t / ocl / updates / releases /$ eclipse O cl Version /") ĊĠĠĠĠĠĠĠ Ġi u (" org . eclipse . ocl . ecore ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠUsually , Ġyou Ġwould Ġuse Ġthe Ġfollowing Ġto Ġadd Ġan Ġofficial ĠEclipse Ġrelease Ġto Ġthe Ġgroup Ġusing Ġthe ĊĠĠĠĠĠĠĠ Ġ// Ġcom . diff plug . p 2 . asm aven Ġplugin : ĊĠĠĠĠĠĠĠ Ġ// ĠĠĠĠĠ Ġrepo Ec lipse ( eclipse Version ) ĊĠĠĠĠĠĠĠ Ġ// ĠFrom Ġthe Ġgiven Ġec lipse Version , Ġthe Ġplugin Ġwill Ġperform Ġa Ġmapping Ġto Ġan ĠEclipse Ġrel ase ĠURL ĊĠĠĠĠĠĠĠ Ġ// Ġ( cf . Ġhttps :// github . com / diff plug / go omp h / blob / 9 6 7 ed 7 c 3 a 9 6 c 3 3 fda 7 4 9 f 1 5 f 2 b 3 d 1 0 0 6 5 c 3 2 e 3 5 9 / src / main / java / com / diff plug / gradle / p de / Ec lipse Release . java # L 7 4 ). ĊĠĠĠĠĠĠĠ Ġ// ĠHowever , Ġall Ġversions Ġof Ġcom . diff plug . p 2 . asm aven Ġgreater Ġ 3 . 2 7 . 0 Ġ( tested Ġup Ġto Ġ 3 . 3 0 . 0 ) Ġcurrently Ġresult Ġin Ġan ĊĠĠĠĠĠĠĠ Ġ// ĠInvocation TargetException Ġcaused Ġby Ġan ĠN PE Ġ( prob ably Ġdue Ġto Ġchanges Ġin ĠE cli se Ġrelease Ġdependencies ; Ġcf . ĊĠĠĠĠĠĠĠ Ġ// Ġhttps :// github . com / diff plug / go omp h / pull / 1 4 5 ). ĠC onse quent ly , Ġwe Ġare Ġstuck Ġto Ġcom . diff plug . p 2 . asm aven Ġ 3 . 2 7 . 0 ĊĠĠĠĠĠĠĠ Ġ// Ġfor Ġnow . ĠTo Ġstill Ġbe Ġable Ġto Ġdepend Ġon ĠEclipse Ġ 4 . 1 9 Ġ( 2 0 2 1 - 0 3 ), Ġwe Ġtherefore Ġhave Ġto Ġhard wire Ġthe ĠEclipse ĊĠĠĠĠĠĠĠ Ġ// Ġrelease Ġrepository Ġas Ġfollows : ĊĠĠĠĠĠĠĠ Ġrepo (" https :// download . eclipse . org / eclipse / updates / 4 . 1 9 / R - 4 . 1 9 - 2 0 2 1 0 3 0 3 1 8 0 0 /") ĊĠĠĠĠĠĠĠ Ġi u (" org . eclipse . emf . common ") ĊĠĠĠĠĠĠĠ Ġi u (" org . eclipse . emf . ecore ") ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠDefine Ġan Ġcustom Ġconfiguration Ġto Ġcollect Ġall ĠEclipse - specific Ġdependencies Ċ Ġ*/ Ċ val Ġec lipse Dependency Ġby Ġconfigurations . creating Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġimplementation ( kotlin (" stdlib ")) ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . emf . common :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . emf . ecore :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . emf . ecore . x mi :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : lp g . runtime . java :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . ocl . ecore :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . ocl :+ ") ĊĠĠĠ Ġec lipse Dependency (" eclipse - deps : org . eclipse . ocl . common :+ ") ĊĊĠĠĠ Ġ// ĠThe Ġcustom Ġec lipse Dependency Ġconfiguration Ġdoes Ġnot Ġallow Ġfor Ġresolving Ġthe Ġspecified ĠEclipse Ġdependencies ĊĠĠĠ Ġ// Ġdirectly . ĠInstead , Ġwe Ġrefer Ġto Ġthe Ġdirectory Ġin Ġthe Ġbuild Ġfolder , Ġto Ġwhich Ġwe Ġextract Ġthe Ġdownloaded ĠEclipse ĊĠĠĠ Ġ// Ġplugin ĠJ AR s . ĊĠĠĠ Ġval Ġextracted Ec lipse Dependencies Dir : ĠFile Ġby Ġroot Project . extra ĊĠĠĠ Ġimplementation ( files ( extract ed Ec lipse Dependencies Dir )) Ċ } Ċ Ċ tasks . with Type < Kotlin Compile > Ġ{ ĊĠĠĠ Ġkotlin Options . jvm Target Ġ= Ġ" 1 1 " ĊĊĠĠĠ Ġ// ĠOn Ġevery Ġcompile , Ġextract Ġdownloaded ĠEclipse ĠJ AR s Ġinto Ġa Ġsub - directory Ġof Ġthe Ġbuild Ġdirectory ĊĠĠĠ Ġdepends On (" extract Ec lipse Dependencies ") Ċ } Ċ Ċ /** Ċ Ġ* ĠTask Ġto Ġextract Ġdownloaded ĠEclipse ĠJ AR s Ġinto Ġa Ġsub - directory Ġof Ġthe Ġbuild Ġdirectory Ċ Ġ*/ Ċ tasks . register (" extract Ec lipse Dependencies ") Ġ{ ĊĠĠĠ Ġval Ġextracted Ec lipse Dependencies Dir : ĠFile Ġby Ġroot Project . extra ĊĊĠĠĠ Ġinputs . files ( eclipse Dependency ) ĊĠĠĠ Ġoutputs . dir ( extract ed Ec lipse Dependencies Dir ) ĊĠĠĠ Ġextracted Ec lipse Dependencies Dir . delete Re cursively () ĊĠĠĠ Ġextracted Ec lipse Dependencies Dir . mkdir s () ĊĊĠĠĠ Ġ// ĠThe Ġextraction Ġprocess Ġhas Ġto Ġbe Ġthe Ġlast Ġstep Ġof Ġthis Ġtask Ġto Ġmake Ġsure Ġthat Ġthe Ġdownload Ġprocess Ġof Ġthe ĊĠĠĠ Ġ// ĠEclipse Ġdependencies , Ġwhich Ġis Ġtriggered Ġby Ġthe Ġ" p 2 As Maven " Ġplugin Ġ( see Ġabove ), Ġhas Ġbeen Ġfinished ĊĠĠĠ Ġdo Last Ġ{ ĊĠĠĠĠĠĠĠ Ġcopy Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom ( eclipse Dependency . map Ġ{ Ġif Ġ( it . isDirectory ) Ġit Ġelse Ġzip Tree ( it ) Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinto ( extract ed Ec lipse Dependencies Dir ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* Ġall Dependencies Ġtask Ġto Ġcreate Ġa Ġstandalone Ġfat ĠJ AR Ġincluding Ġall ĠEclipse - specific Ġand Ġother Ġdependencies Ċ Ġ*/ Ċ tasks . register (" all Dependencies ", Ġtype Ġ= ĠJar :: class ) Ġ{ ĊĠĠĠ Ġarchive Classifier . set (" all - dependencies ") ĊĊĠĠĠ Ġ// ĠBuild Ġfat ĠJ AR ĊĠĠĠ Ġfrom ( configurations . compile Classpath . get () ĊĠĠĠĠĠĠĠ Ġ. filter Ġ{ Ġit . exists () Ġ} ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġif Ġ( it . isDirectory ) Ġit Ġelse Ġzip Tree ( it ) Ġ}) ĊĠĠĠ Ġwith ( tasks [" jar "] Ġas ĠCopy Spec ) ĊĊĠĠĠ Ġmanifest Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠPrevent Ġsecurity Ġexception Ġfrom ĠJ AR Ġverifier ĊĠĠĠĠĠĠĠ Ġexclude (" META - INF /*. D SA ", Ġ" META - INF /*. RSA ", Ġ" META - INF /*. SF ") ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* Ġall Dependencies Ġtask Ġto Ġcreate Ġa Ġstandalone Ġfat ĠJ AR Ġincluding Ġall ĠEclipse - specific Ġand Ġother Ġdependencies , Ġbut Ċ Ġ* Ġwithout Ġthe ĠKotlin Ġstandard Ġlibrary . ĠThat Ġis , Ġthis Ġdependency Ġis Ġto Ġbe Ġused Ġby ĠKotlin Ġprograms . Ċ Ġ*/ Ċ val Ġall Dependencies No Kotlin Ġ= Ġtask (" all Dependencies No Kotlin ", Ġtype Ġ= ĠJar :: class ) Ġ{ ĊĠĠĠ Ġval Ġextracted Ec lipse Dependencies Dir : ĠFile Ġby Ġroot Project . extra ĊĠĠĠ Ġarchive Classifier . set (" all - dependencies - no - kotlin ") ĊĊĠĠĠ Ġ// ĠBuild Ġfat ĠJ AR Ġexcluding ĠKotlin Ġstandard Ġlib ĊĠĠĠ Ġfrom ( ĊĠĠĠĠĠĠĠ Ġ// ĠWe Ġneed Ġexplicitly Ġto Ġadd Ġthe Ġdirectory Ġof Ġdownloaded ĠEclipse Ġdependencies Ġhere Ġas Ġotherwise ĠGradle Ġwon 't ĊĠĠĠĠĠĠĠ Ġ// Ġinclude Ġthe Ġcontained Ġdependency Ġfiles Ġin Ġthe Ġ" no ĠKotlin " Ġfat ĠJ AR . ĠStr ange ly , Ġfor Ġthe Ġprevious ĊĠĠĠĠĠĠĠ Ġ// Ġall Dependencies Ġtask Ġwe Ġdo Ġnot Ġneed Ġto Ġinclude Ġthe Ġdirectory Ġexplicitly Ġbecause ĠGradle Ġimplicitly Ġadds Ġits ĊĠĠĠĠĠĠĠ Ġ// Ġcontents Ġto Ġthe Ġproduced Ġ" all Ġdependencies " Ġfat ĠJ AR . ĊĠĠĠĠĠĠĠ Ġfiles ( extract ed Ec lipse Dependencies Dir ), ĊĠĠĠĠĠĠĠ Ġconfigurations . compile Classpath . get () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. filter { Ġit . exists () Ġ&& Ġ! it . name . startsWith (" kotlin ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġif Ġ( it . isDirectory ) Ġit Ġelse Ġzip Tree ( it ) Ġ} ĊĠĠĠ Ġ) ĊĠĠĠ Ġwith ( tasks [" jar "] Ġas ĠCopy Spec ) ĊĊĠĠĠ Ġmanifest Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠPrevent Ġsecurity Ġexception Ġfrom ĠJ AR Ġverifier ĊĠĠĠĠĠĠĠ Ġexclude (" META - INF /*. D SA ", Ġ" META - INF /*. RSA ", Ġ" META - INF /*. SF ") ĊĠĠĠ Ġ} Ċ } Ċ Ċ // ĠEnsure Ġthat Ġthe Ġall Dependencies Ġtasks Ġare Ġexecuted Ġ_ after _ Ġthe ĠEclipse Ġdependencies Ġwere Ġdownloaded Ġand Ġextracted Ġto Ċ // Ġthe Ġsub - directory Ġof Ġthe Ġbuild Ġfolder Ċ tasks [" extract Ec lipse Dependencies "]. final ized By ( tasks [" all Dependencies "]) Ċ tasks [" all Dependencies "]. final ized By ( tasks [" all Dependencies No Kotlin "]) Ċ Ċ artifacts Ġ{ ĊĠĠĠ Ġadd (" archives ", Ġtasks [" all Dependencies "]) ĊĠĠĠ Ġadd (" archives ", Ġtasks [" all Dependencies No Kotlin "]) Ċ }