add build and explanation

This commit is contained in:
Ellpeck 2019-10-08 13:23:18 +02:00
parent 8748a05025
commit 20078e5c27
47 changed files with 189709 additions and 6 deletions

Binary file not shown.

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<dllmap os="linux" dll="TextureConverter.dll" target="libTextureConverter.so"/>
<dllmap os="osx" dll="TextureConverter.dll" target="libTextureConverter.dylib"/>
</configuration>

BIN
Build/Assimp64.dll Normal file

Binary file not shown.

BIN
Build/AssimpNet.dll Normal file

Binary file not shown.

View file

@ -0,0 +1,5 @@
<configuration>
<dllmap os="macos" dll="assimp.dll" target="libassimp.dylib"/>
<dllmap os="linux" dll="assimp.dll" target="libassimp.so"/>
</configuration>

BIN
Build/AssimpNet.pdb Normal file

Binary file not shown.

9581
Build/AssimpNet.xml Normal file

File diff suppressed because it is too large Load diff

BIN
Build/Contentless.exe Normal file

Binary file not shown.

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

BIN
Build/Contentless.pdb Normal file

Binary file not shown.

BIN
Build/CppNet.dll Normal file

Binary file not shown.

BIN
Build/FreeImage.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

18563
Build/MonoGame.Framework.xml Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -0,0 +1,4 @@
<configuration>
<dllmap os="macos" dll="nvtt.dll" target="libnvtt.dylib"/>
<dllmap os="linux" dll="nvtt.dll" target="libnvtt.so"/>
</configuration>

BIN
Build/PVRTexLibNET.dll Normal file

Binary file not shown.

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<dllmap os="linux" dll="PVRTexLibWrapper.dll" cpu="x86-64" target="libPVRTexLibWrapper.so"/>
<dllmap os="osx" dll="PVRTexLibWrapper.dll" target="libPVRTexLibWrapper.dylib"/>
</configuration>

BIN
Build/PVRTexLibWrapper.dll Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
Build/SharpDX.DXGI.dll Normal file

Binary file not shown.

10091
Build/SharpDX.DXGI.xml Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

37725
Build/SharpDX.Direct3D11.xml Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

BIN
Build/SharpDX.XAudio2.dll Normal file

Binary file not shown.

5989
Build/SharpDX.XAudio2.xml Normal file

File diff suppressed because it is too large Load diff

BIN
Build/SharpDX.XInput.dll Normal file

Binary file not shown.

1356
Build/SharpDX.XInput.xml Normal file

File diff suppressed because it is too large Load diff

BIN
Build/SharpDX.dll Normal file

Binary file not shown.

38946
Build/SharpDX.xml Normal file

File diff suppressed because it is too large Load diff

BIN
Build/SharpFont.dll Normal file

Binary file not shown.

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<dllmap dll="freetype6" os="osx" target="libfreetype.6.dylib" />
</configuration>

BIN
Build/ffmpeg.exe Normal file

Binary file not shown.

BIN
Build/ffprobe.exe Normal file

Binary file not shown.

BIN
Build/freetype6.dll Normal file

Binary file not shown.

BIN
Build/libmojoshader_64.dll Normal file

Binary file not shown.

BIN
Build/nvtt.dll Normal file

Binary file not shown.

View file

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>net472</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -9,14 +9,21 @@ namespace Contentless {
public static class Program { public static class Program {
private static readonly ImporterInfo[] Importers = GetContentImporters().ToArray(); private static readonly ImporterInfo[] Importers = GetContentImporters().ToArray();
private static readonly string[] ExcludedFolders = {"bin", "obj"}; private static readonly string[] ExcludedFolders = {"bin/", "obj/"};
public static void Main(string[] args) { public static void Main(string[] args) {
if (args.Length != 1) {
Console.WriteLine("Please specify the location of the content file you want to use");
return;
}
var contentFile = new FileInfo(Path.Combine(Environment.CurrentDirectory, args[0])); var contentFile = new FileInfo(Path.Combine(Environment.CurrentDirectory, args[0]));
if (!contentFile.Exists) { if (!contentFile.Exists) {
Console.WriteLine($"Unable to find content file {contentFile}"); Console.WriteLine($"Unable to find content file {contentFile}");
return; return;
} }
Console.WriteLine($"Using content file {contentFile}");
var content = ReadContent(contentFile); var content = ReadContent(contentFile);
var changed = false; var changed = false;
@ -24,11 +31,10 @@ namespace Contentless {
// is the file the content file? // is the file the content file?
if (file.Name == contentFile.Name) if (file.Name == contentFile.Name)
continue; continue;
var relative = Path.GetRelativePath(contentFile.Directory.FullName, file.FullName).Replace("\\", "/"); var relative = GetRelativePath(contentFile.Directory.FullName, file.FullName);
// is the file in an excluded directory? // is the file in an excluded directory?
var dirName = file.DirectoryName.Replace("\\", "/"); if (ExcludedFolders.Any(e => relative.Contains(e))) {
if (ExcludedFolders.Any(e => dirName.Contains(e))) {
continue; continue;
} }
@ -107,6 +113,15 @@ namespace Contentless {
Console.WriteLine($"Adding file {relative} with importer {importer.Type.Name} and processor {importer.Importer.DefaultProcessor}"); Console.WriteLine($"Adding file {relative} with importer {importer.Type.Name} and processor {importer.Importer.DefaultProcessor}");
} }
private static string GetRelativePath(string relativeTo, string path) {
relativeTo = relativeTo.Replace("\\", "/");
path = path.Replace("\\", "/");
if (!relativeTo.EndsWith("/"))
relativeTo += '/';
return path.Replace(relativeTo, "");
}
private class ImporterInfo { private class ImporterInfo {
public readonly ContentImporterAttribute Importer; public readonly ContentImporterAttribute Importer;

View file

@ -1,2 +1,11 @@
# Contentless # Contentless
A commandline tool for MonoGame that automatically handles adding assets to the Content Pipeline project A commandline tool for MonoGame that automatically handles adding assets to the Content Pipeline project so you don't have to use their horrible interface.
# How to use
Clone this repository or download its `Build` folder which contains a build of Contentless. Then, add Contentless to your build process by adding the following task to your `.csproj` file. Note that you might have to change the paths to fit your project's setup.
```xml
<Target Name="BeforeBuild">
<Exec Command="..\..\Contentless\Build\Contentless.exe Content/Content.mgcb" />
</Target>
```
Contentless will now automatically add any content files from your `Content` directory and subdirectories (excluding `bin` and `obj`) to your `Content.mgcb` file if they haven't already been added either manually or by Contentless. No existing items' configurations will be overridden, so you can still use the Content Pipeline tool to modify any settings as well.