chore: Deploader tidy pass, add marker json to fplib

This commit is contained in:
FalsePattern committed 2025-11-13 06:59:53 +01:00
1 parent 2c329d11cf
commit c41b8184f0
3 files changed
+37 -6

No files matched your search

+7
View File
@@ -129,6 +129,13 @@ tasks.jar {
}
}
tasks.processResources {
val ver = minecraft_fp.mod.version
filesMatching("META-INF/deps.json") {
expand("modVersion" to ver.get())
}
}
repositories {
exclusive(maven("horizon", "https://mvn.falsepattern.com/horizon/"), "com.gtnewhorizons.retrofuturabootstrap")
exclusive(horizon()) {
@@ -63,6 +63,7 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -512,7 +513,9 @@ public class DependencyLoaderImpl {
long end = System.currentTimeMillis();
LOG.debug("Discovered {} dependency source candidates in {}ms", dependencySpecs.size(), end - start);
remoteMavenRepositories.addAll(dependencySpecs.stream()
.flatMap((dep) -> dep.repositories().stream())
.map(DepRoot::repositories)
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.map(repo -> repo.endsWith("/") ? repo : repo + "/")
.collect(Collectors.toSet()));
localMavenRepositories.addAll(jijURLs.stream().map(URL::toString).map(repo -> repo.endsWith("/") ? repo : repo + "/").collect(Collectors.toSet()));
@@ -563,11 +566,14 @@ public class DependencyLoaderImpl {
new ScopedDep(it.source, it.mod, DependencyScope.ALWAYS, it.dep.always()),
new ScopedDep(it.source, it.mod, DependencyScope.DEV, it.dep.dev()),
new ScopedDep(it.source, it.mod, DependencyScope.OBF, it.dep.obf())))
.flatMap(it -> Stream.concat(it.deps.common().stream().map(dep -> new ScopedSidedDep(it.source, it.mod, new ScopeSide(it.scope, DependencySide.COMMON), dep)),
Stream.concat(
it.deps.client().stream().map(dep -> new ScopedSidedDep(it.source, it.mod, new ScopeSide(it.scope, DependencySide.CLIENT), dep)),
it.deps.server().stream().map(dep -> new ScopedSidedDep(it.source, it.mod, new ScopeSide(it.scope, DependencySide.SERVER), dep))
)))
.filter(it -> it.deps != null)
.flatMap(it -> {
Stream<ScopedSidedDep> result = null;
result = concat(it, result, it.deps.common(), DependencySide.COMMON);
result = concat(it, result, it.deps.client(), DependencySide.CLIENT);
result = concat(it, result, it.deps.server(), DependencySide.SERVER);
return result;
})
.map((scopedSidedDep) -> {
val source = scopedSidedDep.source;
val scope = scopedSidedDep.scope;
@@ -614,6 +620,17 @@ public class DependencyLoaderImpl {
return artifacts;
}
private static Stream<ScopedSidedDep> concat(ScopedDep it, @Nullable Stream<ScopedSidedDep> prev, List<String> deps, DependencySide side) {
if (deps != null) {
val newStream = deps.stream().map(dep -> new ScopedSidedDep(it.source, it.mod, new ScopeSide(it.scope, side), dep));
if (prev == null) {
return newStream;
}
return Stream.concat(prev, newStream);
}
return prev;
}
public static Version parseVersion(String versionString) {
try {
val matcher = VERSION_PATTERN.matcher(versionString);
+7
View File
@@ -0,0 +1,7 @@
{
"identifier": "falsepatternlib_dependencies",
"bundledArtifacts": [
"com.falsepattern:falsepatternlib-mc1.7.10:${modVersion}",
"com.falsepattern:falsepatternlib-mc1.7.10:${modVersion}:dev"
]
}