mirror of
https://github.com/Ellpeck/Contentless.git
synced 2024-11-22 07:23:30 +01:00
some more cleanup and path char inconsistency fixes
This commit is contained in:
parent
1dfd963dc9
commit
ec0eb59871
2 changed files with 6 additions and 12 deletions
|
@ -77,7 +77,7 @@ public static class Program {
|
||||||
changed = true;
|
changed = true;
|
||||||
} else {
|
} else {
|
||||||
if (config.LogSkipped)
|
if (config.LogSkipped)
|
||||||
Console.WriteLine($"Skipping reference {fullLibraryPath} which already matched");
|
Console.WriteLine($"Skipping reference replacement for {fullLibraryPath} which already matched");
|
||||||
}
|
}
|
||||||
referencesSyncs.Add(libraryName);
|
referencesSyncs.Add(libraryName);
|
||||||
}
|
}
|
||||||
|
@ -92,9 +92,9 @@ public static class Program {
|
||||||
// find place where I can add new reference
|
// find place where I can add new reference
|
||||||
for (var i = 0; i < content.Count; i++) {
|
for (var i = 0; i < content.Count; i++) {
|
||||||
var line = content[i];
|
var line = content[i];
|
||||||
if (line.StartsWith(referenceHeader))
|
if (line.StartsWith(referenceHeader)) {
|
||||||
referencesLastIndex = i + 1;
|
referencesLastIndex = i + 1;
|
||||||
else if (line.StartsWith("/importer:") || line.StartsWith("/processor:") || line.StartsWith("/build:") || line.Contains("-- Content --")) {
|
} else if (line.StartsWith("/importer:") || line.StartsWith("/processor:") || line.StartsWith("/build:") || line.Contains("-- Content --")) {
|
||||||
if (referencesLastIndex == 0)
|
if (referencesLastIndex == 0)
|
||||||
referencesLastIndex = i;
|
referencesLastIndex = i;
|
||||||
break;
|
break;
|
||||||
|
@ -122,7 +122,7 @@ public static class Program {
|
||||||
// is the file the content or config file?
|
// is the file the content or config file?
|
||||||
if (file.Name == contentFile.Name || file.Name == configFile.Name)
|
if (file.Name == contentFile.Name || file.Name == configFile.Name)
|
||||||
continue;
|
continue;
|
||||||
var relative = Program.GetRelativePath(contentFile.DirectoryName, file.FullName).Replace("\\", "/");
|
var relative = Path.GetRelativePath(contentFile.DirectoryName, file.FullName).Replace('\\', '/');
|
||||||
|
|
||||||
// is the file in an excluded directory?
|
// is the file in an excluded directory?
|
||||||
if (excluded.Any(e => e.IsMatch(relative))) {
|
if (excluded.Any(e => e.IsMatch(relative))) {
|
||||||
|
@ -225,7 +225,7 @@ public static class Program {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string CalculateFullPathToLibrary(string packageFolder, string libraryName, string referencesVersion) {
|
private static string CalculateFullPathToLibrary(string packageFolder, string libraryName, string referencesVersion) {
|
||||||
return Path.Combine(packageFolder, libraryName.ToLower(), referencesVersion, "tools", libraryName + ".dll");
|
return Path.Combine(packageFolder, libraryName.ToLowerInvariant(), referencesVersion, "tools", libraryName + ".dll").Replace('\\', '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
private static (List<ImporterInfo>, List<string>) GetContentData() {
|
private static (List<ImporterInfo>, List<string>) GetContentData() {
|
||||||
|
@ -306,12 +306,6 @@ public static class Program {
|
||||||
Console.WriteLine($"Adding file {relative} with the Copy build action");
|
Console.WriteLine($"Adding file {relative} with the Copy build action");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetRelativePath(string relativeTo, string path) {
|
|
||||||
if (!relativeTo.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
|
||||||
relativeTo += Path.DirectorySeparatorChar;
|
|
||||||
return path.Replace(relativeTo, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Regex MakeFileRegex(string s) {
|
private static Regex MakeFileRegex(string s) {
|
||||||
return new Regex(s.Replace(".", "[.]").Replace("*", ".*").Replace("?", "."));
|
return new Regex(s.Replace(".", "[.]").Replace("*", ".*").Replace("?", "."));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#-------------------------------- References --------------------------------#
|
#-------------------------------- References --------------------------------#
|
||||||
|
|
||||||
/reference:C:\Users\me\.nuget\packages\monogame.extended.content.pipeline\3.8.0\tools\MonoGame.Extended.Content.Pipeline.dll
|
/reference:C:/Users/me/.nuget/packages/monogame.extended.content.pipeline/3.8.0/tools/MonoGame.Extended.Content.Pipeline.dll
|
||||||
|
|
||||||
#---------------------------------- Content ---------------------------------#
|
#---------------------------------- Content ---------------------------------#
|
||||||
#begin Json/Copy.json
|
#begin Json/Copy.json
|
||||||
|
|
Loading…
Reference in a new issue