mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Several compilation fixes
This commit is contained in:
@ -14,7 +14,7 @@ public class IncludeRegex : ACompilationStep
|
||||
public IncludeRegex(ACompiler compiler, string pattern) : base(compiler)
|
||||
{
|
||||
_pattern = pattern;
|
||||
_regex = new Regex(pattern, RegexOptions.Compiled);
|
||||
_regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
public override async ValueTask<Directive?> Run(RawSourceFile source)
|
||||
|
@ -67,13 +67,13 @@ public class CompilerSettingsInferencer
|
||||
cs.Include = Array.Empty<RelativePath>();
|
||||
foreach (var file in mo2Folder.EnumerateFiles())
|
||||
{
|
||||
if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_INCLUDE)
|
||||
if (MatchesVariants(file, Consts.WABBAJACK_INCLUDE))
|
||||
cs.Include = cs.Include.Add(file.Parent.RelativeTo(mo2Folder));
|
||||
|
||||
if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_NOMATCH_INCLUDE)
|
||||
if (MatchesVariants(file, Consts.WABBAJACK_NOMATCH_INCLUDE))
|
||||
cs.NoMatchInclude = cs.NoMatchInclude.Add(file.Parent.RelativeTo(mo2Folder));
|
||||
|
||||
if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_IGNORE)
|
||||
if (MatchesVariants(file, Consts.WABBAJACK_IGNORE))
|
||||
cs.Ignore = cs.Ignore.Add(file.Parent.RelativeTo(mo2Folder));
|
||||
}
|
||||
|
||||
@ -120,4 +120,12 @@ public class CompilerSettingsInferencer
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool MatchesVariants(AbsolutePath file, string baseVariant)
|
||||
{
|
||||
var withoutExt = file.FileName.WithoutExtension().ToString();
|
||||
|
||||
return withoutExt == baseVariant ||
|
||||
withoutExt == baseVariant + "_FILES";
|
||||
}
|
||||
}
|
@ -292,8 +292,9 @@ public class MO2Compiler : ACompiler
|
||||
new IgnoreFilename(this, "portable.txt".ToRelativePath()),
|
||||
new IgnoreExtension(this, Ext.Bin),
|
||||
new IgnoreFilename(this, ".refcache".ToRelativePath()),
|
||||
//Include custom categories
|
||||
new IncludeRegex(this, "categories.dat$"),
|
||||
//Include custom categories / splash screens
|
||||
new IncludeRegex(this, @"categories\.dat$"),
|
||||
new IncludeRegex(this, @"splash\.png"),
|
||||
|
||||
new IncludeAllConfigs(this),
|
||||
// TODO
|
||||
|
Reference in New Issue
Block a user