|
1 | 1 | package top.mrxiaom.gradle |
2 | 2 |
|
3 | 3 | import com.google.common.collect.Iterables |
| 4 | +import com.google.common.collect.Lists |
4 | 5 | import org.gradle.api.JavaVersion |
5 | 6 | import org.gradle.api.Project |
6 | 7 | import org.gradle.api.artifacts.Configuration |
@@ -64,6 +65,32 @@ class LibraryHelper { |
64 | 65 | this.targetConfiguration = targetConfiguration |
65 | 66 | } |
66 | 67 |
|
| 68 | + static List<String> adventure( |
| 69 | + String adventureVersion = "4.22.0", |
| 70 | + List<String> modules = Lists.newArrayList( |
| 71 | + "api", |
| 72 | + "text-minimessage", |
| 73 | + "text-serializer-gson", |
| 74 | + "text-serializer-plain", |
| 75 | + ) |
| 76 | + ) { |
| 77 | + List<String> list = new ArrayList<>() |
| 78 | + for (final def artifactPart in modules) { |
| 79 | + list.add("net.kyori:adventure-$artifactPart:$adventureVersion") |
| 80 | + } |
| 81 | + return list |
| 82 | + } |
| 83 | + |
| 84 | + void library(List<String> dependencyNotations) { |
| 85 | + dependencyNotations.forEach(this::library) |
| 86 | + } |
| 87 | + |
| 88 | + void library(List<String> dependencyNotations, Consumer<ExternalModuleDependency> consumer) { |
| 89 | + for (final def dependencyNotation in dependencyNotations) { |
| 90 | + library(dependencyNotation, consumer) |
| 91 | + } |
| 92 | + } |
| 93 | + |
67 | 94 | void library(String dependencyNotation) { |
68 | 95 | addedLibraries.add(dependencyNotation) |
69 | 96 | def dependencies = project.getDependencies() |
|
0 commit comments