mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
DependencyDownloader: Support platform dependencies
This commit is contained in:
@@ -65,6 +65,17 @@ public final class DependencyDownloader {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a platform dependency.
|
||||
*
|
||||
* @param dependencyNotation the dependency notation
|
||||
* @return this downloader
|
||||
*/
|
||||
public DependencyDownloader platform(String dependencyNotation) {
|
||||
dependencies.add(new DependencyEntry.Platform(dependencyNotation));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all dependencies from a configuration to download.
|
||||
*
|
||||
@@ -137,6 +148,10 @@ public final class DependencyDownloader {
|
||||
|
||||
if (resolve) {
|
||||
files = project.files(files.getFiles());
|
||||
|
||||
for (File file : files) {
|
||||
System.out.println(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
@@ -190,6 +205,13 @@ public final class DependencyDownloader {
|
||||
}
|
||||
}
|
||||
|
||||
record Platform(String notation) implements DependencyEntry {
|
||||
@Override
|
||||
public Dependency getDependency(DependencyHandler dependencies, boolean transitive) {
|
||||
return dependencies.platform(notation);
|
||||
}
|
||||
}
|
||||
|
||||
record Direct(Dependency dependency) implements DependencyEntry {
|
||||
@Override
|
||||
public Dependency getDependency(DependencyHandler dependencies, boolean transitive) {
|
||||
|
||||
Reference in New Issue
Block a user