package p.studio.compiler.messages;

import p.studio.compiler.utilities.SourceProviderFactory;

public record BuilderPipelineConfig(
        boolean explain,
        String rootProjectPath,
        String vmProfile,
        SourceProviderFactory sourceProviderFactory) {

    public BuilderPipelineConfig(
            final boolean explain,
            final String rootProjectPath) {
        this(explain, rootProjectPath, "core-v1", SourceProviderFactory.filesystem());
    }

    public BuilderPipelineConfig(
            final boolean explain,
            final String rootProjectPath,
            final String vmProfile) {
        this(explain, rootProjectPath, vmProfile, SourceProviderFactory.filesystem());
    }

    public BuilderPipelineConfig {
        vmProfile = vmProfile == null || vmProfile.isBlank() ? "core-v1" : vmProfile;
        sourceProviderFactory = sourceProviderFactory == null ? SourceProviderFactory.filesystem() : sourceProviderFactory;
    }
}
