User: jbirch
Date: 2009/12/23 06:56 AM

Added:
 /SolutionTransform/trunk/SolutionTransform/
  DontFilter.cs, IRename.cs, RegexFilter.cs, XmlFile.cs
 /SolutionTransform/trunk/SolutionTransform/Solutions/
  CompositeCommand.cs, ExcludeCommand.cs, ISolutionCommand.cs, SolutionFile.cs, 
SolutionProject.cs, TransformCommand.cs

Modified:
 /SolutionTransform/trunk/Scripts/
  CastleSilverlight.boo
 /SolutionTransform/trunk/SolutionTransform/
  ITransform.cs, Program.cs, SolutionTransform.csproj, StandardTransforms.cs
 /SolutionTransform/trunk/SolutionTransform/CodingStandards/
  StandardizeTransform.cs
 /SolutionTransform/trunk/SolutionTransform/ProjectFile/
  CompositeTransform.cs, MSBuild2003Transform.cs, RebaseAssemblies.cs

Log:
 Reworked the way that transforms work, switched off filter in Castle script.

File Changes:

Directory: /SolutionTransform/trunk/SolutionTransform/CodingStandards/
======================================================================

File [modified]: StandardizeTransform.cs
Delta lines: +27 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/DontFilter.cs                     
        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/DontFilter.cs     2009-12-23 
