added the ability to only specify a content processor

This commit is contained in:
Ellpeck 2020-01-14 00:07:52 +01:00
parent b79601f318
commit 5cce238380
5 changed files with 21 additions and 10 deletions

View file

@ -2,7 +2,7 @@
<package>
<metadata>
<id>Contentless</id>
<version>2.0.5</version>
<version>2.0.6</version>
<authors>Ellpeck</authors>
<description>A tool for MonoGame that automatically handles adding assets to the Content Pipeline project</description>
<tags>monogame mono xna content pipeline mgcb builder tool library</tags>

View file

@ -91,19 +91,21 @@ namespace Contentless {
var over = GetOverrideFor(relative, overrides);
if (over != null) {
// copy special case
if (over.Importer == "Copy") {
if (over.Importer == "Copy" || over.Processor == "Copy") {
CopyFile(content, relative);
changed = true;
continue;
}
importer = importers.Find(i => i.Type.Name == over.Importer);
if (importer == null) {
Console.WriteLine($"Override importer {over.Importer} not found for file {relative}");
continue;
if (!string.IsNullOrEmpty(over.Importer) && over.Importer != "Auto") {
importer = importers.Find(i => i.Type.Name == over.Importer);
if (importer == null) {
Console.WriteLine($"Override importer {over.Importer} not found for file {relative}");
continue;
}
}
if (over.Processor != null) {
if (!string.IsNullOrEmpty(over.Processor) && over.Processor != "Auto") {
processor = processors.Find(p => p == over.Processor);
if (processor == null) {
Console.WriteLine($"Override processor {over.Processor} not found for file {relative}");

View file

@ -39,7 +39,9 @@ To add a configuration file to Contentless, simply create a file named `Contentl
// Example: Specifying "Copy" as the importer sets the file's Build Mode to "Copy" instead of "Build"
".txt": "Copy",
// Example: Specifying both an importer and a processor
".ogg": ["OggImporter", "SongProcessor"]
".ogg": ["OggImporter", "SongProcessor"],
// Example: Only specifying a processor
".wav": ["Auto", "SoundEffectProcessor"]
}
}
```

View file

@ -13,6 +13,7 @@
/reference:..\bin\Debug\netcoreapp2.2\MonoGame.Extended.Content.Pipeline.dll
#---------------------------------- Content ---------------------------------#
#begin Json/Copy.json
/copy:Json/Copy.json
@ -23,7 +24,7 @@
#begin Locale/Interface.xml
/importer:XmlImporter
/processor:PassThroughProcessor
/processor:FontTextureProcessor
/build:Locale/Interface.xml
#begin Textures/Icons.png
@ -51,3 +52,8 @@
/processor:TiledMapTilesetProcessor
/build:Tiled/Tileset.tsx
#begin Textures/Exclude.png
/importer:TextureImporter
/processor:TextureProcessor
/build:Textures/Exclude.png

View file

@ -8,6 +8,7 @@
"overrides": {
"Copy.*": "Copy",
".json": ["JsonContentImporter", "FontTextureProcessor"],
".ogg": ["OggImporter", "SongProcessor"]
".ogg": ["OggImporter", "SongProcessor"],
".xml": ["", "FontTextureProcessor"]
}
}