- 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;
|
project.Profile = GraphicsProfile.Reach;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (reader.ReadElementContentAsString())
|
string profileElement = reader.ReadElementContentAsString();
|
||||||
|
GraphicsProfile profile;
|
||||||
|
if (Enum.TryParse<GraphicsProfile>(profileElement, true, out profile))
|
||||||
{
|
{
|
||||||
case "Reach":
|
project.Profile = profile;
|
||||||
project.Profile = GraphicsProfile.Reach;
|
|
||||||
break;
|
|
||||||
case "HiDef":
|
|
||||||
project.Profile = GraphicsProfile.HiDef;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,35 +277,11 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
|||||||
{
|
{
|
||||||
if (versionMajor == 1 && versionMinor >= 0)
|
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;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,10 @@
|
|||||||
<Project>{2DAFDFC1-223B-4741-87BB-BE3D0A7617DB}</Project>
|
<Project>{2DAFDFC1-223B-4741-87BB-BE3D0A7617DB}</Project>
|
||||||
<Name>ANX.Framework.Content.Pipeline</Name>
|
<Name>ANX.Framework.Content.Pipeline</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
|
||||||
|
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||||
|
<Name>ANX.Framework</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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))
|
if (File.Exists(arg))
|
||||||
{
|
{
|
||||||
BuildItem buildItem = new BuildItem();
|
if (Path.GetExtension(arg) == ".cproj")
|
||||||
buildItem.ImporterName = ImporterManager.GuessImporterByFileExtension(arg);
|
{
|
||||||
//TODO: set configured processor name
|
var contentProject = ContentProject.Load(arg);
|
||||||
buildItem.SourceFilename = arg;
|
|
||||||
buildItem.AssetName = System.IO.Path.GetFileNameWithoutExtension(arg);
|
|
||||||
buildItem.OutputFilename = String.Format("{0}.xnb", buildItem.AssetName);
|
|
||||||
|
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user