- optimized ContentProject enumeration loading
- extended ContentBuilder tool to support ContentProjects
This commit is contained in:
parent
629847f297
commit
10aea90e56
@ -263,14 +263,11 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
project.Profile = GraphicsProfile.Reach;
|
||||
else
|
||||
{
|
||||
switch (reader.ReadElementContentAsString())
|
||||
string profileElement = reader.ReadElementContentAsString();
|
||||
GraphicsProfile profile;
|
||||
if (Enum.TryParse<GraphicsProfile>(profileElement, true, out profile))
|
||||
{
|
||||
case "Reach":
|
||||
project.Profile = GraphicsProfile.Reach;
|
||||
break;
|
||||
case "HiDef":
|
||||
project.Profile = GraphicsProfile.HiDef;
|
||||
break;
|
||||
project.Profile = profile;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -280,35 +277,11 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
{
|
||||
if (versionMajor == 1 && versionMinor >= 0)
|
||||
{
|
||||
switch (reader.ReadElementContentAsString())
|
||||
string platformElement = reader.ReadElementContentAsString();
|
||||
TargetPlatform targetPlatform;
|
||||
if (Enum.TryParse<TargetPlatform>(platformElement, true, out targetPlatform))
|
||||
{
|
||||
case "Windows":
|
||||
project.Platform = TargetPlatform.Windows;
|
||||
break;
|
||||
case "WindowsPhone":
|
||||
project.Platform = TargetPlatform.WindowsPhone;
|
||||
break;
|
||||
case "Linux":
|
||||
project.Platform = TargetPlatform.Linux;
|
||||
break;
|
||||
case "Android":
|
||||
project.Platform = TargetPlatform.Android;
|
||||
break;
|
||||
case "IOS":
|
||||
project.Platform = TargetPlatform.IOS;
|
||||
break;
|
||||
case "PsVita":
|
||||
project.Platform = TargetPlatform.PsVita;
|
||||
break;
|
||||
case "MacOs":
|
||||
project.Platform = TargetPlatform.MacOs;
|
||||
break;
|
||||
case "WindowsMetro":
|
||||
project.Platform = TargetPlatform.WindowsMetro;
|
||||
break;
|
||||
case "XBox360":
|
||||
project.Platform = TargetPlatform.XBox360;
|
||||
break;
|
||||
project.Platform = targetPlatform;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,10 @@
|
||||
<Project>{2DAFDFC1-223B-4741-87BB-BE3D0A7617DB}</Project>
|
||||
<Name>ANX.Framework.Content.Pipeline</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
@ -32,14 +32,33 @@ namespace ContentBuilder
|
||||
{
|
||||
if (File.Exists(arg))
|
||||
{
|
||||
BuildItem buildItem = new BuildItem();
|
||||
buildItem.ImporterName = ImporterManager.GuessImporterByFileExtension(arg);
|
||||
//TODO: set configured processor name
|
||||
buildItem.SourceFilename = arg;
|
||||
buildItem.AssetName = System.IO.Path.GetFileNameWithoutExtension(arg);
|
||||
buildItem.OutputFilename = String.Format("{0}.xnb", buildItem.AssetName);
|
||||
if (Path.GetExtension(arg) == ".cproj")
|
||||
{
|
||||
var contentProject = ContentProject.Load(arg);
|
||||
|
||||
itemsToBuild.Add(buildItem);
|
||||
buildContentTask.OutputDirectory = contentProject.OutputDirectory;
|
||||
buildContentTask.TargetPlatform = contentProject.Platform;
|
||||
buildContentTask.TargetProfile = contentProject.Profile;
|
||||
buildContentTask.CompressContent = false; //TODO: make dynamic
|
||||
|
||||
foreach (var dir in contentProject.BuildItems.Select(buildItem => Path.GetDirectoryName(buildItem.OutputFilename)).Where(dir => !Directory.Exists(dir)))
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
}
|
||||
|
||||
itemsToBuild.AddRange(contentProject.BuildItems);
|
||||
}
|
||||
else
|
||||
{
|
||||
BuildItem buildItem = new BuildItem();
|
||||
buildItem.ImporterName = ImporterManager.GuessImporterByFileExtension(arg);
|
||||
//TODO: set configured processor name
|
||||
buildItem.SourceFilename = arg;
|
||||
buildItem.AssetName = System.IO.Path.GetFileNameWithoutExtension(arg);
|
||||
buildItem.OutputFilename = String.Format("{0}.xnb", buildItem.AssetName);
|
||||
|
||||
itemsToBuild.Add(buildItem);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user