Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed pipeline from WindowsGL solution.

  • Loading branch information...
commit b2b35d23b8253e70080fb241bf13884fe9d182a1 1 parent ab47290
@tomspilman tomspilman authored
View
56 MonoGame.Framework.Content.Pipeline/Builder/PipelineManager.cs
@@ -237,7 +237,7 @@ public IContentProcessor CreateProcessor(string name, OpaqueDataDictionary proce
return processor;
}
- public PipelineBuildEvent BuildContent(string sourceFilepath, string outputFilepath = null, string importerName = null, string processorName = null, OpaqueDataDictionary processorParameters = null)
+ private void ResolveOutputFilepath(string sourceFilepath, ref string outputFilepath)
{
// If the output path is null... build it from the source file path.
if (string.IsNullOrEmpty(outputFilepath))
@@ -261,6 +261,18 @@ public PipelineBuildEvent BuildContent(string sourceFilepath, string outputFilep
if (!Path.IsPathRooted(outputFilepath))
outputFilepath = Path.Combine(OutputDirectory, outputFilepath);
}
+ }
+
+ private PipelineBuildEvent LoadBuildEvent(string destFile, out string eventFilepath)
+ {
+ var contentPath = Path.ChangeExtension(PathHelper.GetRelativePath(OutputDirectory, destFile), ".content");
+ eventFilepath = Path.Combine(IntermediateDirectory, contentPath);
+ return PipelineBuildEvent.Load(eventFilepath);
+ }
+
+ public PipelineBuildEvent BuildContent(string sourceFilepath, string outputFilepath = null, string importerName = null, string processorName = null, OpaqueDataDictionary processorParameters = null)
+ {
+ ResolveOutputFilepath(sourceFilepath, ref outputFilepath);
// Resolve the importer name.
if (string.IsNullOrEmpty(importerName))
@@ -281,9 +293,8 @@ public PipelineBuildEvent BuildContent(string sourceFilepath, string outputFilep
};
// Load the previous content event if it exists.
- var contentPath = Path.ChangeExtension(PathHelper.GetRelativePath(OutputDirectory, contentEvent.DestFile), ".content");
- var eventFilepath = Path.Combine(IntermediateDirectory, contentPath);
- var cachedEvent = PipelineBuildEvent.Load(eventFilepath);
+ string eventFilepath;
+ var cachedEvent = LoadBuildEvent(contentEvent.DestFile, out eventFilepath);
BuildContent(contentEvent, cachedEvent, eventFilepath);
@@ -297,10 +308,9 @@ public void BuildContent(PipelineBuildEvent pipelineEvent, PipelineBuildEvent ca
{
// While this asset doesn't need to be rebuilt the dependent assets might.
foreach (var asset in cachedEvent.BuildAsset)
- {
- var assetPath = Path.ChangeExtension(PathHelper.GetRelativePath(OutputDirectory, asset), ".content");
- var assetEventFilepath = Path.Combine(IntermediateDirectory, assetPath);
- var assetCachedEvent = PipelineBuildEvent.Load(assetEventFilepath);
+ {
+ string assetEventFilepath;
+ var assetCachedEvent = LoadBuildEvent(asset, out assetEventFilepath);
// If we cannot find the cached event for the dependancy
// then we have to trigger a rebuild of the parent content.
@@ -375,6 +385,36 @@ public void BuildContent(PipelineBuildEvent pipelineEvent, PipelineBuildEvent ca
}
}
+ public void CleanContent(string sourceFilepath, string outputFilepath = null)
+ {
+ // First try to load the event file.
+ ResolveOutputFilepath(sourceFilepath, ref outputFilepath);
+ string eventFilepath;
+ var cachedEvent = LoadBuildEvent(outputFilepath, out eventFilepath);
+
+ if (cachedEvent != null)
+ {
+ foreach (var asset in cachedEvent.BuildAsset)
+ {
+ string assetEventFilepath;
+ var assetCachedEvent = LoadBuildEvent(asset, out assetEventFilepath);
+
+ if (assetCachedEvent == null)
+ {
+ File.Delete(asset);
+ File.Delete(assetEventFilepath);
+ continue;
+ }
+
+ // Give the asset a chance to rebuild.
+ CleanContent(string.Empty, asset);
+ }
+ }
+
+ File.Delete(outputFilepath);
+ File.Delete(eventFilepath);
+ }
+
private void WriteXnb(object content, PipelineBuildEvent pipelineEvent)
{
// Make sure the output directory exists.
View
6 MonoGame.Framework.WindowsGL.sln
@@ -5,8 +5,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.WindowsG
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network.Windows", "ThirdParty\Lidgren.Network\Lidgren.Network.Windows.csproj", "{AE483C29-042E-4226-BA52-D247CE7676DA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.Content.Pipeline.Windows", "MonoGame.Framework.Content.Pipeline\MonoGame.Framework.Content.Pipeline.Windows.csproj", "{B950DE10-AC5D-4BD9-B817-51247C4A732D}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -21,10 +19,6 @@ Global
{AE483C29-042E-4226-BA52-D247CE7676DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|Any CPU.Build.0 = Release|Any CPU
- {B950DE10-AC5D-4BD9-B817-51247C4A732D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B950DE10-AC5D-4BD9-B817-51247C4A732D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B950DE10-AC5D-4BD9-B817-51247C4A732D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B950DE10-AC5D-4BD9-B817-51247C4A732D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Please sign in to comment.
Something went wrong with that request. Please try again.