13:56:14 UTC (rev 703)
@@ -0,0 +1,28 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//     http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using SolutionTransform.Solutions;
+
+namespace SolutionTransform
+{
+       using System;
+
+    public class DontFilter : IProjectFilter
+    {
+        public bool ShouldApply(SolutionProject project)
+        {
+            return !project.IsFolder;
+        }
+    }

Directory: /SolutionTransform/trunk/SolutionTransform/ProjectFile/
==================================================================

File [modified]: CompositeTransform.cs
Delta lines: +5 -5
===================================================================

--- 
SolutionTransform/trunk/SolutionTransform/ProjectFile/MSBuild2003Transform.cs   
    2009-12-23 10:07:59 UTC (rev 702)
+++ 
SolutionTransform/trunk/SolutionTransform/ProjectFile/MSBuild2003Transform.cs   
    2009-12-23 13:56:14 UTC (rev 703)
@@ -21,16 +21,16 @@
                protected static string build2003 = 
"http://schemas.microsoft.com/developer/msbuild/2003";;
                protected XmlNamespaceManager namespaces = null;
 
-               public void ApplyTransform(string path, XmlDocument document)
+        public void ApplyTransform(XmlFile xmlFile)
                {
-                       namespaces = new 
XmlNamespaceManager(document.NameTable);
+                       namespaces = new 
XmlNamespaceManager(xmlFile.Document.NameTable);
                        namespaces.AddNamespace("x", build2003);
-                       DoApplyTransform(path, document);
+                       DoApplyTransform(xmlFile);
                }
 
-               public virtual void DoApplyTransform(string path, XmlDocument 
document)
+               public virtual void DoApplyTransform(XmlFile xmlFile)
                {
-                       DoApplyTransform(document);
+            DoApplyTransform(xmlFile.Document);
                }
 

File [modified]: MSBuild2003Transform.cs
Delta lines: +4 -3
===================================================================

--- SolutionTransform/trunk/SolutionTransform/ProjectFile/RebaseAssemblies.cs   
2009-12-23 10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/ProjectFile/RebaseAssemblies.cs   
2009-12-23 13:56:14 UTC (rev 703)
@@ -5,6 +5,7 @@
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Xml;
+using SolutionTransform.Solutions;
 
 namespace SolutionTransform.ProjectFile
 {
@@ -23,10 +24,10 @@
             this.absolutePaths = relativePaths.Select(p => p.Contains(":") ? p 
: Path.Combine(solutionDirectory, p)).ToList();
         }
 
-        public override void DoApplyTransform(string path, XmlDocument 
document)
+        public override void DoApplyTransform(XmlFile xmlFile)
         {
             // TODO: Centralize path hacking logic
-            foreach (XmlElement hintPath in 
document.SelectNodes("//x:HintPath", namespaces))
+            foreach (XmlElement hintPath in 
xmlFile.Document.SelectNodes("//x:HintPath", namespaces))
             {
                 var fileName = Path.GetFileName(hintPath.InnerText);
                 var directory = absolutePaths.FirstOrDefault(p => 
File.Exists(Path.Combine(p, fileName)));
@@ -39,7 +40,7 @@
                     
                 } else
                 {
-                    var relative = RelativePath(Path.GetDirectoryName(path), 
Path.Combine(directory, fileName));
+                    var relative = 
RelativePath(Path.GetDirectoryName(xmlFile.Path), Path.Combine(directory, 
fileName));
                     hintPath.InnerText = relative;
                 }

File [modified]: RebaseAssemblies.cs
Delta lines: +41 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/RegexFilter.cs                    
        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/RegexFilter.cs    2009-12-23 
13:56:14 UTC (rev 703)
@@ -0,0 +1,42 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using SolutionTransform.Solutions;
+
+namespace SolutionTransform
+{
+    public class RegexFilter : IProjectFilter
+    {
+        private readonly IEnumerable<Regex> patterns;
+
+        public RegexFilter(IEnumerable patterns) : 
this(patterns.Cast<string>())
+        {
+            
+        }
+
+        public RegexFilter(IEnumerable<Regex> patterns)
+        {
+            this.patterns = patterns;
+        }
+
+        public RegexFilter(IEnumerable<string> patterns) 
+            : this(patterns.Select(p => new Regex(Regex.Escape(p), 
RegexOptions.IgnoreCase)).ToList())
+        {
+            
+        }
+
+        public bool ShouldApply(SolutionProject project)
+        {
+            if (project.IsFolder) {
+                return true;
+            }
+            foreach (var validProject in patterns) {
+                if (validProject.IsMatch(project.Name)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }

Directory: /SolutionTransform/trunk/Scripts/
============================================

File [modified]: CastleSilverlight.boo
Delta lines: +3 -3
===================================================================

--- 
SolutionTransform/trunk/SolutionTransform/CodingStandards/StandardizeTransform.cs
   2009-12-23 10:07:59 UTC (rev 702)
+++ 
SolutionTransform/trunk/SolutionTransform/CodingStandards/StandardizeTransform.cs
   2009-12-23 13:56:14 UTC (rev 703)
@@ -33,10 +33,10 @@
                        this.standardizer = standardizer;
                }
 
-               public override void DoApplyTransform(string path, XmlDocument 
document)
+               public override void DoApplyTransform(XmlFile xmlFile)
                {
-                       string root = Path.GetDirectoryName(path);
-                       foreach (XmlElement compile in 
document.SelectNodes("//x:compi...@include]", namespaces))
+            string root = Path.GetDirectoryName(xmlFile.Path);
+            foreach (XmlElement compile in 
xmlFile.Document.SelectNodes("//x:compi...@include]", namespaces))
                        {
                                string include = 
compile.GetAttribute("Include");

Directory: /SolutionTransform/trunk/SolutionTransform/
======================================================

File [added]: DontFilter.cs
Delta lines: +10 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/IRename.cs                        
        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/IRename.cs        2009-12-23 
13:56:14 UTC (rev 703)
@@ -0,0 +1,11 @@
+namespace SolutionTransform
+{
+    public interface IRename
+    {
+        string RenameCsproj(string csproj);
+        string RenameSln(string solutionPath);
+        string RenameSolutionProjectName(string name);
+
+        string RenameProjectName(string name);
+    }

File [added]: IRename.cs
Delta lines: +2 -4
===================================================================

--- SolutionTransform/trunk/SolutionTransform/ITransform.cs     2009-12-23 
10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/ITransform.cs     2009-12-23 
13:56:14 UTC (rev 703)
@@ -14,10 +14,8 @@
 
 namespace SolutionTransform
 {
-       using System.Xml;
-
-       public interface ITransform
+    public interface ITransform
        {
-               void ApplyTransform(string path, XmlDocument document);
+               void ApplyTransform(XmlFile xmlFile);
        }

File [modified]: ITransform.cs
Delta lines: +1 -1
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Program.cs        2009-12-23 
10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/Program.cs        2009-12-23 
13:56:14 UTC (rev 703)
@@ -15,7 +15,7 @@
 using System.IO;
 using System.Reflection;
 using System.Runtime.CompilerServices;
-using System.Text.RegularExpressions;
+using SolutionTransform.Solutions;
 
 [assembly:InternalsVisibleTo("SolutionTransform.Tests")]

File [modified]: Program.cs
Delta lines: +2 -2
===================================================================

--- SolutionTransform/trunk/SolutionTransform/ProjectFile/CompositeTransform.cs 
2009-12-23 10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/ProjectFile/CompositeTransform.cs 
2009-12-23 13:56:14 UTC (rev 703)
@@ -40,11 +40,11 @@
                }
 
 
-               public void ApplyTransform(string path, XmlDocument document)
+               public void ApplyTransform(XmlFile xmlFile)
                {
                        foreach (var transform in transforms)
                        {
-                               transform.ApplyTransform(path, document);
+                transform.ApplyTransform(xmlFile);
                        }
                }

File [added]: RegexFilter.cs
Delta lines: +12 -4
===================================================================

--- SolutionTransform/trunk/SolutionTransform/SolutionTransform.csproj  
2009-12-23 10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/SolutionTransform.csproj  
2009-12-23 13:56:14 UTC (rev 703)
@@ -79,6 +79,8 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="DontRename.cs" />
+    <Compile Include="IProjectFilter.cs" />
+    <Compile Include="IRename.cs" />
     <Compile Include="ProjectFile\AddDefineConstant.cs" />
     <Compile Include="ProjectFile\AddTarget.cs" />
     <Compile Include="ProjectFile\AltDotNetTransform.cs" />
@@ -99,10 +101,16 @@
     <Compile Include="ProjectFile\MapTransformBase.cs" />
     <Compile Include="ProjectFile\RemoveDefineConstant.cs" />
     <Compile Include="ProjectFile\RemoveTarget.cs" />
-    <Compile Include="SolutionFile.cs" />
-    <Compile Include="SolutionProject.cs" />
-    <Compile Include="StandardFilters.cs" />
-    <Compile Include="StandardRenames.cs" />
+    <Compile Include="RegexFilter.cs" />
+    <Compile Include="Solutions\CompositeCommand.cs" />
+    <Compile Include="Solutions\ExcludeCommand.cs" />
+    <Compile Include="Solutions\ISolutionCommand.cs" />
+    <Compile Include="Solutions\SolutionFile.cs" />
+    <Compile Include="Solutions\SolutionProject.cs" />
+    <Compile Include="Solutions\TransformCommand.cs" />
+    <Compile Include="DontFilter.cs" />
+    <Compile Include="RegexRename.cs" />
+    <Compile Include="XmlFile.cs" />
     <Compile Include="StandardTransforms.cs" />
     <Compile Include="TextReaderHelper.cs" />

File [modified]: SolutionTransform.csproj
Delta lines: +21 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/CompositeCommand.cs     
                        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/CompositeCommand.cs     
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+
+namespace SolutionTransform.Solutions
+{
+    public class CompositeCommand : ISolutionCommand
+    {
+        private readonly IEnumerable<ISolutionCommand> underlying;
+
+        public CompositeCommand(IEnumerable<ISolutionCommand> underlying)
+        {
+            this.underlying = underlying;
+        }
+
+        public void Process(SolutionFile solutionFile)
+        {
+            foreach (var command in underlying)
+            {
+                command.Process(solutionFile);
+            }
+        }
+    }

File [modified]: StandardTransforms.cs
Delta lines: +29 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/XmlFile.cs                        
        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/XmlFile.cs        2009-12-23 
13:56:14 UTC (rev 703)
@@ -0,0 +1,30 @@
+using System.Xml;
+
+namespace SolutionTransform
+{
+    public class XmlFile
+    {
+        private readonly string filePath;
+        XmlDocument document;
+
+        public XmlFile(string filePath)
+        {
+            this.filePath = filePath;
+        }
+
+        internal XmlDocument Document {
+            get {
+                if (document == null) {
+                    document = new XmlDocument();
+                    document.Load(filePath);
+                }
+                return document;
+            }
+        }
+
+        public string Path
+        {
+            get { return filePath; }
+        }
+    }

File [added]: XmlFile.cs
Delta lines: +0 -0
===================================================================

Directory: /SolutionTransform/trunk/SolutionTransform/Solutions/
================================================================

File [added]: CompositeCommand.cs
Delta lines: +19 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/ExcludeCommand.cs       
                        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/ExcludeCommand.cs       
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,20 @@
+using System.Linq;
+
+namespace SolutionTransform.Solutions
+{
+    public class ExcludeCommand : ISolutionCommand {
+        private readonly IProjectFilter filter;
+
+        public ExcludeCommand(IProjectFilter filter) {
+            this.filter = filter;
+        }
+
+        public void Process(SolutionFile solutionFile) {
+            foreach (var project in solutionFile.projects.ToList()) {
+                if (!filter.ShouldApply(project)) {
+                    solutionFile.Remove(project);
+                }
+            }
+        }
+    }

File [added]: ExcludeCommand.cs
Delta lines: +6 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/ISolutionCommand.cs     
                        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/ISolutionCommand.cs     
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,7 @@
+namespace SolutionTransform.Solutions
+{
+    public interface ISolutionCommand
+    {
+        void Process(SolutionFile solutionFile);
+    }

File [added]: ISolutionCommand.cs
Delta lines: +113 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/SolutionFile.cs         
                (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/SolutionFile.cs 
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,114 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//     http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using System.Text;
+
+namespace SolutionTransform.Solutions
+{
+       using System;
+       using System.Collections.Generic;
+       using System.IO;
+       using System.Linq;
+       using System.Text.RegularExpressions;
+       using System.Xml;
+    using SolutionTransform.ProjectFile;
+
+    public class SolutionFile {
+               private readonly string path;
+               internal List<string> lines = new List<string>();
+               internal List<SolutionProject> projects;
+
+               public SolutionFile(string path, string content) {
+                       this.path = path;
+                       lines.AddRange(content.AsLines());
+                       // .SkipWhile(l => l.TrimEnd().Length == 0)
+                       // The whole skipwhile thing is to deal with the blank 
lines at the start of the Castle solution file
+                       projects = GetProjects().ToList();
+               }
+
+           public string FullPath
+           {
+               get { return path; }
+           }
+
+
+           IEnumerable<SolutionProject> GetProjects() {
+                       int index = 0;
+                       foreach (var line in lines)
+                       {
+                               if (line.StartsWith("Project"))
+                               {
+                                       yield return new SolutionProject(line, 
index, this);
+                               }
+                               index++;
+                       }
+               }
+
+               public void Remove(SolutionProject solutionProject) {
+                       lines.RemoveRange(solutionProject.lineIndex, 2);  // 
Take out the end project as well
+                       foreach (var project in projects.Where(p => p.lineIndex 
> solutionProject.lineIndex)) {
+                               project.lineIndex -= 2;
+                       }
+                       var regex = new Regex(solutionProject.Id.ToString(), 
RegexOptions.IgnoreCase);
+                       lines.RemoveAll(regex.IsMatch);
+                       projects.Remove(solutionProject);
+               }
+
+        public void Transform(IRename rename, ISolutionCommand solutionCommand)
+        {
+            solutionCommand.Process(this);
+            var renameCommand = new TransformCommand(new DontFilter(), new 
NameTransform(rename));
+            renameCommand.Process(this);
+
+            foreach (var project in projects.Where(p => !p.IsFolder)) {
+                project.Name = rename.RenameSolutionProjectName(project.Name);
+                project.Path = rename.RenameCsproj(project.Path);
+                
project.XmlFile.Document.Save(rename.RenameCsproj(project.XmlFile.Path));
+                // Note that project.Path and project.XmlFile.Path have 
different values....
+            }
+            Save(rename.RenameSln(path));
+        }
+
+        public void Transform(IRename rename, IProjectFilter filter, 
ITransform transform)
+               {
+            Transform(rename, new TransformCommand(filter, transform));
+               }
+
+        public void Transform(IRename rename, IProjectFilter filter, params 
ITransform[] transforms) {
+                       Transform(rename, filter, new 
CompositeTransform(transforms));
+               }
+
+               private void Save(string destination)
+               {
+            // NB Solution files will not load unless you save them as 
Unicode.  In particular, UTF8 doesn't work.
+                       using (var writer = new StreamWriter(destination, 
false, Encoding.Unicode))
+                       {
+                writer.WriteLine();  // Guarantee a blank line
+                               foreach (var line in 
lines.SkipWhile(string.IsNullOrEmpty)) // Skip any others
+                               {
+                                       writer.WriteLine(line);
+                               }
+                               writer.Flush();
+                       }
+               }
+
+           internal string BasePath
+           {
+               get
+               {
+                return Path.GetDirectoryName(path);
+               }
+           }
+       }

File [added]: SolutionFile.cs
Delta lines: +79 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/SolutionProject.cs      
                        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/SolutionProject.cs      
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,80 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//     http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace SolutionTransform.Solutions
+{
+       using System;
+
+       public class SolutionProject {
+               internal int lineIndex;
+               private readonly SolutionFile file;
+               private Guid type;
+               private string name;
+        private string path;
+        private XmlFile xmlFile;
+               private Guid id;
+
+               public SolutionProject(string line, int lineIndex, SolutionFile 
file) {
+                       this.lineIndex = lineIndex;
+                       this.file = file;
+                       var components = line.Split('"');
+                       type = new Guid(components[1]);
+                       name = components[3];
+            path = components[5];
+            xmlFile = new XmlFile(System.IO.Path.Combine(file.BasePath, path));
+                       id = new Guid(components[7]);
+               }
+
+           public XmlFile XmlFile
+           {
+               get { return xmlFile; }
+           }
+
+           public bool IsFolder { get
+               {
+                               return type == FolderProject;
+               }}
+
+               public readonly static Guid FolderProject = new 
Guid("{2150E333-8FDC-42A3-9474-1A3956D46DE8}");
+
+               public Guid Id {
+                       get { return id; }
+               }
+
+               public string Path {
+                       get { return path; }
+                       set { path = value; WriteLineBack(); }
+               }
+
+               public string Name {
+                       get { return name; }
+                       set { name = value; WriteLineBack(); }
+               }
+
+               public Guid Type {
+                       get { return type; }
+               }
+
+               void WriteLineBack() {
+                       var line = string.Format(@"Project(""{{{0}}}"") = 
""{1}"", ""{2}"", ""{{{3}}}""",
+                                                                        Type, 
Name, Path, Id
+                               );
+                       file.lines[lineIndex] = line;
+               }
+
+        
+
+           
+       }

File [added]: SolutionProject.cs
Delta lines: +23 -0
===================================================================

--- SolutionTransform/trunk/SolutionTransform/Solutions/TransformCommand.cs     
                        (rev 0)
+++ SolutionTransform/trunk/SolutionTransform/Solutions/TransformCommand.cs     
2009-12-23 13:56:14 UTC (rev 703)
@@ -0,0 +1,24 @@
+using System.Linq;
+
+namespace SolutionTransform.Solutions
+{
+    public class TransformCommand : ISolutionCommand
+    {
+        private readonly IProjectFilter filter;
+        private readonly ITransform transform;
+
+        public TransformCommand(IProjectFilter filter, ITransform transform)
+        {
+            this.filter = filter;
+            this.transform = transform;
+        }
+
+        public void Process(SolutionFile solutionFile)
+        {
+            foreach (var project in 
solutionFile.projects.Where(filter.ShouldApply))
+            {
+                transform.ApplyTransform(project.XmlFile);
+            }
+        }
+    }

File [added]: TransformCommand.cs
Delta lines: +16 -4
===================================================================

--- SolutionTransform/trunk/SolutionTransform/StandardTransforms.cs     
2009-12-23 10:07:59 UTC (rev 702)
+++ SolutionTransform/trunk/SolutionTransform/StandardTransforms.cs     
2009-12-23 13:56:14 UTC (rev 703)
@@ -22,8 +22,9 @@
                public static ITransform SilverlightTransform() {
                        return new CompositeTransform(
                                new MainSolutionTransform(),
+                RemoveFlavourTargetsAndDefines(),
                                new AddDefineConstant("SILVERLIGHT"),
-                               new RemoveDefineConstant("DOTNET35"),
+                new AddTarget(SilverlightTarget),
                                new ReferenceMapTransform
                                    {
                                                { "System", "mscorlib", 
"system" },
@@ -32,13 +33,24 @@
                                                { "System.Web" },
                                                { "System.Configuration" },
                                                { "System.Runtime.Remoting" },
-                                       },
-                               new 
AddTarget(@"$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets"),
-                               new 
RemoveTarget(@"$(MSBuildToolsPath)\Microsoft.CSharp.targets")
+                                       }
                );
                }
 
+        static readonly string SilverlightTarget = 
@"$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets";
+        static readonly string CsharpTarget = 
@"(MSBuildToolsPath)\Microsoft.CSharp.targets";
 
+        public static ITransform RemoveFlavourTargetsAndDefines()
+        {
+            return new CompositeTransform(
+                new RemoveDefineConstant("DOTNET35"),
+                new RemoveDefineConstant("SILVERLIGHT"),
+                new RemoveTarget(CsharpTarget),
+                new RemoveTarget(SilverlightTarget)
+                );
+        }
+
+
                public static ITransform CastleStandardsTransform()
                {

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=en.


Reply via email to