@@ -157,7 +157,7 @@ def fillModJson(project, task) {
157157 project. tasks. build. dependsOn task
158158}
159159
160- def setUpLibrary (project ) {
160+ def setUpLibrary (project , String ... dependencies ) {
161161 project. apply plugin : ' java-library'
162162 project. apply plugin : ' eclipse'
163163 project. apply plugin : ' idea'
@@ -182,13 +182,19 @@ def setUpLibrary(project) {
182182 mavenCentral()
183183 }
184184
185+ def libraries = getLibraryDependencies(project, dependencies)
186+
185187 project. dependencies {
186188 implementation " net.fabricmc:fabric-loader:${ project.rootProject.loader_version} "
187189
188190 implementation " org.apache.logging.log4j:log4j-api:2.19.0"
189191 implementation " org.apache.logging.log4j:log4j-core:2.19.0"
190192
191193 implementation project. dependencies. project(path : ' :libraries:core' , configuration : ' namedElements' )
194+
195+ libraries. each { libraryPath ->
196+ implementation project. dependencies. project(path : libraryPath)
197+ }
192198 }
193199
194200 addPomDependency(project)
@@ -237,7 +243,6 @@ def setUpModule(project, String... dependencies) {
237243 setIntermediaryGeneration(2 )
238244 }
239245
240- def libraries = getLibraryDependencies(project, dependencies)
241246 def modules = getModuleDependencies(project, dependencies)
242247
243248 project. repositories {
@@ -281,9 +286,10 @@ def setUpModule(project, String... dependencies) {
281286 include " org.quiltmc.parsers:json:${ project.rootProject.quilt_parsers_version} "
282287 }
283288
284- libraries . each { libraryPath ->
285- implementation project. dependencies. project(path : libraryPath )
289+ if ( ! isCore) {
290+ implementation project. dependencies. project(path : library . path )
286291 }
292+
287293 modules. each { modulePath ->
288294 implementation project. dependencies. project(path : modulePath, configuration : ' namedElements' )
289295 }
@@ -424,17 +430,10 @@ def setUpModule(project, String... dependencies) {
424430 setUpJavadoc(project)
425431}
426432
427- def getLibraryDependencies (project , String ... moduleNames ) {
433+ def getLibraryDependencies (project , String ... libraryNames ) {
428434 def libraries = new ArrayList<> ()
429435
430- if (project. path != ' :libraries:core' ) {
431- libraries. add(project. parent. path)
432- }
433-
434- for (moduleName : moduleNames) {
435- def i = moduleName. indexOf(' -mc' )
436- def libraryName = moduleName. substring(0 , i)
437-
436+ for (libraryName : libraryNames) {
438437 libraries. add(" :libraries:${ libraryName} " )
439438 }
440439
0 commit comments