43 lines
1.6 KiB
Java
43 lines
1.6 KiB
Java
package io.gitlab.jfronny.respackopts.model.cache;
|
|
|
|
import io.gitlab.jfronny.muscript.ast.context.Script;
|
|
import io.gitlab.jfronny.muscript.data.additional.context.Scope;
|
|
import io.gitlab.jfronny.respackopts.RespackoptsConfig;
|
|
import io.gitlab.jfronny.respackopts.filters.util.FileDependencyTracker;
|
|
import io.gitlab.jfronny.respackopts.model.*;
|
|
import io.gitlab.jfronny.respackopts.model.tree.ConfigBranch;
|
|
import io.gitlab.jfronny.respackopts.muscript.MuScriptScope;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import java.util.*;
|
|
|
|
public record CachedPackState(
|
|
String packId,
|
|
String displayName,
|
|
String packName,
|
|
ConfigBranch configBranch,
|
|
PackMeta metadata,
|
|
Map<String, FileRpo> cachedFileRPOs,
|
|
Map<String, List<DirRpo>> cachedDirRPOs, // Directory RPOs, from outermost to innermost
|
|
Map<String, Script> cachedScripts, // Scripts, available via runScript
|
|
Map<String, String> cachedFiles, // Files, read by readString
|
|
Scope executionScope,
|
|
@Nullable FileDependencyTracker tracker
|
|
) {
|
|
public CachedPackState(CacheKey key, PackMeta meta, ConfigBranch branch) {
|
|
this(
|
|
meta.id,
|
|
key.displayName(),
|
|
key.packName(),
|
|
branch,
|
|
meta,
|
|
new HashMap<>(),
|
|
new HashMap<>(),
|
|
new HashMap<>(),
|
|
new HashMap<>(),
|
|
branch.addTo(MuScriptScope.fork(meta.version)),
|
|
RespackoptsConfig.debugLogs ? new FileDependencyTracker(key.displayName()) : null
|
|
);
|
|
}
|
|
}
|