aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild')
-rw-r--r--Prebuild/ChangeLog19
-rw-r--r--Prebuild/prebuild.xml13
-rw-r--r--Prebuild/runprebuild.bat127
-rw-r--r--Prebuild/runprebuild.sh3
-rw-r--r--Prebuild/src/Core/Attributes/DataNodeAttribute.cs84
-rw-r--r--Prebuild/src/Core/Attributes/OptionNodeAttribute.cs84
-rw-r--r--Prebuild/src/Core/Attributes/TargetAttribute.cs84
-rw-r--r--Prebuild/src/Core/FatalException.cs114
-rw-r--r--Prebuild/src/Core/Interfaces/IDataNode.cs52
-rw-r--r--Prebuild/src/Core/Interfaces/ITarget.cs62
-rw-r--r--Prebuild/src/Core/Kernel.cs1408
-rw-r--r--Prebuild/src/Core/Nodes/AuthorNode.cs124
-rw-r--r--Prebuild/src/Core/Nodes/CleanFilesNode.cs18
-rw-r--r--Prebuild/src/Core/Nodes/CleanupNode.cs74
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNode.cs372
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs90
-rw-r--r--Prebuild/src/Core/Nodes/DataNode.cs172
-rw-r--r--Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs6
-rw-r--r--Prebuild/src/Core/Nodes/DescriptionNode.cs124
-rw-r--r--Prebuild/src/Core/Nodes/ExcludeNode.cs78
-rw-r--r--Prebuild/src/Core/Nodes/FileNode.cs456
-rw-r--r--Prebuild/src/Core/Nodes/FilesNode.cs284
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs458
-rw-r--r--Prebuild/src/Core/Nodes/OptionsNode.cs1196
-rw-r--r--Prebuild/src/Core/Nodes/ProcessNode.cs166
-rw-r--r--Prebuild/src/Core/Nodes/ProjectNode.cs1006
-rw-r--r--Prebuild/src/Core/Nodes/ReferenceNode.cs218
-rw-r--r--Prebuild/src/Core/Nodes/ReferencePathNode.cs124
-rw-r--r--Prebuild/src/Core/Nodes/SolutionNode.cs516
-rw-r--r--Prebuild/src/Core/Parse/IfContext.cs268
-rw-r--r--Prebuild/src/Core/Parse/Preprocessor.cs1088
-rw-r--r--Prebuild/src/Core/Targets/AutotoolsTarget.cs14
-rw-r--r--Prebuild/src/Core/Targets/DebugTarget.cs110
-rw-r--r--Prebuild/src/Core/Targets/MakefileTarget.cs20
-rw-r--r--Prebuild/src/Core/Targets/MonoDevelopTarget.cs964
-rw-r--r--Prebuild/src/Core/Targets/NAntTarget.cs771
-rw-r--r--Prebuild/src/Core/Targets/SharpDevelop2Target.cs88
-rw-r--r--Prebuild/src/Core/Targets/SharpDevelopTarget.cs794
-rw-r--r--Prebuild/src/Core/Targets/ToolInfo.cs356
-rw-r--r--Prebuild/src/Core/Targets/VS2002Target.cs114
-rw-r--r--Prebuild/src/Core/Targets/VS2003Target.cs1132
-rw-r--r--Prebuild/src/Core/Targets/VS2005Target.cs26
-rw-r--r--Prebuild/src/Core/Targets/VS2008Target.cs180
-rw-r--r--Prebuild/src/Core/Targets/VS2010Target.cs204
-rw-r--r--Prebuild/src/Core/Targets/VS2012Target.cs138
-rw-r--r--Prebuild/src/Core/Targets/VS2013Target.cs139
-rw-r--r--Prebuild/src/Core/Targets/VS2015Target.cs143
-rw-r--r--Prebuild/src/Core/Targets/VSGenericTarget.cs1767
-rw-r--r--Prebuild/src/Core/Targets/VSVersion.cs79
-rw-r--r--Prebuild/src/Core/Targets/XcodeTarget.cs24
-rw-r--r--Prebuild/src/Core/UnknownLanguageException.cs76
-rw-r--r--Prebuild/src/Core/Utilities/CommandLineCollection.cs254
-rw-r--r--Prebuild/src/Core/Utilities/CurrentDirectory.cs80
-rw-r--r--Prebuild/src/Core/Utilities/Helper.cs1036
-rw-r--r--Prebuild/src/Core/Utilities/Log.cs434
-rw-r--r--Prebuild/src/Core/WarningException.cs112
-rw-r--r--Prebuild/src/Prebuild.cs236
-rw-r--r--Prebuild/src/Properties/AssemblyInfo.cs26
-rw-r--r--Prebuild/src/data/prebuild-1.10.xsd5
59 files changed, 9447 insertions, 8763 deletions
diff --git a/Prebuild/ChangeLog b/Prebuild/ChangeLog
index bb8e7b0..a7d0612 100644
--- a/Prebuild/ChangeLog
+++ b/Prebuild/ChangeLog
@@ -1,3 +1,22 @@
12017, August Unit Umarov
2 * add Freak Tech patch for prefer32bit default to false
3 * fix comand line target override
4 * fix CSharp target assembly name
5
62015, June Fly-Man- <fly.man.opensim@gmail.com>
7 * V2.0.7 (WhiteCore Build)
8 * Added the VS2012/VS2013 targets so .Net 4.5 can be used for WhiteCore
9 * Cleaned up the SharpDevelop2 code part
10
112015, April rowan Deppeler <greythane@gmail.com>
12 * V2.0.6w (WhiteCore build
13 * No changes to the code as it appears development has now stalled at 1.10
14 - Incorporated (Rev's, I think) patches from Aurora to provide for passing the framework
15 and additional conditionals in the Prebuild.xml spec
16 - Re-built using Net 4.0 framework to provide for use on unmodified Windows 8 systems (No Net 3.5)
17 - Included Solution and project files to assist building if required
18
19
12008-12-09T02:15 D. Moonfire <d.moonfire@mfgames.com> 202008-12-09T02:15 D. Moonfire <d.moonfire@mfgames.com>
2 * src/Core/Kernel.cs 21 * src/Core/Kernel.cs
3 - Added a /ppi target to get the results of processing but before 22 - Added a /ppi target to get the results of processing but before
diff --git a/Prebuild/prebuild.xml b/Prebuild/prebuild.xml
index f39175b..f0003df 100644
--- a/Prebuild/prebuild.xml
+++ b/Prebuild/prebuild.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd" version="1.10"> 2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.10.xsd" version="1.10">
3 <Solution name="Prebuild" version="2.0.6"> 3 <Solution name="Prebuild" version="2.0.7">
4 <Configuration name="Debug"> 4 <Configuration name="Debug">
5 <Options> 5 <Options>
6 <CompilerDefines>DEBUG;TRACE</CompilerDefines> 6 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
@@ -21,7 +21,6 @@
21 </Configuration> 21 </Configuration>
22 <Files> 22 <Files>
23 <File>prebuild.xml</File> 23 <File>prebuild.xml</File>
24 <File>prebuild</File>
25 </Files> 24 </Files>
26 <Project name="Prebuild" 25 <Project name="Prebuild"
27 path="src" 26 path="src"
@@ -31,8 +30,8 @@
31 type="Exe" 30 type="Exe"
32 rootNamespace="Prebuild" 31 rootNamespace="Prebuild"
33 startupObject="Prebuild.Prebuild" 32 startupObject="Prebuild.Prebuild"
34 version="2.0.6" 33 version="2.0.7"
35 frameworkVersion="v3_5" 34 frameworkVersion="v4_0"
36 > 35 >
37 <Author>Matthew Holmes (matthew@wildfiregames.com)</Author> 36 <Author>Matthew Holmes (matthew@wildfiregames.com)</Author>
38 <Author>Dan Moorehead (dan05a@gmail.com)</Author> 37 <Author>Dan Moorehead (dan05a@gmail.com)</Author>
@@ -40,6 +39,8 @@
40 <Author>Rob Loach (http://robloach.net)</Author> 39 <Author>Rob Loach (http://robloach.net)</Author>
41 <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author> 40 <Author>C.J. Adams-Collier (cjac@colliertech.org)</Author>
42 <Author>John Hurliman (john.hurliman@intel.com)</Author> 41 <Author>John Hurliman (john.hurliman@intel.com)</Author>
42 <Author>WhiteCore build (2015) Rowan Deppeler (greythan@gmail.com)</Author>
43 <Author>OpenSimulator build (2017) AJLDuarte</Author>
43 <Description>The Prebuild project generator</Description> 44 <Description>The Prebuild project generator</Description>
44 <Configuration name="Debug"> 45 <Configuration name="Debug">
45 <Options> 46 <Options>
@@ -68,7 +69,9 @@
68 <Match pattern="App.ico" buildAction="EmbeddedResource"/> 69 <Match pattern="App.ico" buildAction="EmbeddedResource"/>
69 <Match path="data" pattern="prebuild-1.10.xsd" buildAction="EmbeddedResource"/> 70 <Match path="data" pattern="prebuild-1.10.xsd" buildAction="EmbeddedResource"/>
70 <Match path="data" pattern="autotools.xml" buildAction="EmbeddedResource"/> 71 <Match path="data" pattern="autotools.xml" buildAction="EmbeddedResource"/>
71 <Match pattern="*.cs" recurse="true"/> 72 <Match pattern="*.cs" recurse="true">
73 <Exclude name="obj" pattern="obj"/>
74 </Match>
72 </Files> 75 </Files>
73 </Project> 76 </Project>
74 </Solution> 77 </Solution>
diff --git a/Prebuild/runprebuild.bat b/Prebuild/runprebuild.bat
new file mode 100644
index 0000000..5cdef31
--- /dev/null
+++ b/Prebuild/runprebuild.bat
@@ -0,0 +1,127 @@
1
2
3rem Prebuild.exe /target VS2010
4
5@ECHO OFF
6
7echo ==========================================
8echo ==== WhiteCore Prebuild Configuration ====
9echo ==========================================
10echo.
11echo If you wish to customize the configuration, re-run with the switch '-p'
12echo e.g. runprebuild -p
13echo.
14
15rem ## Default "configuration" choice ((r)elease, (d)ebug)
16set configuration=d
17
18rem ## Default Visual Studio edition
19set vstudio=2010
20
21rem ## Default Framework
22set framework=4_0
23
24rem ## Default architecture (86 (for 32bit), 64)
25:CheckArch
26set bits=AnyCPU
27rem if exist "%PROGRAMFILES(X86)%" (set bits=x64)
28rem if %bits% == x64 (
29rem echo Found 64bit architecture
30rem )
31rem if %bits% == x86 (
32rem echo Found 32 bit architecture
33rem )
34
35rem ## Determine native framework
36:CheckOS
37set framework=4_5
38for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
39if %version% == 10.0 (
40 set framework=4_5
41 echo Windows 10
42)
43if %version% == 6.3 (
44 set framework=4_5
45 echo Windows 8.1 or Server 2012 R2
46)
47if %version% == 6.2 (
48 set framework=4_5
49 echo Windows 8 or Server 2012
50)
51if %version% == 6.1 (
52 set framework=4_0
53 echo Windows 7 or Server 2008 R2
54)
55if %version% == 6.0 (
56 set framework=3_5
57 echo hmmm... Windows Vista or Server 2008
58)
59if %version% == 5.2 (
60 set framework=3_5
61 echo hmmm... Windows XP x64 or Server 2003
62)
63if %version% == 5.1 (
64 set framework=3_5
65 echo hmmm... Windows XP
66)
67
68
69rem ## If not requested, skip the prompting
70if "%1" =="" goto final
71if %1 == -p goto prompt
72if %1 == --prompt goto prompt
73goto final
74
75:prompt
76echo I will now ask you four questions regarding your build.
77echo However, if you wish to build for:
78echo %bits% Architecture
79echo .NET %framework%
80echo Visual Studio %vstudio%
81
82echo.
83echo Simply tap [ENTER] three times.
84echo.
85echo Note that you can change these defaults by opening this
86echo batch file in a text editor.
87echo.
88
89:bits
90set /p bits="Choose your architecture (x86, x64, AnyCPU) [%bits%]: "
91if %bits%==86 goto configuration
92if %bits%==x86 goto configuration
93if %bits%==64 goto configuration
94if %bits%==x64 goto configuration
95if %bits%==AnyCPU goto configuration
96if %bits%==anycpu goto configuration
97echo "%bits%" isn't a valid choice!
98goto bits
99
100:configuration
101set /p configuration="Choose your configuration ((r)elease or (d)ebug)? [%configuration%]: "
102if %configuration%==r goto framework
103if %configuration%==d goto framework
104if %configuration%==release goto framework
105if %configuration%==debug goto framework
106echo "%configuration%" isn't a valid choice!
107goto configuration
108
109:framework
110set /p framework="Choose your .NET framework (4_0 or 4_5)? [%framework%]: "
111if %framework%==4_0 goto final
112if %framework%==4_5 goto final
113echo "%framework%" isn't a valid choice!
114goto framework
115
116:final
117echo.
118echo Configuring for %bits% architecture using %framework% .NET framework
119echo.
120echo.
121
122
123if %framework%==4_5 set %vstudio%=2012
124
125echo Calling Prebuild for target %vstudio% with framework %framework%...
126Prebuild.exe /target vs%vstudio% /targetframework v%framework% /conditionals ISWIN;NET_%framework%
127
diff --git a/Prebuild/runprebuild.sh b/Prebuild/runprebuild.sh
new file mode 100644
index 0000000..4e701b7
--- /dev/null
+++ b/Prebuild/runprebuild.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2#exec mono [PREFIX]/prebuild.exe "$@"
3exec mono Prebuild.exe /target VS2010
diff --git a/Prebuild/src/Core/Attributes/DataNodeAttribute.cs b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs
index cd3cea4..f1938a2 100644
--- a/Prebuild/src/Core/Attributes/DataNodeAttribute.cs
+++ b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -28,45 +28,45 @@ using System.Collections.Specialized;
28 28
29namespace Prebuild.Core.Attributes 29namespace Prebuild.Core.Attributes
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple=true)] 34 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple=true)]
35 public sealed class DataNodeAttribute : Attribute 35 public sealed class DataNodeAttribute : Attribute
36 { 36 {
37 #region Fields 37 #region Fields
38 38
39 private string m_Name = "unknown"; 39 private string m_Name = "unknown";
40 40
41 #endregion 41 #endregion
42 42
43 #region Constructors 43 #region Constructors
44 44
45 /// <summary> 45 /// <summary>
46 /// Initializes a new instance of the <see cref="DataNodeAttribute"/> class. 46 /// Initializes a new instance of the <see cref="DataNodeAttribute"/> class.
47 /// </summary> 47 /// </summary>
48 /// <param name="name">The name.</param> 48 /// <param name="name">The name.</param>
49 public DataNodeAttribute(string name) 49 public DataNodeAttribute(string name)
50 { 50 {
51 m_Name = name; 51 m_Name = name;
52 } 52 }
53 53
54 #endregion 54 #endregion
55 55
56 #region Properties 56 #region Properties
57 57
58 /// <summary> 58 /// <summary>
59 /// Gets the name. 59 /// Gets the name.
60 /// </summary> 60 /// </summary>
61 /// <value>The name.</value> 61 /// <value>The name.</value>
62 public string Name 62 public string Name
63 { 63 {
64 get 64 get
65 { 65 {
66 return m_Name; 66 return m_Name;
67 } 67 }
68 } 68 }
69 69
70 #endregion 70 #endregion
71 } 71 }
72} 72}
diff --git a/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs
index 8ef97a1..2d6a6a7 100644
--- a/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs
+++ b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -27,45 +27,45 @@ using System;
27 27
28namespace Prebuild.Core.Attributes 28namespace Prebuild.Core.Attributes
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// 31 ///
32 /// </summary> 32 /// </summary>
33 [AttributeUsage(AttributeTargets.Field)] 33 [AttributeUsage(AttributeTargets.Field)]
34 public sealed class OptionNodeAttribute : Attribute 34 public sealed class OptionNodeAttribute : Attribute
35 { 35 {
36 #region Fields 36 #region Fields
37 37
38 private string m_NodeName; 38 private string m_NodeName;
39 39
40 #endregion 40 #endregion
41 41
42 #region Constructors 42 #region Constructors
43 43
44 /// <summary> 44 /// <summary>
45 /// Initializes a new instance of the <see cref="OptionNodeAttribute"/> class. 45 /// Initializes a new instance of the <see cref="OptionNodeAttribute"/> class.
46 /// </summary> 46 /// </summary>
47 /// <param name="nodeName">Name of the node.</param> 47 /// <param name="nodeName">Name of the node.</param>
48 public OptionNodeAttribute(string nodeName) 48 public OptionNodeAttribute(string nodeName)
49 { 49 {
50 m_NodeName = nodeName; 50 m_NodeName = nodeName;
51 } 51 }
52 52
53 #endregion 53 #endregion
54 54
55 #region Properties 55 #region Properties
56 56
57 /// <summary> 57 /// <summary>
58 /// Gets the name of the node. 58 /// Gets the name of the node.
59 /// </summary> 59 /// </summary>
60 /// <value>The name of the node.</value> 60 /// <value>The name of the node.</value>
61 public string NodeName 61 public string NodeName
62 { 62 {
63 get 63 get
64 { 64 {
65 return m_NodeName; 65 return m_NodeName;
66 } 66 }
67 } 67 }
68 68
69 #endregion 69 #endregion
70 } 70 }
71} 71}
diff --git a/Prebuild/src/Core/Attributes/TargetAttribute.cs b/Prebuild/src/Core/Attributes/TargetAttribute.cs
index fb30914..5ad62ee 100644
--- a/Prebuild/src/Core/Attributes/TargetAttribute.cs
+++ b/Prebuild/src/Core/Attributes/TargetAttribute.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -27,45 +27,45 @@ using System;
27 27
28namespace Prebuild.Core.Attributes 28namespace Prebuild.Core.Attributes
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// 31 ///
32 /// </summary> 32 /// </summary>
33 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] 33 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
34 public sealed class TargetAttribute : Attribute 34 public sealed class TargetAttribute : Attribute
35 { 35 {
36 #region Fields 36 #region Fields
37 37
38 private string m_Name; 38 private string m_Name;
39 39
40 #endregion 40 #endregion
41 41
42 #region Constructors 42 #region Constructors
43 43
44 /// <summary> 44 /// <summary>
45 /// Initializes a new instance of the <see cref="TargetAttribute"/> class. 45 /// Initializes a new instance of the <see cref="TargetAttribute"/> class.
46 /// </summary> 46 /// </summary>
47 /// <param name="name">The name.</param> 47 /// <param name="name">The name.</param>
48 public TargetAttribute(string name) 48 public TargetAttribute(string name)
49 { 49 {
50 m_Name = name; 50 m_Name = name;
51 } 51 }
52 52
53 #endregion 53 #endregion
54 54
55 #region Properties 55 #region Properties
56 56
57 /// <summary> 57 /// <summary>
58 /// Gets the name. 58 /// Gets the name.
59 /// </summary> 59 /// </summary>
60 /// <value>The name.</value> 60 /// <value>The name.</value>
61 public string Name 61 public string Name
62 { 62 {
63 get 63 get
64 { 64 {
65 return m_Name; 65 return m_Name;
66 } 66 }
67 } 67 }
68 68
69 #endregion 69 #endregion
70 } 70 }
71} 71}
diff --git a/Prebuild/src/Core/FatalException.cs b/Prebuild/src/Core/FatalException.cs
index 751297a..3487905 100644
--- a/Prebuild/src/Core/FatalException.cs
+++ b/Prebuild/src/Core/FatalException.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -28,58 +28,58 @@ using System.Runtime.Serialization;
28 28
29namespace Prebuild.Core 29namespace Prebuild.Core
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 [Serializable()] 34 [Serializable()]
35 public class FatalException : Exception 35 public class FatalException : Exception
36 { 36 {
37 #region Constructors 37 #region Constructors
38 38
39
40 /// <summary>
41 /// Initializes a new instance of the <see cref="FatalException"/> class.
42 /// </summary>
43 public FatalException()
44 {
45 }
39 46
40 /// <summary> 47 /// <summary>
41 /// Initializes a new instance of the <see cref="FatalException"/> class. 48 /// Initializes a new instance of the <see cref="FatalException"/> class.
42 /// </summary> 49 /// </summary>
43 public FatalException() 50 /// <param name="format">The format.</param>
44 { 51 /// <param name="args">The args.</param>
45 } 52 public FatalException(string format, params object[] args)
53 : base(String.Format(format, args))
54 {
55 }
46 56
47 /// <summary> 57 /// <summary>
48 /// Initializes a new instance of the <see cref="FatalException"/> class. 58 /// Exception with specified string
49 /// </summary> 59 /// </summary>
50 /// <param name="format">The format.</param> 60 /// <param name="message">Exception message</param>
51 /// <param name="args">The args.</param> 61 public FatalException(string message): base(message)
52 public FatalException(string format, params object[] args) 62 {
53 : base(String.Format(format, args)) 63 }
54 {
55 }
56 64
57 /// <summary> 65 /// <summary>
58 /// Exception with specified string 66 ///
59 /// </summary> 67 /// </summary>
60 /// <param name="message">Exception message</param> 68 /// <param name="message"></param>
61 public FatalException(string message): base(message) 69 /// <param name="exception"></param>
62 { 70 public FatalException(string message, Exception exception) : base(message, exception)
63 } 71 {
72 }
64 73
65 /// <summary> 74 /// <summary>
66 /// 75 ///
67 /// </summary> 76 /// </summary>
68 /// <param name="message"></param> 77 /// <param name="info"></param>
69 /// <param name="exception"></param> 78 /// <param name="context"></param>
70 public FatalException(string message, Exception exception) : base(message, exception) 79 protected FatalException(SerializationInfo info, StreamingContext context) : base( info, context )
71 { 80 {
72 } 81 }
73 82
74 /// <summary> 83 #endregion
75 /// 84 }
76 /// </summary>
77 /// <param name="info"></param>
78 /// <param name="context"></param>
79 protected FatalException(SerializationInfo info, StreamingContext context) : base( info, context )
80 {
81 }
82
83 #endregion
84 }
85} 85}
diff --git a/Prebuild/src/Core/Interfaces/IDataNode.cs b/Prebuild/src/Core/Interfaces/IDataNode.cs
index 4917b18..986dd2d 100644
--- a/Prebuild/src/Core/Interfaces/IDataNode.cs
+++ b/Prebuild/src/Core/Interfaces/IDataNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -26,22 +26,22 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
26using System; 26using System;
27using System.Xml; 27using System.Xml;
28 28
29namespace Prebuild.Core.Interfaces 29namespace Prebuild.Core.Interfaces
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 public interface IDataNode 34 public interface IDataNode
35 { 35 {
36 /// <summary> 36 /// <summary>
37 /// Gets or sets the parent. 37 /// Gets or sets the parent.
38 /// </summary> 38 /// </summary>
39 /// <value>The parent.</value> 39 /// <value>The parent.</value>
40 IDataNode Parent { get; set; } 40 IDataNode Parent { get; set; }
41 /// <summary> 41 /// <summary>
42 /// Parses the specified node. 42 /// Parses the specified node.
43 /// </summary> 43 /// </summary>
44 /// <param name="node">The node.</param> 44 /// <param name="node">The node.</param>
45 void Parse(XmlNode node); 45 void Parse(XmlNode node);
46 } 46 }
47} 47}
diff --git a/Prebuild/src/Core/Interfaces/ITarget.cs b/Prebuild/src/Core/Interfaces/ITarget.cs
index e4c3ea4..47115c6 100644
--- a/Prebuild/src/Core/Interfaces/ITarget.cs
+++ b/Prebuild/src/Core/Interfaces/ITarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -25,27 +25,27 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
25 25
26using System; 26using System;
27 27
28namespace Prebuild.Core.Interfaces 28namespace Prebuild.Core.Interfaces
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// 31 ///
32 /// </summary> 32 /// </summary>
33 public interface ITarget 33 public interface ITarget
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// Writes the specified kern. 36 /// Writes the specified kern.
37 /// </summary> 37 /// </summary>
38 /// <param name="kern">The kern.</param> 38 /// <param name="kern">The kern.</param>
39 void Write(Kernel kern); 39 void Write(Kernel kern);
40 /// <summary> 40 /// <summary>
41 /// Cleans the specified kern. 41 /// Cleans the specified kern.
42 /// </summary> 42 /// </summary>
43 /// <param name="kern">The kern.</param> 43 /// <param name="kern">The kern.</param>
44 void Clean(Kernel kern); 44 void Clean(Kernel kern);
45 /// <summary> 45 /// <summary>
46 /// Gets the name. 46 /// Gets the name.
47 /// </summary> 47 /// </summary>
48 /// <value>The name.</value> 48 /// <value>The name.</value>
49 string Name { get; } 49 string Name { get; }
50 } 50 }
51} \ No newline at end of file 51} \ No newline at end of file
diff --git a/Prebuild/src/Core/Kernel.cs b/Prebuild/src/Core/Kernel.cs
index 454ff8b..3db92ef 100644
--- a/Prebuild/src/Core/Kernel.cs
+++ b/Prebuild/src/Core/Kernel.cs
@@ -49,202 +49,206 @@ using Prebuild.Core.Interfaces;
49using Prebuild.Core.Nodes; 49using Prebuild.Core.Nodes;
50using Prebuild.Core.Utilities; 50using Prebuild.Core.Utilities;
51 51
52namespace Prebuild.Core 52namespace Prebuild.Core
53{ 53{
54 /// <summary> 54 /// <summary>
55 /// 55 ///
56 /// </summary> 56 /// </summary>
57 public class Kernel : IDisposable 57 public class Kernel : IDisposable
58 { 58 {
59 #region Inner Classes 59 #region Inner Classes
60 60
61 private struct NodeEntry 61 private struct NodeEntry
62 { 62 {
63 public Type Type; 63 public Type Type;
64 public DataNodeAttribute Attribute; 64 public DataNodeAttribute Attribute;
65 } 65 }
66 66
67 #endregion 67 #endregion
68 68
69 #region Fields 69 #region Fields
70 70
71 private static readonly Kernel m_Instance = new Kernel(); 71 private static readonly Kernel m_Instance = new Kernel();
72 72
73 /// <summary> 73 /// <summary>
74 /// This must match the version of the schema that is embeeded 74 /// This must match the version of the schema that is embeeded
75 /// </summary> 75 /// </summary>
76 private const string m_SchemaVersion = "1.10"; 76 private const string m_SchemaVersion = "1.10";
77 private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd"; 77 private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd";
78 private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema; 78 private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema;
79 bool disposed; 79 bool disposed;
80 private Version m_Version; 80 private Version m_Version;
81 private const string m_Revision = ""; 81 private const string m_Revision = "w";
82 private CommandLineCollection m_CommandLine; 82 private CommandLineCollection m_CommandLine;
83 private Log m_Log; 83 private Log m_Log;
84 private CurrentDirectory m_CurrentWorkingDirectory; 84 private CurrentDirectory m_CurrentWorkingDirectory;
85 private XmlSchemaCollection m_Schemas; 85 private XmlSchemaCollection m_Schemas;
86 86
87 private readonly Dictionary<string, ITarget> m_Targets = new Dictionary<string, ITarget>(); 87 private readonly Dictionary<string, ITarget> m_Targets = new Dictionary<string, ITarget>();
88 private readonly Dictionary<string, NodeEntry> m_Nodes = new Dictionary<string, NodeEntry>(); 88 private readonly Dictionary<string, NodeEntry> m_Nodes = new Dictionary<string, NodeEntry>();
89 89
90 readonly List<SolutionNode> m_Solutions = new List<SolutionNode>(); 90 readonly List<SolutionNode> m_Solutions = new List<SolutionNode>();
91 string m_Target; 91 string m_Target;
92 string m_Clean; 92 bool cmdlineTargetFramework;
93 string[] m_RemoveDirectories; 93 FrameworkVersion m_TargetFramework; //Overrides all project settings
94 XmlDocument m_CurrentDoc; 94 string m_Conditionals; //Adds to all project settings
95 bool m_PauseAfterFinish; 95 public string ForcedConditionals { get { return m_Conditionals; } }
96 string[] m_ProjectGroups; 96 string m_Clean;
97 97 string[] m_RemoveDirectories;
98 #endregion 98 XmlDocument m_CurrentDoc;
99 99 bool m_PauseAfterFinish;
100 #region Constructors 100 string[] m_ProjectGroups;
101 101
102 private Kernel() 102 #endregion
103 { 103
104 } 104 #region Constructors
105 105
106 #endregion 106 private Kernel()
107 107 {
108 #region Properties 108 }
109 109
110 /// <summary> 110 #endregion
111 /// Gets a value indicating whether [pause after finish]. 111
112 /// </summary> 112 #region Properties
113 /// <value><c>true</c> if [pause after finish]; otherwise, <c>false</c>.</value> 113
114 public bool PauseAfterFinish 114 /// <summary>
115 { 115 /// Gets a value indicating whether [pause after finish].
116 get 116 /// </summary>
117 { 117 /// <value><c>true</c> if [pause after finish]; otherwise, <c>false</c>.</value>
118 return m_PauseAfterFinish; 118 public bool PauseAfterFinish
119 } 119 {
120 } 120 get
121 121 {
122 /// <summary> 122 return m_PauseAfterFinish;
123 /// Gets the instance. 123 }
124 /// </summary> 124 }
125 /// <value>The instance.</value> 125
126 public static Kernel Instance 126 /// <summary>
127 { 127 /// Gets the instance.
128 get 128 /// </summary>
129 { 129 /// <value>The instance.</value>
130 return m_Instance; 130 public static Kernel Instance
131 } 131 {
132 } 132 get
133 133 {
134 /// <summary> 134 return m_Instance;
135 /// Gets the version. 135 }
136 /// </summary> 136 }
137 /// <value>The version.</value> 137
138 public string Version 138 /// <summary>
139 { 139 /// Gets the version.
140 get 140 /// </summary>
141 { 141 /// <value>The version.</value>
142 return String.Format("{0}.{1}.{2}{3}", m_Version.Major, m_Version.Minor, m_Version.Build, m_Revision); 142 public string Version
143 } 143 {
144 } 144 get
145 145 {
146 /// <summary> 146 return String.Format("{0}.{1}.{2}{3}", m_Version.Major, m_Version.Minor, m_Version.Build, m_Revision);
147 /// Gets the command line. 147 }
148 /// </summary> 148 }
149 /// <value>The command line.</value> 149
150 public CommandLineCollection CommandLine 150 /// <summary>
151 { 151 /// Gets the command line.
152 get 152 /// </summary>
153 { 153 /// <value>The command line.</value>
154 return m_CommandLine; 154 public CommandLineCollection CommandLine
155 } 155 {
156 } 156 get
157 157 {
158 /// <summary> 158 return m_CommandLine;
159 /// Gets the targets. 159 }
160 /// </summary> 160 }
161 /// <value>The targets.</value> 161
162 public Dictionary<string, ITarget> Targets 162 /// <summary>
163 { 163 /// Gets the targets.
164 get 164 /// </summary>
165 { 165 /// <value>The targets.</value>
166 return m_Targets; 166 public Dictionary<string, ITarget> Targets
167 } 167 {
168 } 168 get
169 169 {
170 /// <summary> 170 return m_Targets;
171 /// Gets the log. 171 }
172 /// </summary> 172 }
173 /// <value>The log.</value> 173
174 public Log Log 174 /// <summary>
175 { 175 /// Gets the log.
176 get 176 /// </summary>
177 { 177 /// <value>The log.</value>
178 return m_Log; 178 public Log Log
179 } 179 {
180 } 180 get
181 181 {
182 /// <summary> 182 return m_Log;
183 /// Gets the current working directory. 183 }
184 /// </summary> 184 }
185 /// <value>The current working directory.</value> 185
186 public CurrentDirectory CurrentWorkingDirectory 186 /// <summary>
187 { 187 /// Gets the current working directory.
188 get 188 /// </summary>
189 { 189 /// <value>The current working directory.</value>
190 return m_CurrentWorkingDirectory; 190 public CurrentDirectory CurrentWorkingDirectory
191 } 191 {
192 } 192 get
193 193 {
194 /// <summary> 194 return m_CurrentWorkingDirectory;
195 /// Gets the solutions. 195 }
196 /// </summary> 196 }
197 /// <value>The solutions.</value> 197
198 public List<SolutionNode> Solutions 198 /// <summary>
199 { 199 /// Gets the solutions.
200 get 200 /// </summary>
201 { 201 /// <value>The solutions.</value>
202 return m_Solutions; 202 public List<SolutionNode> Solutions
203 } 203 {
204 } 204 get
205 205 {
206 /// <summary> 206 return m_Solutions;
207 /// Gets the XmlDocument object representing the prebuild.xml 207 }
208 /// being processed 208 }
209 /// </summary> 209
210 /// <value>The XmlDocument object</value> 210 /// <summary>
211 public XmlDocument CurrentDoc 211 /// Gets the XmlDocument object representing the prebuild.xml
212 { 212 /// being processed
213 get 213 /// </summary>
214 { 214 /// <value>The XmlDocument object</value>
215 return m_CurrentDoc; 215 public XmlDocument CurrentDoc
216 } 216 {
217 } 217 get
218 218 {
219 #endregion 219 return m_CurrentDoc;
220 220 }
221 #region Private Methods 221 }
222 222
223 private static void RemoveDirectories(string rootDir, string[] dirNames) 223 #endregion
224 { 224
225 foreach(string dir in Directory.GetDirectories(rootDir)) 225 #region Private Methods
226 { 226
227 string simpleName = Path.GetFileName(dir); 227 private static void RemoveDirectories(string rootDir, string[] dirNames)
228 228 {
229 if(Array.IndexOf(dirNames, simpleName) != -1) 229 foreach(string dir in Directory.GetDirectories(rootDir))
230 { 230 {
231 //delete if the name matches one of the directory names to delete 231 string simpleName = Path.GetFileName(dir);
232 string fullDirPath = Path.GetFullPath(dir); 232
233 Directory.Delete(fullDirPath,true); 233 if(Array.IndexOf(dirNames, simpleName) != -1)
234 } 234 {
235 else//not a match, so check children 235 //delete if the name matches one of the directory names to delete
236 { 236 string fullDirPath = Path.GetFullPath(dir);
237 RemoveDirectories(dir,dirNames); 237 Directory.Delete(fullDirPath,true);
238 //recurse, checking children for them 238 }
239 } 239 else//not a match, so check children
240 } 240 {
241 } 241 RemoveDirectories(dir,dirNames);
242 242 //recurse, checking children for them
243// private void RemoveDirectoryMatches(string rootDir, string dirPattern) 243 }
244 }
245 }
246
247// private void RemoveDirectoryMatches(string rootDir, string dirPattern)
244// { 248// {
245// foreach(string dir in Directory.GetDirectories(rootDir)) 249// foreach(string dir in Directory.GetDirectories(rootDir))
246// { 250// {
247// foreach(string match in Directory.GetDirectories(dir)) 251// foreach(string match in Directory.GetDirectories(dir))
248// {//delete all child directories that match 252// {//delete all child directories that match
249// Directory.Delete(Path.GetFullPath(match),true); 253// Directory.Delete(Path.GetFullPath(match),true);
250// } 254// }
@@ -253,56 +257,56 @@ namespace Prebuild.Core
253// } 257// }
254// } 258// }
255 259
256 private void LoadSchema() 260 private void LoadSchema()
257 { 261 {
258 Assembly assembly = GetType().Assembly; 262 Assembly assembly = GetType().Assembly;
259 Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema); 263 Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema);
260 if(stream == null) 264 if(stream == null)
261 { 265 {
262 //try without the default namespace prepending to it in case was compiled with SharpDevelop or MonoDevelop instead of Visual Studio .NET 266 //try without the default namespace prepending to it in case was compiled with SharpDevelop or MonoDevelop instead of Visual Studio .NET
263 stream = assembly.GetManifestResourceStream(m_Schema); 267 stream = assembly.GetManifestResourceStream(m_Schema);
264 if(stream == null) 268 if(stream == null)
265 { 269 {
266 throw new System.Reflection.TargetException(string.Format("Could not find the scheme embedded resource file '{0}'.", m_Schema)); 270 throw new System.Reflection.TargetException(string.Format("Could not find the scheme embedded resource file '{0}'.", m_Schema));
267 } 271 }
268 } 272 }
269 XmlReader schema = new XmlTextReader(stream); 273 XmlReader schema = new XmlTextReader(stream);
270 274
271 m_Schemas = new XmlSchemaCollection(); 275 m_Schemas = new XmlSchemaCollection();
272 m_Schemas.Add(m_SchemaURI, schema); 276 m_Schemas.Add(m_SchemaURI, schema);
273 } 277 }
274 278
275 private void CacheVersion() 279 private void CacheVersion()
276 { 280 {
277 m_Version = Assembly.GetEntryAssembly().GetName().Version; 281 m_Version = Assembly.GetEntryAssembly().GetName().Version;
278 } 282 }
279 283
280 private void CacheTargets(Assembly assm) 284 private void CacheTargets(Assembly assm)
281 { 285 {
282 foreach(Type t in assm.GetTypes()) 286 foreach(Type t in assm.GetTypes())
283 { 287 {
284 TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget)); 288 TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget));
285 289
286 if(ta == null) 290 if(ta == null)
287 continue; 291 continue;
288 292
289 if (t.IsAbstract) 293 if (t.IsAbstract)
290 continue; 294 continue;
291 295
292 ITarget target = (ITarget)assm.CreateInstance(t.FullName); 296 ITarget target = (ITarget)assm.CreateInstance(t.FullName);
293 if (target == null) 297 if (target == null)
294 { 298 {
295 throw new MissingMethodException("Could not create ITarget instance"); 299 throw new MissingMethodException("Could not create ITarget instance");
296 } 300 }
297 301
298 m_Targets[ta.Name] = target; 302 m_Targets[ta.Name] = target;
299 } 303 }
300 } 304 }
301 305
302 private void CacheNodeTypes(Assembly assm) 306 private void CacheNodeTypes(Assembly assm)
303 { 307 {
304 foreach(Type t in assm.GetTypes()) 308 foreach(Type t in assm.GetTypes())
305 { 309 {
306 foreach (DataNodeAttribute dna in t.GetCustomAttributes(typeof(DataNodeAttribute), true)) 310 foreach (DataNodeAttribute dna in t.GetCustomAttributes(typeof(DataNodeAttribute), true))
307 { 311 {
308 NodeEntry ne = new NodeEntry(); 312 NodeEntry ne = new NodeEntry();
@@ -310,11 +314,11 @@ namespace Prebuild.Core
310 ne.Attribute = dna; 314 ne.Attribute = dna;
311 m_Nodes[dna.Name] = ne; 315 m_Nodes[dna.Name] = ne;
312 } 316 }
313 } 317 }
314 } 318 }
315 319
316 private void LogBanner() 320 private void LogBanner()
317 { 321 {
318 m_Log.Write("Prebuild v" + Version); 322 m_Log.Write("Prebuild v" + Version);
319 m_Log.Write("Copyright (c) 2004-2010"); 323 m_Log.Write("Copyright (c) 2004-2010");
320 m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),"); 324 m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),");
@@ -323,10 +327,12 @@ namespace Prebuild.Core
323 m_Log.Write("Rob Loach (http://www.robloach.net),"); 327 m_Log.Write("Rob Loach (http://www.robloach.net),");
324 m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),"); 328 m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),");
325 m_Log.Write("John Hurliman (john.hurliman@intel.com),"); 329 m_Log.Write("John Hurliman (john.hurliman@intel.com),");
326 330 m_Log.Write("WhiteCore build 2015 (greythane@gmail.com),");
331 m_Log.Write("OpenSimulator build 2017 Ubit Umarov,");
332 m_Log.Write ("");
327 m_Log.Write("See 'prebuild /usage' for help"); 333 m_Log.Write("See 'prebuild /usage' for help");
328 m_Log.Write(); 334 m_Log.Write();
329 } 335 }
330 336
331 337
332 338
@@ -348,37 +354,37 @@ namespace Prebuild.Core
348 } 354 }
349 355
350 /// <summary> 356 /// <summary>
351 /// 357 ///
352 /// </summary> 358 /// </summary>
353 /// <param name="file"></param> 359 /// <param name="file"></param>
354 /// <param name="solutions"></param> 360 /// <param name="solutions"></param>
355 /// <returns></returns> 361 /// <returns></returns>
356 public void ProcessFile(string file, IList<SolutionNode> solutions) 362 public void ProcessFile(string file, IList<SolutionNode> solutions)
357 { 363 {
358 m_CurrentWorkingDirectory.Push(); 364 m_CurrentWorkingDirectory.Push();
359 365
360 string path = file; 366 string path = file;
361 try 367 try
362 { 368 {
363 try 369 try
364 { 370 {
365 path = Helper.ResolvePath(path); 371 path = Helper.ResolvePath(path);
366 } 372 }
367 catch(ArgumentException) 373 catch(ArgumentException)
368 { 374 {
369 m_Log.Write("Could not open Prebuild file: " + path); 375 m_Log.Write("Could not open Prebuild file: " + path);
370 m_CurrentWorkingDirectory.Pop(); 376 m_CurrentWorkingDirectory.Pop();
371 return; 377 return;
372 } 378 }
373 379
374 Helper.SetCurrentDir(Path.GetDirectoryName(path)); 380 Helper.SetCurrentDir(Path.GetDirectoryName(path));
375 381
376 XmlTextReader reader = new XmlTextReader(path); 382 XmlTextReader reader = new XmlTextReader(path);
377 383
378 Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor(); 384 Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor();
379 385
380 //register command line arguments as XML variables 386 //register command line arguments as XML variables
381 IEnumerator<KeyValuePair<string, string>> dict = m_CommandLine.GetEnumerator(); 387 IEnumerator<KeyValuePair<string, string>> dict = m_CommandLine.GetEnumerator();
382 while (dict.MoveNext()) 388 while (dict.MoveNext())
383 { 389 {
384 string name = dict.Current.Key.Trim(); 390 string name = dict.Current.Key.Trim();
@@ -386,447 +392,457 @@ namespace Prebuild.Core
386 pre.RegisterVariable(name, dict.Current.Value); 392 pre.RegisterVariable(name, dict.Current.Value);
387 } 393 }
388 394
389 string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML 395 string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML
390 396
391 // See if the user put into a pseudo target of "prebuild:preprocessed-input" to indicate they want to see the 397 // See if the user put into a pseudo target of "prebuild:preprocessed-input" to indicate they want to see the
392 // output before the system processes it. 398 // output before the system processes it.
393 if (m_CommandLine.WasPassed("ppi")) 399 if (m_CommandLine.WasPassed("ppi"))
394 { 400 {
395 // Get the filename if there is one, otherwise use a default. 401 // Get the filename if there is one, otherwise use a default.
396 string ppiFile = m_CommandLine["ppi"]; 402 string ppiFile = m_CommandLine["ppi"];
397 if (ppiFile == null || ppiFile.Trim().Length == 0) 403 if (ppiFile == null || ppiFile.Trim().Length == 0)
398 { 404 {
399 ppiFile = "preprocessed-input.xml"; 405 ppiFile = "preprocessed-input.xml";
400 } 406 }
401 407
402 // Write out the string to the given stream. 408 // Write out the string to the given stream.
403 try 409 try
404 { 410 {
405 using (StreamWriter ppiWriter = new StreamWriter(ppiFile)) 411 using (StreamWriter ppiWriter = new StreamWriter(ppiFile))
406 { 412 {
407 ppiWriter.WriteLine(xml); 413 ppiWriter.WriteLine(xml);
408 } 414 }
409 } 415 }
410 catch(IOException ex) 416 catch(IOException ex)
411 { 417 {
412 Console.WriteLine("Could not write PPI file '{0}': {1}", ppiFile, ex.Message); 418 Console.WriteLine("Could not write PPI file '{0}': {1}", ppiFile, ex.Message);
413 } 419 }
414 420
415 // Finish processing this special tag. 421 // Finish processing this special tag.
416 return; 422 return;
417 } 423 }
418 424
419 m_CurrentDoc = new XmlDocument(); 425 m_CurrentDoc = new XmlDocument();
420 try 426 try
421 { 427 {
422#if NO_VALIDATE 428#if NO_VALIDATE
423 XmlReader validator = XmlReader.Create(new StringReader(xml)); 429 XmlReader validator = XmlReader.Create(new StringReader(xml));
424 m_CurrentDoc.Load(validator); 430 m_CurrentDoc.Load(validator);
425#else 431#else
426 XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml))); 432 XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml)));
427 433
428 //validate while reading from string into XmlDocument DOM structure in memory 434 //validate while reading from string into XmlDocument DOM structure in memory
429 foreach(XmlSchema schema in m_Schemas) 435 foreach(XmlSchema schema in m_Schemas)
430 { 436 {
431 validator.Schemas.Add(schema); 437 validator.Schemas.Add(schema);
432 } 438 }
433 m_CurrentDoc.Load(validator); 439 m_CurrentDoc.Load(validator);
434#endif 440#endif
435 } 441 }
436 catch(XmlException e) 442 catch(XmlException e)
437 { 443 {
438 throw new XmlException(e.ToString()); 444 throw new XmlException(e.ToString());
439 } 445 }
440 446
441 //is there a purpose to writing it? An syntax/schema problem would have been found during pre.Process() and reported with details 447 //is there a purpose to writing it? An syntax/schema problem would have been found during pre.Process() and reported with details
442 if(m_CommandLine.WasPassed("ppo")) 448 if(m_CommandLine.WasPassed("ppo"))
443 { 449 {
444 string ppoFile = m_CommandLine["ppo"]; 450 string ppoFile = m_CommandLine["ppo"];
445 if(ppoFile == null || ppoFile.Trim().Length < 1) 451 if(ppoFile == null || ppoFile.Trim().Length < 1)
446 { 452 {
447 ppoFile = "preprocessed.xml"; 453 ppoFile = "preprocessed.xml";
448 } 454 }
449 455
450 StreamWriter writer = null; 456 StreamWriter writer = null;
451 try 457 try
452 { 458 {
453 writer = new StreamWriter(ppoFile); 459 writer = new StreamWriter(ppoFile);
454 writer.Write(xml); 460 writer.Write(xml);
455 } 461 }
456 catch(IOException ex) 462 catch(IOException ex)
457 { 463 {
458 Console.WriteLine("Could not write PPO file '{0}': {1}", ppoFile, ex.Message); 464 Console.WriteLine("Could not write PPO file '{0}': {1}", ppoFile, ex.Message);
459 } 465 }
460 finally 466 finally
461 { 467 {
462 if(writer != null) 468 if(writer != null)
463 { 469 {
464 writer.Close(); 470 writer.Close();
465 } 471 }
466 } 472 }
467 return; 473 return;
468 } 474 }
469 //start reading the xml config file 475 //start reading the xml config file
470 XmlElement rootNode = m_CurrentDoc.DocumentElement; 476 XmlElement rootNode = m_CurrentDoc.DocumentElement;
471 //string suggestedVersion = Helper.AttributeValue(rootNode,"version","1.0"); 477 //string suggestedVersion = Helper.AttributeValue(rootNode,"version","1.0");
472 Helper.CheckForOSVariables = Helper.ParseBoolean(rootNode,"checkOsVars",false); 478 Helper.CheckForOSVariables = Helper.ParseBoolean(rootNode,"checkOsVars",false);
473 479
474 foreach(XmlNode node in rootNode.ChildNodes)//solutions or if pre-proc instructions 480 foreach(XmlNode node in rootNode.ChildNodes)//solutions or if pre-proc instructions
475 { 481 {
476 IDataNode dataNode = ParseNode(node, null); 482 IDataNode dataNode = ParseNode(node, null);
477 if(dataNode is ProcessNode) 483 if(dataNode is ProcessNode)
478 { 484 {
479 ProcessNode proc = (ProcessNode)dataNode; 485 ProcessNode proc = (ProcessNode)dataNode;
480 if(proc.IsValid) 486 if(proc.IsValid)
481 { 487 {
482 ProcessFile(proc.Path); 488 ProcessFile(proc.Path);
483 } 489 }
484 } 490 }
485 else if(dataNode is SolutionNode) 491 else if(dataNode is SolutionNode)
486 { 492 {
487 solutions.Add((SolutionNode)dataNode); 493 solutions.Add((SolutionNode)dataNode);
488 } 494 }
489 } 495 }
490 } 496 }
491 catch(XmlSchemaException xse) 497 catch(XmlSchemaException xse)
492 { 498 {
493 m_Log.Write("XML validation error at line {0} in {1}:\n\n{2}", 499 m_Log.Write("XML validation error at line {0} in {1}:\n\n{2}",
494 xse.LineNumber, path, xse.Message); 500 xse.LineNumber, path, xse.Message);
495 } 501 }
496 finally 502 finally
497 { 503 {
498 m_CurrentWorkingDirectory.Pop(); 504 m_CurrentWorkingDirectory.Pop();
499 } 505 }
500 } 506 }
501 507
502 #endregion 508 #endregion
503 509
504 #region Public Methods 510 #region Public Methods
505 511
506 /// <summary> 512 /// <summary>
507 /// Allows the project. 513 /// Allows the project.
508 /// </summary> 514 /// </summary>
509 /// <param name="projectGroupsFlags">The project groups flags.</param> 515 /// <param name="projectGroupsFlags">The project groups flags.</param>
510 /// <returns></returns> 516 /// <returns></returns>
511 public bool AllowProject(string projectGroupsFlags) 517 public bool AllowProject(string projectGroupsFlags)
512 { 518 {
513 if(m_ProjectGroups != null && m_ProjectGroups.Length > 0) 519 if(m_ProjectGroups != null && m_ProjectGroups.Length > 0)
514 { 520 {
515 if(projectGroupsFlags != null && projectGroupsFlags.Length == 0) 521 if(projectGroupsFlags != null && projectGroupsFlags.Length == 0)
522 {
523 foreach(string group in projectGroupsFlags.Split('|'))
524 {
525 if(Array.IndexOf(m_ProjectGroups, group) != -1) //if included in the filter list
526 {
527 return true;
528 }
529 }
530 }
531 return false;//not included in the list or no groups specified for the project
532 }
533 return true;//no filter specified in the command line args
534 }
535
536 /// <summary>
537 /// Gets the type of the node.
538 /// </summary>
539 /// <param name="node">The node.</param>
540 /// <returns></returns>
541 public Type GetNodeType(XmlNode node)
542 {
543 if( node == null )
544 {
545 throw new ArgumentNullException("node");
546 }
547 if(!m_Nodes.ContainsKey(node.Name))
548 {
549 return null;
550 }
551
552 NodeEntry ne = m_Nodes[node.Name];
553 return ne.Type;
554 }
555
556 /// <summary>
557 ///
558 /// </summary>
559 /// <param name="node"></param>
560 /// <param name="parent"></param>
561 /// <returns></returns>
562 public IDataNode ParseNode(XmlNode node, IDataNode parent)
563 {
564 return ParseNode(node, parent, null);
565 }
566
567 //Create an instance of the data node type that is mapped to the name of the xml DOM node
568 /// <summary>
569 /// Parses the node.
570 /// </summary>
571 /// <param name="node">The node.</param>
572 /// <param name="parent">The parent.</param>
573 /// <param name="preNode">The pre node.</param>
574 /// <returns></returns>
575 public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode)
576 {
577 IDataNode dataNode;
578
579 try
580 {
581 if( node == null )
582 {
583 throw new ArgumentNullException("node");
584 }
585 if(preNode == null)
586 {
587 if(!m_Nodes.ContainsKey(node.Name))
588 {
589 Console.WriteLine("WARNING: Unknown XML node: " + node.Name);
590 return null;
591 }
592
593 NodeEntry ne = m_Nodes[node.Name];
594 Type type = ne.Type;
595 //DataNodeAttribute dna = ne.Attribute;
596
597 dataNode = (IDataNode)type.Assembly.CreateInstance(type.FullName);
598 if(dataNode == null)
599 {
600 throw new System.Reflection.TargetException("Could not create new parser instance: " + type.FullName);
601 }
602 }
603 else
604 dataNode = preNode;
605
606 dataNode.Parent = parent;
607 if (cmdlineTargetFramework && dataNode is ProjectNode)
516 { 608 {
517 foreach(string group in projectGroupsFlags.Split('|')) 609 ((ProjectNode)dataNode).FrameworkVersion = m_TargetFramework;
518 {
519 if(Array.IndexOf(m_ProjectGroups, group) != -1) //if included in the filter list
520 {
521 return true;
522 }
523 }
524 } 610 }
525 return false;//not included in the list or no groups specified for the project 611 dataNode.Parse(node);
526 } 612 }
527 return true;//no filter specified in the command line args 613 catch(WarningException wex)
528 } 614 {
529 615 m_Log.Write(LogType.Warning, wex.Message);
530 /// <summary> 616 return null;
531 /// Gets the type of the node. 617 }
532 /// </summary> 618 catch(FatalException fex)
533 /// <param name="node">The node.</param> 619 {
534 /// <returns></returns> 620 m_Log.WriteException(LogType.Error, fex);
535 public Type GetNodeType(XmlNode node) 621 throw;
536 { 622 }
537 if( node == null ) 623 catch(Exception ex)
538 { 624 {
539 throw new ArgumentNullException("node"); 625 m_Log.WriteException(LogType.Error, ex);
540 } 626 throw;
541 if(!m_Nodes.ContainsKey(node.Name)) 627 }
542 { 628
543 return null; 629 return dataNode;
544 } 630 }
545 631
546 NodeEntry ne = m_Nodes[node.Name]; 632 /// <summary>
547 return ne.Type; 633 /// Initializes the specified target.
548 } 634 /// </summary>
549 635 /// <param name="target">The target.</param>
550 /// <summary> 636 /// <param name="args">The args.</param>
551 /// 637 public void Initialize(LogTargets target, string[] args)
552 /// </summary> 638 {
553 /// <param name="node"></param> 639 CacheTargets(GetType().Assembly);
554 /// <param name="parent"></param> 640 CacheNodeTypes(GetType().Assembly);
555 /// <returns></returns> 641 CacheVersion();
556 public IDataNode ParseNode(XmlNode node, IDataNode parent) 642
557 { 643 m_CommandLine = new CommandLineCollection(args);
558 return ParseNode(node, parent, null); 644
559 } 645 string logFile = null;
560 646 if(m_CommandLine.WasPassed("log"))
561 //Create an instance of the data node type that is mapped to the name of the xml DOM node 647 {
562 /// <summary> 648 logFile = m_CommandLine["log"];
563 /// Parses the node. 649
564 /// </summary> 650 if(logFile != null && logFile.Length == 0)
565 /// <param name="node">The node.</param> 651 {
566 /// <param name="parent">The parent.</param> 652 logFile = "Prebuild.log";
567 /// <param name="preNode">The pre node.</param> 653 }
568 /// <returns></returns> 654 }
569 public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode) 655 else
570 { 656 {
571 IDataNode dataNode; 657 target = target & ~LogTargets.File; //dont output to a file
572 658 }
573 try 659
574 { 660 m_Log = new Log(target, logFile);
575 if( node == null ) 661 LogBanner();
576 { 662
577 throw new ArgumentNullException("node"); 663 m_CurrentWorkingDirectory = new CurrentDirectory();
578 }
579 if(preNode == null)
580 {
581 if(!m_Nodes.ContainsKey(node.Name))
582 {
583 Console.WriteLine("WARNING: Unknown XML node: " + node.Name);
584 return null;
585 }
586
587 NodeEntry ne = m_Nodes[node.Name];
588 Type type = ne.Type;
589 //DataNodeAttribute dna = ne.Attribute;
590
591 dataNode = (IDataNode)type.Assembly.CreateInstance(type.FullName);
592 if(dataNode == null)
593 {
594 throw new System.Reflection.TargetException("Could not create new parser instance: " + type.FullName);
595 }
596 }
597 else
598 dataNode = preNode;
599
600 dataNode.Parent = parent;
601 dataNode.Parse(node);
602 }
603 catch(WarningException wex)
604 {
605 m_Log.Write(LogType.Warning, wex.Message);
606 return null;
607 }
608 catch(FatalException fex)
609 {
610 m_Log.WriteException(LogType.Error, fex);
611 throw;
612 }
613 catch(Exception ex)
614 {
615 m_Log.WriteException(LogType.Error, ex);
616 throw;
617 }
618
619 return dataNode;
620 }
621
622 /// <summary>
623 /// Initializes the specified target.
624 /// </summary>
625 /// <param name="target">The target.</param>
626 /// <param name="args">The args.</param>
627 public void Initialize(LogTargets target, string[] args)
628 {
629 CacheTargets(GetType().Assembly);
630 CacheNodeTypes(GetType().Assembly);
631 CacheVersion();
632
633 m_CommandLine = new CommandLineCollection(args);
634
635 string logFile = null;
636 if(m_CommandLine.WasPassed("log"))
637 {
638 logFile = m_CommandLine["log"];
639
640 if(logFile != null && logFile.Length == 0)
641 {
642 logFile = "Prebuild.log";
643 }
644 }
645 else
646 {
647 target = target & ~LogTargets.File; //dont output to a file
648 }
649
650 m_Log = new Log(target, logFile);
651 LogBanner();
652
653 m_CurrentWorkingDirectory = new CurrentDirectory();
654 664
655 m_Target = m_CommandLine["target"]; 665 m_Target = m_CommandLine["target"];
656 m_Clean = m_CommandLine["clean"]; 666 m_Conditionals = m_CommandLine["conditionals"];
657 string removeDirs = m_CommandLine["removedir"]; 667 if(m_CommandLine["targetframework"] != null)
658 if(removeDirs != null && removeDirs.Length == 0) 668 {
659 { 669 m_TargetFramework = (FrameworkVersion)Enum.Parse (typeof (FrameworkVersion), m_CommandLine["targetframework"]);
660 m_RemoveDirectories = removeDirs.Split('|'); 670 cmdlineTargetFramework = true;
661 } 671 }
662 672 m_Clean = m_CommandLine["clean"];
663 string flags = m_CommandLine["allowedgroups"];//allows filtering by specifying a pipe-delimited list of groups to include 673 string removeDirs = m_CommandLine["removedir"];
664 if(flags != null && flags.Length == 0) 674 if(removeDirs != null && removeDirs.Length == 0)
665 { 675 {
666 m_ProjectGroups = flags.Split('|'); 676 m_RemoveDirectories = removeDirs.Split('|');
667 } 677 }
668 m_PauseAfterFinish = m_CommandLine.WasPassed("pause"); 678
669 679 string flags = m_CommandLine["allowedgroups"];//allows filtering by specifying a pipe-delimited list of groups to include
670 LoadSchema(); 680 if(flags != null && flags.Length == 0)
671 } 681 {
672 682 m_ProjectGroups = flags.Split('|');
673 /// <summary> 683 }
674 /// Processes this instance. 684 m_PauseAfterFinish = m_CommandLine.WasPassed("pause");
675 /// </summary> 685
676 public void Process() 686 LoadSchema();
677 { 687 }
678 bool perfomedOtherTask = false; 688
679 if(m_RemoveDirectories != null && m_RemoveDirectories.Length > 0) 689 /// <summary>
680 { 690 /// Processes this instance.
681 try 691 /// </summary>
682 { 692 public void Process()
683 RemoveDirectories(".",m_RemoveDirectories); 693 {
684 } 694 bool perfomedOtherTask = false;
685 catch(IOException e) 695 if(m_RemoveDirectories != null && m_RemoveDirectories.Length > 0)
686 { 696 {
687 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); 697 try
688 m_Log.WriteException(LogType.Error,e); 698 {
689 } 699 RemoveDirectories(".",m_RemoveDirectories);
690 catch(UnauthorizedAccessException e) 700 }
691 { 701 catch(IOException e)
692 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories); 702 {
693 m_Log.WriteException(LogType.Error,e); 703 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories);
694 } 704 m_Log.WriteException(LogType.Error,e);
695 perfomedOtherTask = true; 705 }
696 } 706 catch(UnauthorizedAccessException e)
697 707 {
698 if(m_Target != null && m_Clean != null) 708 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories);
699 { 709 m_Log.WriteException(LogType.Error,e);
700 m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together"); 710 }
701 return; 711 perfomedOtherTask = true;
702 } 712 }
703 713
714 if(m_Target != null && m_Clean != null)
715 {
716 m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together");
717 return;
718 }
719
704 if(m_Target == null && m_Clean == null) 720 if(m_Target == null && m_Clean == null)
705 { 721 {
706 if(perfomedOtherTask) //finished 722 if(perfomedOtherTask) //finished
707 { 723 {
708 return; 724 return;
709 } 725 }
710 m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file"); 726 m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file");
711 return; 727 return;
712 } 728 }
713 729
714 string file = "./prebuild.xml"; 730 string file = "./prebuild.xml";
715 if(m_CommandLine.WasPassed("file")) 731 if(m_CommandLine.WasPassed("file"))
716 { 732 {
717 file = m_CommandLine["file"]; 733 file = m_CommandLine["file"];
718 } 734 }
719 735
720 ProcessFile(file); 736 ProcessFile(file);
721 737
722 string target = (m_Target != null ? m_Target.ToLower() : m_Clean.ToLower()); 738 string target = (m_Target != null ? m_Target.ToLower() : m_Clean.ToLower());
723 bool clean = (m_Target == null); 739 bool clean = (m_Target == null);
724 if(clean && target != null && target.Length == 0) 740 if(clean && target != null && target.Length == 0)
725 { 741 {
726 target = "all"; 742 target = "all";
727 } 743 }
728 if(clean && target == "all")//default to all if no target was specified for clean 744 if(clean && target == "all")//default to all if no target was specified for clean
729 { 745 {
730 //check if they passed yes 746 //check if they passed yes
731 if (!m_CommandLine.WasPassed("yes")) 747 if (!m_CommandLine.WasPassed("yes"))
732 { 748 {
733 Console.WriteLine("WARNING: This operation will clean ALL project files for all targets, are you sure? (y/n):"); 749 Console.WriteLine("WARNING: This operation will clean ALL project files for all targets, are you sure? (y/n):");
734 string ret = Console.ReadLine(); 750 string ret = Console.ReadLine();
735 if(ret == null) 751 if(ret == null)
736 { 752 {
737 return; 753 return;
754 }
755 ret = ret.Trim().ToLower();
756 if((ret.ToLower() != "y" && ret.ToLower() != "yes"))
757 {
758 return;
738 } 759 }
739 ret = ret.Trim().ToLower();
740 if((ret.ToLower() != "y" && ret.ToLower() != "yes"))
741 {
742 return;
743 }
744 }
745 //clean all targets (just cleaning vs2002 target didn't clean nant)
746 foreach(ITarget targ in m_Targets.Values)
747 {
748 targ.Clean(this);
749 } 760 }
750 } 761 //clean all targets (just cleaning vs2002 target didn't clean nant)
751 else 762 foreach(ITarget targ in m_Targets.Values)
752 { 763 {
753 if (!m_Targets.ContainsKey(target)) { 764 targ.Clean(this);
754 m_Log.Write(LogType.Error, "Unknown Target \"{0}\"", target); 765 }
755 return; 766 }
756 } 767 else
757 ITarget targ = m_Targets[target]; 768 {
758 769 if (!m_Targets.ContainsKey(target)) {
759 if(clean) 770 m_Log.Write(LogType.Error, "Unknown Target \"{0}\"", target);
760 { 771 return;
761 targ.Clean(this); 772 }
762 } 773 ITarget targ = m_Targets[target];
763 else 774
764 { 775 if(clean)
765 targ.Write(this); 776 {
766 } 777 targ.Clean(this);
767 } 778 }
768 779 else
769 m_Log.Flush(); 780 {
770 } 781 targ.Write(this);
771 782 }
772 #endregion 783 }
773 784
774 #region IDisposable Members 785 m_Log.Flush();
775 786 }
776 /// <summary> 787
777 /// 788 #endregion
778 /// </summary> 789
779 public void Dispose() 790 #region IDisposable Members
780 { 791
781 Dispose(true); 792 /// <summary>
782 GC.SuppressFinalize(this); 793 ///
783 } 794 /// </summary>
784 795 public void Dispose()
785 /// <summary> 796 {
786 /// Dispose objects 797 Dispose(true);
787 /// </summary> 798 GC.SuppressFinalize(this);
788 /// <param name="disposing"> 799 }
789 /// If true, it will dispose close the handle 800
790 /// </param> 801 /// <summary>
791 /// <remarks> 802 /// Dispose objects
792 /// Will dispose managed and unmanaged resources. 803 /// </summary>
793 /// </remarks> 804 /// <param name="disposing">
794 protected virtual void Dispose(bool disposing) 805 /// If true, it will dispose close the handle
795 { 806 /// </param>
796 if (!disposed) 807 /// <remarks>
797 { 808 /// Will dispose managed and unmanaged resources.
798 if (disposing) 809 /// </remarks>
799 { 810 protected virtual void Dispose(bool disposing)
811 {
812 if (!disposed)
813 {
814 if (disposing)
815 {
800 GC.SuppressFinalize(this); 816 GC.SuppressFinalize(this);
801 if (m_Log != null) 817 if (m_Log != null)
802 { 818 {
803 m_Log.Close(); 819 m_Log.Close();
804 m_Log = null; 820 m_Log = null;
805 } 821 }
806 } 822 }
807 } 823 }
808 disposed = true; 824 disposed = true;
809 } 825 }
810 826
811 /// <summary> 827 /// <summary>
812 /// 828 ///
813 /// </summary> 829 /// </summary>
814 ~Kernel() 830 ~Kernel()
815 { 831 {
816 Dispose(false); 832 Dispose(false);
817 } 833 }
818 834
819 /// <summary> 835 /// <summary>
820 /// Closes and destroys this object 836 /// Closes and destroys this object
821 /// </summary> 837 /// </summary>
822 /// <remarks> 838 /// <remarks>
823 /// Same as Dispose(true) 839 /// Same as Dispose(true)
824 /// </remarks> 840 /// </remarks>
825 public void Close() 841 public void Close()
826 { 842 {
827 Dispose(); 843 Dispose();
828 } 844 }
829 845
830 #endregion 846 #endregion
831 } 847 }
832} 848}
diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs
index e4b024f..4c415bb 100644
--- a/Prebuild/src/Core/Nodes/AuthorNode.cs
+++ b/Prebuild/src/Core/Nodes/AuthorNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("Author")] 38 [DataNode("Author")]
39 public class AuthorNode : DataNode 39 public class AuthorNode : DataNode
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Signature; 43 private string m_Signature;
44 44
45 #endregion 45 #endregion
46 46
47 #region Properties 47 #region Properties
48 48
49 /// <summary> 49 /// <summary>
50 /// Gets the signature. 50 /// Gets the signature.
51 /// </summary> 51 /// </summary>
52 /// <value>The signature.</value> 52 /// <value>The signature.</value>
53 public string Signature 53 public string Signature
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_Signature; 57 return m_Signature;
58 } 58 }
59 } 59 }
60 60
61 #endregion 61 #endregion
62 62
63 #region Public Methods 63 #region Public Methods
64 64
65 /// <summary> 65 /// <summary>
66 /// Parses the specified node. 66 /// Parses the specified node.
67 /// </summary> 67 /// </summary>
68 /// <param name="node">The node.</param> 68 /// <param name="node">The node.</param>
69 public override void Parse(XmlNode node) 69 public override void Parse(XmlNode node)
70 { 70 {
71 if( node == null ) 71 if( node == null )
72 { 72 {
73 throw new ArgumentNullException("node"); 73 throw new ArgumentNullException("node");
74 } 74 }
75 75
76 m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText); 76 m_Signature = Helper.InterpolateForEnvironmentVariables(node.InnerText);
77 if(m_Signature == null) 77 if(m_Signature == null)
78 { 78 {
79 m_Signature = ""; 79 m_Signature = "";
80 } 80 }
81 81
82 m_Signature = m_Signature.Trim(); 82 m_Signature = m_Signature.Trim();
83 } 83 }
84 84
85 #endregion 85 #endregion
86 } 86 }
87} 87}
diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs
index bd564d5..71405f9 100644
--- a/Prebuild/src/Core/Nodes/CleanFilesNode.cs
+++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs
index f334ea3..b8131b0 100644
--- a/Prebuild/src/Core/Nodes/CleanupNode.cs
+++ b/Prebuild/src/Core/Nodes/CleanupNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -35,40 +35,40 @@ namespace Prebuild.Core.Nodes
35 [DataNode("Cleanup")] 35 [DataNode("Cleanup")]
36 public class CleanupNode : DataNode 36 public class CleanupNode : DataNode
37 { 37 {
38 #region Fields 38 #region Fields
39 39
40 private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>(); 40 private List<CleanFilesNode> m_CleanFiles = new List<CleanFilesNode>();
41 41
42 #endregion 42 #endregion
43 43
44 #region Properties 44 #region Properties
45 45
46 /// <summary> 46 /// <summary>
47 /// Gets the signature. 47 /// Gets the signature.
48 /// </summary> 48 /// </summary>
49 /// <value>The signature.</value> 49 /// <value>The signature.</value>
50 public List<CleanFilesNode> CleanFiles 50 public List<CleanFilesNode> CleanFiles
51 { 51 {
52 get 52 get
53 { 53 {
54 return m_CleanFiles; 54 return m_CleanFiles;
55 } 55 }
56 } 56 }
57 57
58 #endregion 58 #endregion
59 59
60 #region Public Methods 60 #region Public Methods
61 61
62 /// <summary> 62 /// <summary>
63 /// Parses the specified node. 63 /// Parses the specified node.
64 /// </summary> 64 /// </summary>
65 /// <param name="node">The node.</param> 65 /// <param name="node">The node.</param>
66 public override void Parse(XmlNode node) 66 public override void Parse(XmlNode node)
67 { 67 {
68 if( node == null ) 68 if( node == null )
69 { 69 {
70 throw new ArgumentNullException("node"); 70 throw new ArgumentNullException("node");
71 } 71 }
72 72
73 foreach (XmlNode child in node.ChildNodes) 73 foreach (XmlNode child in node.ChildNodes)
74 { 74 {
@@ -78,8 +78,8 @@ namespace Prebuild.Core.Nodes
78 m_CleanFiles.Add((CleanFilesNode)dataNode); 78 m_CleanFiles.Add((CleanFilesNode)dataNode);
79 } 79 }
80 } 80 }
81 } 81 }
82 82
83 #endregion 83 #endregion
84 } 84 }
85} \ No newline at end of file 85} \ No newline at end of file
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
index a101799..cd2f740 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,185 +32,185 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("Configuration")] 38 [DataNode("Configuration")]
39 public class ConfigurationNode : DataNode, ICloneable, IComparable 39 public class ConfigurationNode : DataNode, ICloneable, IComparable
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Name = "unknown"; 43 private string m_Name = "unknown";
44 private string m_Platform = "AnyCPU"; 44 private string m_Platform = "AnyCPU";
45 private OptionsNode m_Options; 45 private OptionsNode m_Options;
46 46
47 #endregion 47 #endregion
48 48
49 #region Constructors 49 #region Constructors
50 50
51 /// <summary> 51 /// <summary>
52 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class. 52 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class.
53 /// </summary> 53 /// </summary>
54 public ConfigurationNode() 54 public ConfigurationNode()
55 { 55 {
56 m_Options = new OptionsNode(); 56 m_Options = new OptionsNode();
57 } 57 }
58 58
59 #endregion 59 #endregion
60 60
61 #region Properties 61 #region Properties
62 62
63 /// <summary> 63 /// <summary>
64 /// Gets or sets the parent. 64 /// Gets or sets the parent.
65 /// </summary> 65 /// </summary>
66 /// <value>The parent.</value> 66 /// <value>The parent.</value>
67 public override IDataNode Parent 67 public override IDataNode Parent
68 { 68 {
69 get 69 get
70 { 70 {
71 return base.Parent; 71 return base.Parent;
72 } 72 }
73 set 73 set
74 { 74 {
75 base.Parent = value; 75 base.Parent = value;
76 if(base.Parent is SolutionNode) 76 if(base.Parent is SolutionNode)
77 { 77 {
78 SolutionNode node = (SolutionNode)base.Parent; 78 SolutionNode node = (SolutionNode)base.Parent;
79 if(node != null && node.Options != null) 79 if(node != null && node.Options != null)
80 { 80 {
81 node.Options.CopyTo(m_Options); 81 node.Options.CopyTo(m_Options);
82 } 82 }
83 } 83 }
84 } 84 }
85 } 85 }
86 86
87 /// <summary> 87 /// <summary>
88 /// Identifies the platform for this specific configuration. 88 /// Identifies the platform for this specific configuration.
89 /// </summary> 89 /// </summary>
90 public string Platform 90 public string Platform
91 { 91 {
92 get 92 get
93 { 93 {
94 return m_Platform; 94 return m_Platform;
95 } 95 }
96 set 96 set
97 { 97 {
98 switch ((value + "").ToLower()) 98 switch ((value + "").ToLower())
99 { 99 {
100 case "x86": 100 case "x86":
101 case "x64": 101 case "x64":
102 m_Platform = value; 102 m_Platform = value;
103 break; 103 break;
104 case "itanium": 104 case "itanium":
105 m_Platform = "Itanium"; 105 m_Platform = "Itanium";
106 break; 106 break;
107 default: 107 default:
108 m_Platform = "AnyCPU"; 108 m_Platform = "AnyCPU";
109 break; 109 break;
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// Gets the name. 115 /// Gets the name.
116 /// </summary> 116 /// </summary>
117 /// <value>The name.</value> 117 /// <value>The name.</value>
118 public string Name 118 public string Name
119 { 119 {
120 get 120 get
121 { 121 {
122 return m_Name; 122 return m_Name;
123 } 123 }
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// Gets the name and platform for the configuration. 127 /// Gets the name and platform for the configuration.
128 /// </summary> 128 /// </summary>
129 /// <value>The name and platform.</value> 129 /// <value>The name and platform.</value>
130 public string NameAndPlatform 130 public string NameAndPlatform
131 { 131 {
132 get 132 get
133 { 133 {
134 string platform = m_Platform; 134 string platform = m_Platform;
135 if (platform == "AnyCPU") 135 if (platform == "AnyCPU")
136 platform = "Any CPU"; 136 platform = "Any CPU";
137 137
138 return String.Format("{0}|{1}", m_Name, platform); 138 return String.Format("{0}|{1}", m_Name, platform);
139 } 139 }
140 } 140 }
141 141
142 /// <summary> 142 /// <summary>
143 /// Gets or sets the options. 143 /// Gets or sets the options.
144 /// </summary> 144 /// </summary>
145 /// <value>The options.</value> 145 /// <value>The options.</value>
146 public OptionsNode Options 146 public OptionsNode Options
147 { 147 {
148 get 148 get
149 { 149 {
150 return m_Options; 150 return m_Options;
151 } 151 }
152 set 152 set
153 { 153 {
154 m_Options = value; 154 m_Options = value;
155 } 155 }
156 } 156 }
157 157
158 #endregion 158 #endregion
159 159
160 #region Public Methods 160 #region Public Methods
161 161
162 /// <summary> 162 /// <summary>
163 /// Parses the specified node. 163 /// Parses the specified node.
164 /// </summary> 164 /// </summary>
165 /// <param name="node">The node.</param> 165 /// <param name="node">The node.</param>
166 public override void Parse(XmlNode node) 166 public override void Parse(XmlNode node)
167 { 167 {
168 m_Name = Helper.AttributeValue(node, "name", m_Name); 168 m_Name = Helper.AttributeValue(node, "name", m_Name);
169 Platform = Helper.AttributeValue(node, "platform", m_Platform); 169 Platform = Helper.AttributeValue(node, "platform", m_Platform);
170 170
171 if (node == null) 171 if (node == null)
172 { 172 {
173 throw new ArgumentNullException("node"); 173 throw new ArgumentNullException("node");
174 } 174 }
175 foreach(XmlNode child in node.ChildNodes) 175 foreach(XmlNode child in node.ChildNodes)
176 { 176 {
177 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 177 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
178 if(dataNode is OptionsNode) 178 if(dataNode is OptionsNode)
179 { 179 {
180 ((OptionsNode)dataNode).CopyTo(m_Options); 180 ((OptionsNode)dataNode).CopyTo(m_Options);
181 } 181 }
182 } 182 }
183 } 183 }
184 184
185 /// <summary> 185 /// <summary>
186 /// Copies to. 186 /// Copies to.
187 /// </summary> 187 /// </summary>
188 /// <param name="conf">The conf.</param> 188 /// <param name="conf">The conf.</param>
189 public void CopyTo(ConfigurationNode conf) 189 public void CopyTo(ConfigurationNode conf)
190 { 190 {
191 m_Options.CopyTo(conf.m_Options); 191 m_Options.CopyTo(conf.m_Options);
192 } 192 }
193 193
194 #endregion 194 #endregion
195 195
196 #region ICloneable Members 196 #region ICloneable Members
197 197
198 /// <summary> 198 /// <summary>
199 /// Creates a new object that is a copy of the current instance. 199 /// Creates a new object that is a copy of the current instance.
200 /// </summary> 200 /// </summary>
201 /// <returns> 201 /// <returns>
202 /// A new object that is a copy of this instance. 202 /// A new object that is a copy of this instance.
203 /// </returns> 203 /// </returns>
204 public object Clone() 204 public object Clone()
205 { 205 {
206 ConfigurationNode ret = new ConfigurationNode(); 206 ConfigurationNode ret = new ConfigurationNode();
207 ret.m_Name = m_Name; 207 ret.m_Name = m_Name;
208 ret.m_Platform = m_Platform; 208 ret.m_Platform = m_Platform;
209 m_Options.CopyTo(ret.m_Options); 209 m_Options.CopyTo(ret.m_Options);
210 return ret; 210 return ret;
211 } 211 }
212 212
213 #endregion 213 #endregion
214 214
215 #region IComparable Members 215 #region IComparable Members
216 216
@@ -221,5 +221,5 @@ namespace Prebuild.Core.Nodes
221 } 221 }
222 222
223 #endregion 223 #endregion
224 } 224 }
225} 225}
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
index eba6550..1c38d9e 100644
--- a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
+++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -27,45 +27,45 @@ using System.Collections.Generic;
27 27
28namespace Prebuild.Core.Nodes 28namespace Prebuild.Core.Nodes
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// Implements a specialized list of configuration nodes which allows for lookup via 31 /// Implements a specialized list of configuration nodes which allows for lookup via
32 /// configuration name and platform. 32 /// configuration name and platform.
33 /// </summary> 33 /// </summary>
34 public class ConfigurationNodeCollection : List<ConfigurationNode> 34 public class ConfigurationNodeCollection : List<ConfigurationNode>
35 { 35 {
36 #region Properties 36 #region Properties
37 37
38 public ConfigurationNode this[string nameAndPlatform] 38 public ConfigurationNode this[string nameAndPlatform]
39 { 39 {
40 get 40 get
41 { 41 {
42 foreach (ConfigurationNode configurationNode in this) 42 foreach (ConfigurationNode configurationNode in this)
43 { 43 {
44 if (configurationNode.NameAndPlatform == nameAndPlatform) 44 if (configurationNode.NameAndPlatform == nameAndPlatform)
45 { 45 {
46 return configurationNode; 46 return configurationNode;
47 } 47 }
48 } 48 }
49 49
50 return null; 50 return null;
51 } 51 }
52 52
53 set 53 set
54 { 54 {
55 // See if the node 55 // See if the node
56 ConfigurationNode configurationNode = this[nameAndPlatform]; 56 ConfigurationNode configurationNode = this[nameAndPlatform];
57 57
58 if (configurationNode != null) 58 if (configurationNode != null)
59 { 59 {
60 this[IndexOf(configurationNode)] = value; 60 this[IndexOf(configurationNode)] = value;
61 } 61 }
62 else 62 else
63 { 63 {
64 Add(value); 64 Add(value);
65 } 65 }
66 } 66 }
67 } 67 }
68 68
69 #endregion 69 #endregion
70 } 70 }
71} 71}
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs
index 4f20588..318b13c 100644
--- a/Prebuild/src/Core/Nodes/DataNode.cs
+++ b/Prebuild/src/Core/Nodes/DataNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,86 +32,86 @@ using System.IO;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 public abstract class DataNode : IDataNode 38 public abstract class DataNode : IDataNode
39 { 39 {
40 #region Fields 40 #region Fields
41 41
42 private IDataNode parent; 42 private IDataNode parent;
43 string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; 43 string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" };
44 44
45 #endregion 45 #endregion
46 46
47 #region IDataNode Members 47 #region IDataNode Members
48 48
49 /// <summary> 49 /// <summary>
50 /// Gets or sets the parent. 50 /// Gets or sets the parent.
51 /// </summary> 51 /// </summary>
52 /// <value>The parent.</value> 52 /// <value>The parent.</value>
53 public virtual IDataNode Parent 53 public virtual IDataNode Parent
54 { 54 {
55 get 55 get
56 { 56 {
57 return parent; 57 return parent;
58 } 58 }
59 set 59 set
60 { 60 {
61 parent = value; 61 parent = value;
62 } 62 }
63 } 63 }
64 public string[] WebTypes 64 public string[] WebTypes
65 { 65 {
66 get { return m_WebTypes; } 66 get { return m_WebTypes; }
67 } 67 }
68 /// <summary> 68 /// <summary>
69 /// Parses the specified node. 69 /// Parses the specified node.
70 /// </summary> 70 /// </summary>
71 /// <param name="node">The node.</param> 71 /// <param name="node">The node.</param>
72 public virtual void Parse(XmlNode node) 72 public virtual void Parse(XmlNode node)
73 { 73 {
74 } 74 }
75 public BuildAction GetBuildActionByFileName(string fileName) 75 public BuildAction GetBuildActionByFileName(string fileName)
76 { 76 {
77 string extension = Path.GetExtension(fileName).ToLower(); 77 string extension = Path.GetExtension(fileName).ToLower();
78 foreach (string type in WebTypes) 78 foreach (string type in WebTypes)
79 { 79 {
80 if (extension == type) 80 if (extension == type)
81 return BuildAction.Content; 81 return BuildAction.Content;
82 } 82 }
83 return BuildAction.Compile; 83 return BuildAction.Compile;
84 } 84 }
85 /// <summary> 85 /// <summary>
86 /// Parses the file type to figure out what type it is 86 /// Parses the file type to figure out what type it is
87 /// </summary> 87 /// </summary>
88 /// <returns></returns> 88 /// <returns></returns>
89 public SubType GetSubTypeByFileName(string fileName) 89 public SubType GetSubTypeByFileName(string fileName)
90 { 90 {
91 string extension = System.IO.Path.GetExtension(fileName).ToLower(); 91 string extension = System.IO.Path.GetExtension(fileName).ToLower();
92 string designer = String.Format(".designer{0}", extension); 92 string designer = String.Format(".designer{0}", extension);
93 string path = fileName.ToLower(); 93 string path = fileName.ToLower();
94 if (extension == ".resx") 94 if (extension == ".resx")
95 { 95 {
96 return SubType.Designer; 96 return SubType.Designer;
97 } 97 }
98 else if (path.EndsWith(".settings")) 98 else if (path.EndsWith(".settings"))
99 { 99 {
100 return SubType.Settings; 100 return SubType.Settings;
101 } 101 }
102 else 102 else
103 { 103 {
104 104
105 foreach (string type in WebTypes) 105 foreach (string type in WebTypes)
106 { 106 {
107 if (path.EndsWith(type)) 107 if (path.EndsWith(type))
108 { 108 {
109 return SubType.CodeBehind; 109 return SubType.CodeBehind;
110 } 110 }
111 } 111 }
112 } 112 }
113 return SubType.Code; 113 return SubType.Code;
114 } 114 }
115 #endregion 115 #endregion
116 } 116 }
117} 117}
diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
index 974b74e..845db24 100644
--- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
+++ b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs
@@ -43,18 +43,18 @@ namespace Prebuild.Core.Nodes
43 providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; 43 providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break;
44 case "System.Data.OracleClient": 44 case "System.Data.OracleClient":
45 providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; 45 providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break;
46 case "System.Data.SqlClient": 46 case "System.Data.SqlClient":
47 providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; 47 providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break;
48 case "System.Data.Odbc": 48 case "System.Data.Odbc":
49 providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; 49 providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break;
50 50
51 default: 51 default:
52 throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); 52 throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id.");
53 } 53 }
54 } 54 }
55 else 55 else
56 providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); 56 providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B")));
57 57
58 connectionString = Helper.AttributeValue(node, "connectionString", connectionString); 58 connectionString = Helper.AttributeValue(node, "connectionString", connectionString);
59 59
60 base.Parse(node); 60 base.Parse(node);
diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs
index 713b47c..d1293a0 100644
--- a/Prebuild/src/Core/Nodes/DescriptionNode.cs
+++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,56 +32,56 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// The object representing the /Prebuild/Solution/Project/Description element 36 /// The object representing the /Prebuild/Solution/Project/Description element
37 /// </summary> 37 /// </summary>
38 [DataNode("Description")] 38 [DataNode("Description")]
39 public class DescriptionNode : DataNode 39 public class DescriptionNode : DataNode
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Value; 43 private string m_Value;
44 44
45 #endregion 45 #endregion
46 46
47 #region Properties 47 #region Properties
48 48
49 /// <summary> 49 /// <summary>
50 /// Gets the description Value. 50 /// Gets the description Value.
51 /// </summary> 51 /// </summary>
52 /// <value>The description Value.</value> 52 /// <value>The description Value.</value>
53 public string Value 53 public string Value
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_Value; 57 return m_Value;
58 } 58 }
59 } 59 }
60 60
61 #endregion 61 #endregion
62 62
63 #region Public Methods 63 #region Public Methods
64 64
65 /// <summary> 65 /// <summary>
66 /// Parses the specified node. 66 /// Parses the specified node.
67 /// </summary> 67 /// </summary>
68 /// <param name="node">The node.</param> 68 /// <param name="node">The node.</param>
69 public override void Parse(XmlNode node) 69 public override void Parse(XmlNode node)
70 { 70 {
71 if( node == null ) 71 if( node == null )
72 { 72 {
73 throw new ArgumentNullException("node"); 73 throw new ArgumentNullException("node");
74 } 74 }
75 75
76 m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText); 76 m_Value = Helper.InterpolateForEnvironmentVariables(node.InnerText);
77 if(m_Value == null) 77 if(m_Value == null)
78 { 78 {
79 m_Value = ""; 79 m_Value = "";
80 } 80 }
81 81
82 m_Value = m_Value.Trim(); 82 m_Value = m_Value.Trim();
83 } 83 }
84 84
85 #endregion 85 #endregion
86 } 86 }
87} 87}
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs
index addbdb4..7f04cba 100644
--- a/Prebuild/src/Core/Nodes/ExcludeNode.cs
+++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,31 +32,31 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("Exclude")] 38 [DataNode("Exclude")]
39 public class ExcludeNode : DataNode 39 public class ExcludeNode : DataNode
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Pattern = ""; 43 private string m_Pattern = "";
44 44
45 #endregion 45 #endregion
46 46
47 #region Properties 47 #region Properties
48 48
49 /// <summary> 49 /// <summary>
50 /// Gets the name. 50 /// Gets the name.
51 /// </summary> 51 /// </summary>
52 /// <value>The name.</value> 52 /// <value>The name.</value>
53 public string Name 53 public string Name
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_Pattern; 57 return m_Pattern;
58 } 58 }
59 } 59 }
60 60
61 /// <summary> 61 /// <summary>
62 /// Gets the pattern. 62 /// Gets the pattern.
@@ -72,18 +72,18 @@ namespace Prebuild.Core.Nodes
72 72
73 #endregion 73 #endregion
74 74
75 #region Public Methods 75 #region Public Methods
76 76
77 /// <summary> 77 /// <summary>
78 /// Parses the specified node. 78 /// Parses the specified node.
79 /// </summary> 79 /// </summary>
80 /// <param name="node">The node.</param> 80 /// <param name="node">The node.</param>
81 public override void Parse(XmlNode node) 81 public override void Parse(XmlNode node)
82 { 82 {
83 m_Pattern = Helper.AttributeValue( node, "name", m_Pattern ); 83 m_Pattern = Helper.AttributeValue( node, "name", m_Pattern );
84 m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern ); 84 m_Pattern = Helper.AttributeValue(node, "pattern", m_Pattern );
85 } 85 }
86 86
87 #endregion 87 #endregion
88 } 88 }
89} 89}
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs
index c66f123..b313ffa 100644
--- a/Prebuild/src/Core/Nodes/FileNode.cs
+++ b/Prebuild/src/Core/Nodes/FileNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,193 +34,193 @@ using Prebuild.Core.Targets;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 public enum BuildAction 40 public enum BuildAction
41 { 41 {
42 /// <summary>
43 ///
44 /// </summary>
45 None,
46 /// <summary>
47 ///
48 /// </summary>
49 Compile,
50 /// <summary>
51 ///
52 /// </summary>
53 Content,
54 /// <summary>
55 ///
56 /// </summary>
57 EmbeddedResource,
58 /// <summary>
59 ///
60 /// </summary>
61 ApplicationDefinition,
62 /// <summary>
63 ///
64 /// </summary>
65 Page,
42 /// <summary> 66 /// <summary>
43 /// 67 ///
44 /// </summary>
45 None,
46 /// <summary>
47 ///
48 /// </summary>
49 Compile,
50 /// <summary>
51 ///
52 /// </summary>
53 Content,
54 /// <summary>
55 ///
56 /// </summary>
57 EmbeddedResource,
58 /// <summary>
59 ///
60 /// </summary>
61 ApplicationDefinition,
62 /// <summary>
63 ///
64 /// </summary>
65 Page,
66 /// <summary>
67 ///
68 /// </summary> 68 /// </summary>
69 Copy 69 Copy
70 } 70 }
71 71
72 /// <summary> 72 /// <summary>
73 /// 73 ///
74 /// </summary> 74 /// </summary>
75 public enum SubType 75 public enum SubType
76 { 76 {
77 /// <summary>
78 ///
79 /// </summary>
80 Code,
81 /// <summary>
82 ///
83 /// </summary>
84 Component,
77 /// <summary> 85 /// <summary>
78 /// 86 ///
79 /// </summary>
80 Code,
81 /// <summary>
82 ///
83 /// </summary>
84 Component,
85 /// <summary>
86 ///
87 /// </summary> 87 /// </summary>
88 Designer, 88 Designer,
89 /// <summary> 89 /// <summary>
90 /// 90 ///
91 /// </summary> 91 /// </summary>
92 Form, 92 Form,
93 /// <summary> 93 /// <summary>
94 /// 94 ///
95 /// </summary> 95 /// </summary>
96 Settings, 96 Settings,
97 /// <summary> 97 /// <summary>
98 /// 98 ///
99 /// </summary> 99 /// </summary>
100 UserControl, 100 UserControl,
101 /// <summary> 101 /// <summary>
102 /// 102 ///
103 /// </summary> 103 /// </summary>
104 CodeBehind, 104 CodeBehind,
105 } 105 }
106 106
107 public enum CopyToOutput 107 public enum CopyToOutput
108 { 108 {
109 Never, 109 Never,
110 Always, 110 Always,
111 PreserveNewest 111 PreserveNewest
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// 115 ///
116 /// </summary> 116 /// </summary>
117 [DataNode("File")] 117 [DataNode("File")]
118 public class FileNode : DataNode 118 public class FileNode : DataNode
119 { 119 {
120 #region Fields 120 #region Fields
121 121
122 private string m_Path; 122 private string m_Path;
123 private string m_ResourceName = ""; 123 private string m_ResourceName = "";
124 private BuildAction? m_BuildAction; 124 private BuildAction? m_BuildAction;
125 private bool m_Valid; 125 private bool m_Valid;
126 private SubType? m_SubType; 126 private SubType? m_SubType;
127 private CopyToOutput m_CopyToOutput = CopyToOutput.Never; 127 private CopyToOutput m_CopyToOutput = CopyToOutput.Never;
128 private bool m_Link = false; 128 private bool m_Link = false;
129 private string m_LinkPath = string.Empty; 129 private string m_LinkPath = string.Empty;
130 private bool m_PreservePath = false; 130 private bool m_PreservePath = false;
131 131
132 132
133 #endregion 133 #endregion
134 134
135 #region Properties 135 #region Properties
136 136
137 /// <summary> 137 /// <summary>
138 /// 138 ///
139 /// </summary> 139 /// </summary>
140 public string Path 140 public string Path
141 { 141 {
142 get 142 get
143 { 143 {
144 return m_Path; 144 return m_Path;
145 } 145 }
146 } 146 }
147 147
148 /// <summary> 148 /// <summary>
149 /// 149 ///
150 /// </summary> 150 /// </summary>
151 public string ResourceName 151 public string ResourceName
152 { 152 {
153 get 153 get
154 { 154 {
155 return m_ResourceName; 155 return m_ResourceName;
156 } 156 }
157 } 157 }
158 158
159 /// <summary> 159 /// <summary>
160 /// 160 ///
161 /// </summary> 161 /// </summary>
162 public BuildAction BuildAction 162 public BuildAction BuildAction
163 { 163 {
164 get 164 get
165 { 165 {
166 if (m_BuildAction != null) 166 if (m_BuildAction != null)
167 return m_BuildAction.Value; 167 return m_BuildAction.Value;
168 else 168 else
169 return GetBuildActionByFileName(this.Path); 169 return GetBuildActionByFileName(this.Path);
170 170
171 } 171 }
172 } 172 }
173 173
174 public CopyToOutput CopyToOutput 174 public CopyToOutput CopyToOutput
175 { 175 {
176 get 176 get
177 { 177 {
178 return this.m_CopyToOutput; 178 return this.m_CopyToOutput;
179 } 179 }
180 } 180 }
181
182 public bool IsLink
183 {
184 get
185 {
186 return this.m_Link;
187 }
188 }
189
190 public string LinkPath
191 {
192 get
193 {
194 return this.m_LinkPath;
195 }
196 }
197 /// <summary>
198 ///
199 /// </summary>
200 public SubType SubType
201 {
202 get
203 {
204 if (m_SubType != null)
205 return m_SubType.Value;
206 else
207 return GetSubTypeByFileName(this.Path);
208 }
209 }
210
211 /// <summary>
212 ///
213 /// </summary>
214 public bool IsValid
215 {
216 get
217 {
218 return m_Valid;
219 }
220 }
181 221
182 public bool IsLink
183 {
184 get
185 {
186 return this.m_Link;
187 }
188 }
189
190 public string LinkPath
191 {
192 get
193 {
194 return this.m_LinkPath;
195 }
196 }
197 /// <summary> 222 /// <summary>
198 /// 223 ///
199 /// </summary>
200 public SubType SubType
201 {
202 get
203 {
204 if (m_SubType != null)
205 return m_SubType.Value;
206 else
207 return GetSubTypeByFileName(this.Path);
208 }
209 }
210
211 /// <summary>
212 ///
213 /// </summary>
214 public bool IsValid
215 {
216 get
217 {
218 return m_Valid;
219 }
220 }
221
222 /// <summary>
223 ///
224 /// </summary> 224 /// </summary>
225 /// <param name="file"></param> 225 /// <param name="file"></param>
226 /// <returns></returns> 226 /// <returns></returns>
@@ -232,61 +232,61 @@ namespace Prebuild.Core.Nodes
232 } 232 }
233 } 233 }
234 234
235 #endregion 235 #endregion
236 236
237 #region Public Methods 237 #region Public Methods
238 238
239 /// <summary> 239 /// <summary>
240 /// 240 ///
241 /// </summary> 241 /// </summary>
242 /// <param name="node"></param> 242 /// <param name="node"></param>
243 public override void Parse(XmlNode node) 243 public override void Parse(XmlNode node)
244 { 244 {
245 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); 245 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
246 if (buildAction != string.Empty) 246 if (buildAction != string.Empty)
247 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); 247 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
248 string subType = Helper.AttributeValue(node, "subType", string.Empty); 248 string subType = Helper.AttributeValue(node, "subType", string.Empty);
249 if (subType != String.Empty) 249 if (subType != String.Empty)
250 m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); 250 m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
251 251
252 Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction); 252 Console.WriteLine("[FileNode]:BuildAction is {0}", buildAction);
253 253
254 254
255 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); 255 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
256 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 256 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
257 if ( this.m_Link == true ) 257 if ( this.m_Link == true )
258 { 258 {
259 this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); 259 this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty );
260 } 260 }
261 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); 261 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
262 this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); 262 this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) );
263 263
264 if( node == null ) 264 if( node == null )
265 { 265 {
266 throw new ArgumentNullException("node"); 266 throw new ArgumentNullException("node");
267 } 267 }
268 268
269 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 269 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
270 if(m_Path == null) 270 if(m_Path == null)
271 { 271 {
272 m_Path = ""; 272 m_Path = "";
273 } 273 }
274 274
275 m_Path = m_Path.Trim(); 275 m_Path = m_Path.Trim();
276 m_Valid = true; 276 m_Valid = true;
277 if(!File.Exists(m_Path)) 277 if(!File.Exists(m_Path))
278 { 278 {
279 m_Valid = false; 279 m_Valid = false;
280 Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); 280 Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
281 } 281 }
282 282
283 if (System.IO.Path.GetExtension(m_Path) == ".settings") 283 if (System.IO.Path.GetExtension(m_Path) == ".settings")
284 { 284 {
285 m_SubType = SubType.Settings; 285 m_SubType = SubType.Settings;
286 m_BuildAction = BuildAction.None; 286 m_BuildAction = BuildAction.None;
287 } 287 }
288 } 288 }
289 289
290 #endregion 290 #endregion
291 } 291 }
292} 292}
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs
index 58b54fb..16658f3 100644
--- a/Prebuild/src/Core/Nodes/FilesNode.cs
+++ b/Prebuild/src/Core/Nodes/FilesNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,36 +34,36 @@ using System.IO;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [DataNode("Files")] 40 [DataNode("Files")]
41 public class FilesNode : DataNode 41 public class FilesNode : DataNode
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 private readonly List<string> m_Files = new List<string>(); 45 private readonly List<string> m_Files = new List<string>();
46 private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>(); 46 private readonly Dictionary<string,BuildAction> m_BuildActions = new Dictionary<string, BuildAction>();
47 private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>(); 47 private readonly Dictionary<string, SubType> m_SubTypes = new Dictionary<string, SubType>();
48 private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>(); 48 private readonly Dictionary<string, string> m_ResourceNames = new Dictionary<string, string>();
49 private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>(); 49 private readonly Dictionary<string, CopyToOutput> m_CopyToOutputs = new Dictionary<string, CopyToOutput>();
50 private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); 50 private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>();
51 private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); 51 private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>();
52 private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); 52 private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>();
53 private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); 53 private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>();
54 private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); 54 private readonly NameValueCollection m_CopyFiles = new NameValueCollection();
55 55
56 #endregion 56 #endregion
57 57
58 #region Properties 58 #region Properties
59 59
60 public int Count 60 public int Count
61 { 61 {
62 get 62 get
63 { 63 {
64 return m_Files.Count; 64 return m_Files.Count;
65 } 65 }
66 } 66 }
67 67
68 public string[] Destinations 68 public string[] Destinations
69 { 69 {
@@ -75,19 +75,19 @@ namespace Prebuild.Core.Nodes
75 get { return m_CopyFiles.Count; } 75 get { return m_CopyFiles.Count; }
76 } 76 }
77 77
78 #endregion 78 #endregion
79 79
80 #region Public Methods 80 #region Public Methods
81 81
82 public BuildAction GetBuildAction(string file) 82 public BuildAction GetBuildAction(string file)
83 { 83 {
84 if(!m_BuildActions.ContainsKey(file)) 84 if(!m_BuildActions.ContainsKey(file))
85 { 85 {
86 return BuildAction.Compile; 86 return BuildAction.Compile;
87 } 87 }
88 88
89 return m_BuildActions[file]; 89 return m_BuildActions[file];
90 } 90 }
91 91
92 public string GetDestinationPath(string file) 92 public string GetDestinationPath(string file)
93 { 93 {
@@ -103,57 +103,57 @@ namespace Prebuild.Core.Nodes
103 return m_CopyFiles.GetValues(dest); 103 return m_CopyFiles.GetValues(dest);
104 } 104 }
105 105
106 public CopyToOutput GetCopyToOutput(string file) 106 public CopyToOutput GetCopyToOutput(string file)
107 { 107 {
108 if (!m_CopyToOutputs.ContainsKey(file)) 108 if (!m_CopyToOutputs.ContainsKey(file))
109 { 109 {
110 return CopyToOutput.Never; 110 return CopyToOutput.Never;
111 } 111 }
112 return m_CopyToOutputs[file]; 112 return m_CopyToOutputs[file];
113 } 113 }
114 114
115 public bool GetIsLink(string file) 115 public bool GetIsLink(string file)
116 { 116 {
117 if (!m_Links.ContainsKey(file)) 117 if (!m_Links.ContainsKey(file))
118 { 118 {
119 return false; 119 return false;
120 } 120 }
121 return m_Links[file]; 121 return m_Links[file];
122 } 122 }
123 123
124 public bool Contains(string file) 124 public bool Contains(string file)
125 { 125 {
126 return m_Files.Contains(file); 126 return m_Files.Contains(file);
127 } 127 }
128 128
129 public string GetLinkPath( string file ) 129 public string GetLinkPath( string file )
130 { 130 {
131 if ( !m_LinkPaths.ContainsKey( file ) ) 131 if ( !m_LinkPaths.ContainsKey( file ) )
132 { 132 {
133 return string.Empty; 133 return string.Empty;
134 } 134 }
135 return m_LinkPaths[ file ]; 135 return m_LinkPaths[ file ];
136 } 136 }
137 137
138 public SubType GetSubType(string file) 138 public SubType GetSubType(string file)
139 { 139 {
140 if(!m_SubTypes.ContainsKey(file)) 140 if(!m_SubTypes.ContainsKey(file))
141 { 141 {
142 return SubType.Code; 142 return SubType.Code;
143 } 143 }
144 144
145 return m_SubTypes[file]; 145 return m_SubTypes[file];
146 } 146 }
147 147
148 public string GetResourceName(string file) 148 public string GetResourceName(string file)
149 { 149 {
150 if(!m_ResourceNames.ContainsKey(file)) 150 if(!m_ResourceNames.ContainsKey(file))
151 { 151 {
152 return string.Empty; 152 return string.Empty;
153 } 153 }
154 154
155 return m_ResourceNames[file]; 155 return m_ResourceNames[file];
156 } 156 }
157 157
158 public bool GetPreservePath( string file ) 158 public bool GetPreservePath( string file )
159 { 159 {
@@ -165,45 +165,45 @@ namespace Prebuild.Core.Nodes
165 return m_PreservePaths[ file ]; 165 return m_PreservePaths[ file ];
166 } 166 }
167 167
168 public override void Parse(XmlNode node) 168 public override void Parse(XmlNode node)
169 { 169 {
170 if( node == null ) 170 if( node == null )
171 { 171 {
172 throw new ArgumentNullException("node"); 172 throw new ArgumentNullException("node");
173 } 173 }
174 foreach(XmlNode child in node.ChildNodes) 174 foreach(XmlNode child in node.ChildNodes)
175 { 175 {
176 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 176 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
177 if(dataNode is FileNode) 177 if(dataNode is FileNode)
178 { 178 {
179 FileNode fileNode = (FileNode)dataNode; 179 FileNode fileNode = (FileNode)dataNode;
180 if(fileNode.IsValid) 180 if(fileNode.IsValid)
181 { 181 {
182 if (!m_Files.Contains(fileNode.Path)) 182 if (!m_Files.Contains(fileNode.Path))
183 { 183 {
184 m_Files.Add(fileNode.Path); 184 m_Files.Add(fileNode.Path);
185 m_BuildActions[fileNode.Path] = fileNode.BuildAction; 185 m_BuildActions[fileNode.Path] = fileNode.BuildAction;
186 m_SubTypes[fileNode.Path] = fileNode.SubType; 186 m_SubTypes[fileNode.Path] = fileNode.SubType;
187 m_ResourceNames[fileNode.Path] = fileNode.ResourceName; 187 m_ResourceNames[fileNode.Path] = fileNode.ResourceName;
188 m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; 188 m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath;
189 m_Links[ fileNode.Path ] = fileNode.IsLink; 189 m_Links[ fileNode.Path ] = fileNode.IsLink;
190 m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; 190 m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath;
191 m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; 191 m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput;
192 192
193 } 193 }
194 } 194 }
195 } 195 }
196 else if(dataNode is MatchNode) 196 else if(dataNode is MatchNode)
197 { 197 {
198 foreach(string file in ((MatchNode)dataNode).Files) 198 foreach(string file in ((MatchNode)dataNode).Files)
199 { 199 {
200 MatchNode matchNode = (MatchNode)dataNode; 200 MatchNode matchNode = (MatchNode)dataNode;
201 if (!m_Files.Contains(file)) 201 if (!m_Files.Contains(file))
202 { 202 {
203 m_Files.Add(file); 203 m_Files.Add(file);
204 if (matchNode.BuildAction == null) 204 if (matchNode.BuildAction == null)
205 m_BuildActions[file] = GetBuildActionByFileName(file); 205 m_BuildActions[file] = GetBuildActionByFileName(file);
206 else 206 else
207 m_BuildActions[file] = matchNode.BuildAction.Value; 207 m_BuildActions[file] = matchNode.BuildAction.Value;
208 208
209 if (matchNode.BuildAction == BuildAction.Copy) 209 if (matchNode.BuildAction == BuildAction.Copy)
@@ -212,27 +212,27 @@ namespace Prebuild.Core.Nodes
212 m_DestinationPath[file] = matchNode.DestinationPath; 212 m_DestinationPath[file] = matchNode.DestinationPath;
213 } 213 }
214 214
215 m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; 215 m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value;
216 m_ResourceNames[ file ] = matchNode.ResourceName; 216 m_ResourceNames[ file ] = matchNode.ResourceName;
217 m_PreservePaths[ file ] = matchNode.PreservePath; 217 m_PreservePaths[ file ] = matchNode.PreservePath;
218 m_Links[ file ] = matchNode.IsLink; 218 m_Links[ file ] = matchNode.IsLink;
219 m_LinkPaths[ file ] = matchNode.LinkPath; 219 m_LinkPaths[ file ] = matchNode.LinkPath;
220 m_CopyToOutputs[ file ] = matchNode.CopyToOutput; 220 m_CopyToOutputs[ file ] = matchNode.CopyToOutput;
221 221
222 } 222 }
223 } 223 }
224 } 224 }
225 } 225 }
226 } 226 }
227 227
228 // TODO: Check in to why StringCollection's enumerator doesn't implement 228 // TODO: Check in to why StringCollection's enumerator doesn't implement
229 // IEnumerator? 229 // IEnumerator?
230 public IEnumerator<string> GetEnumerator() 230 public IEnumerator<string> GetEnumerator()
231 { 231 {
232 return m_Files.GetEnumerator(); 232 return m_Files.GetEnumerator();
233 } 233 }
234 234
235 #endregion 235 #endregion
236 236
237 } 237 }
238} 238}
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs
index fe02277..000bde9 100644
--- a/Prebuild/src/Core/Nodes/MatchNode.cs
+++ b/Prebuild/src/Core/Nodes/MatchNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -35,51 +35,51 @@ using Prebuild.Core.Utilities;
35 35
36namespace Prebuild.Core.Nodes 36namespace Prebuild.Core.Nodes
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// 39 ///
40 /// </summary> 40 /// </summary>
41 [DataNode("Match")] 41 [DataNode("Match")]
42 public class MatchNode : DataNode 42 public class MatchNode : DataNode
43 { 43 {
44 #region Fields 44 #region Fields
45 45
46 private readonly List<string> m_Files = new List<string>(); 46 private readonly List<string> m_Files = new List<string>();
47 private Regex m_Regex; 47 private Regex m_Regex;
48 private BuildAction? m_BuildAction; 48 private BuildAction? m_BuildAction;
49 private SubType? m_SubType; 49 private SubType? m_SubType;
50 string m_ResourceName = ""; 50 string m_ResourceName = "";
51 private CopyToOutput m_CopyToOutput; 51 private CopyToOutput m_CopyToOutput;
52 private bool m_Link; 52 private bool m_Link;
53 private string m_LinkPath; 53 private string m_LinkPath;
54 private bool m_PreservePath; 54 private bool m_PreservePath;
55 private string m_Destination = ""; 55 private string m_Destination = "";
56 private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>(); 56 private readonly List<ExcludeNode> m_Exclusions = new List<ExcludeNode>();
57 57
58 #endregion 58 #endregion
59 59
60 #region Properties 60 #region Properties
61 61
62 /// <summary> 62 /// <summary>
63 /// 63 ///
64 /// </summary> 64 /// </summary>
65 public IEnumerable<string> Files 65 public IEnumerable<string> Files
66 { 66 {
67 get 67 get
68 { 68 {
69 return m_Files; 69 return m_Files;
70 } 70 }
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// 74 ///
75 /// </summary> 75 /// </summary>
76 public BuildAction? BuildAction 76 public BuildAction? BuildAction
77 { 77 {
78 get 78 get
79 { 79 {
80 return m_BuildAction; 80 return m_BuildAction;
81 } 81 }
82 } 82 }
83 83
84 public string DestinationPath 84 public string DestinationPath
85 { 85 {
@@ -88,50 +88,50 @@ namespace Prebuild.Core.Nodes
88 return m_Destination; 88 return m_Destination;
89 } 89 }
90 } 90 }
91 /// <summary> 91 /// <summary>
92 /// 92 ///
93 /// </summary> 93 /// </summary>
94 public SubType? SubType 94 public SubType? SubType
95 { 95 {
96 get 96 get
97 { 97 {
98 return m_SubType; 98 return m_SubType;
99 } 99 }
100 } 100 }
101 101
102 public CopyToOutput CopyToOutput 102 public CopyToOutput CopyToOutput
103 { 103 {
104 get 104 get
105 { 105 {
106 return m_CopyToOutput; 106 return m_CopyToOutput;
107 } 107 }
108 } 108 }
109 109
110 public bool IsLink 110 public bool IsLink
111 { 111 {
112 get 112 get
113 { 113 {
114 return m_Link; 114 return m_Link;
115 } 115 }
116 } 116 }
117 117
118 public string LinkPath 118 public string LinkPath
119 { 119 {
120 get 120 get
121 { 121 {
122 return m_LinkPath; 122 return m_LinkPath;
123 } 123 }
124 } 124 }
125 /// <summary> 125 /// <summary>
126 /// 126 ///
127 /// </summary> 127 /// </summary>
128 public string ResourceName 128 public string ResourceName
129 { 129 {
130 get 130 get
131 { 131 {
132 return m_ResourceName; 132 return m_ResourceName;
133 } 133 }
134 } 134 }
135 135
136 public bool PreservePath 136 public bool PreservePath
137 { 137 {
@@ -141,27 +141,27 @@ namespace Prebuild.Core.Nodes
141 } 141 }
142 } 142 }
143 143
144 #endregion 144 #endregion
145 145
146 #region Private Methods 146 #region Private Methods
147 147
148 /// <summary> 148 /// <summary>
149 /// Recurses the directories. 149 /// Recurses the directories.
150 /// </summary> 150 /// </summary>
151 /// <param name="path">The path.</param> 151 /// <param name="path">The path.</param>
152 /// <param name="pattern">The pattern.</param> 152 /// <param name="pattern">The pattern.</param>
153 /// <param name="recurse">if set to <c>true</c> [recurse].</param> 153 /// <param name="recurse">if set to <c>true</c> [recurse].</param>
154 /// <param name="useRegex">if set to <c>true</c> [use regex].</param> 154 /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
155 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions) 155 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List<ExcludeNode> exclusions)
156 { 156 {
157 Match match; 157 Match match;
158 try 158 try
159 { 159 {
160 string[] files; 160 string[] files;
161 161
162 Boolean excludeFile; 162 Boolean excludeFile;
163 if(!useRegex) 163 if(!useRegex)
164 { 164 {
165 try 165 try
166 { 166 {
167 files = Directory.GetFiles(path, pattern); 167 files = Directory.GetFiles(path, pattern);
@@ -169,7 +169,7 @@ namespace Prebuild.Core.Nodes
169 catch (IOException) 169 catch (IOException)
170 { 170 {
171 // swallow weird IOException error when running in a virtual box 171 // swallow weird IOException error when running in a virtual box
172 // guest OS on a network share when the host OS is not Windows. 172 // guest OS on a network share when the host OS is not Windows.
173 // This seems to happen on network shares 173 // This seems to happen on network shares
174 // when no files match, and may be related to this report: 174 // when no files match, and may be related to this report:
175 // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 175 // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546
@@ -177,20 +177,20 @@ namespace Prebuild.Core.Nodes
177 files = null; 177 files = null;
178 } 178 }
179 179
180 if(files != null) 180 if(files != null)
181 { 181 {
182 foreach (string file in files) 182 foreach (string file in files)
183 { 183 {
184 excludeFile = false; 184 excludeFile = false;
185 string fileTemp; 185 string fileTemp;
186 if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") 186 if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\")
187 { 187 {
188 fileTemp = file.Substring(2); 188 fileTemp = file.Substring(2);
189 } 189 }
190 else 190 else
191 { 191 {
192 fileTemp = file; 192 fileTemp = file;
193 } 193 }
194 194
195 // Check all excludions and set flag if there are any hits. 195 // Check all excludions and set flag if there are any hits.
196 foreach ( ExcludeNode exclude in exclusions ) 196 foreach ( ExcludeNode exclude in exclusions )
@@ -205,18 +205,18 @@ namespace Prebuild.Core.Nodes
205 m_Files.Add( fileTemp ); 205 m_Files.Add( fileTemp );
206 } 206 }
207 207
208 } 208 }
209 } 209 }
210 210
211 // don't call return here, because we may need to recursively search directories below 211 // don't call return here, because we may need to recursively search directories below
212 // this one, even if no matches were found in this directory. 212 // this one, even if no matches were found in this directory.
213 } 213 }
214 else 214 else
215 { 215 {
216 try 216 try
217 { 217 {
218 files = Directory.GetFiles(path); 218 files = Directory.GetFiles(path);
219 } 219 }
220 catch (IOException) 220 catch (IOException)
221 { 221 {
222 // swallow weird IOException error when running in a virtual box 222 // swallow weird IOException error when running in a virtual box
@@ -248,12 +248,12 @@ namespace Prebuild.Core.Nodes
248 } 248 }
249 } 249 }
250 } 250 }
251 } 251 }
252 252
253 if(recurse) 253 if(recurse)
254 { 254 {
255 string[] dirs = Directory.GetDirectories(path); 255 string[] dirs = Directory.GetDirectories(path);
256 if(dirs != null && dirs.Length > 0) 256 if(dirs != null && dirs.Length > 0)
257 { 257 {
258 foreach (string str in dirs) 258 foreach (string str in dirs)
259 { 259 {
@@ -265,96 +265,96 @@ namespace Prebuild.Core.Nodes
265 RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); 265 RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions);
266 } 266 }
267 } 267 }
268 } 268 }
269 } 269 }
270 catch(DirectoryNotFoundException) 270 catch(DirectoryNotFoundException)
271 { 271 {
272 return; 272 return;
273 } 273 }
274 catch(ArgumentException) 274 catch(ArgumentException)
275 { 275 {
276 return; 276 return;
277 } 277 }
278 } 278 }
279 279
280 #endregion 280 #endregion
281 281
282 #region Public Methods 282 #region Public Methods
283 283
284 /// <summary> 284 /// <summary>
285 /// 285 ///
286 /// </summary> 286 /// </summary>
287 /// <param name="node"></param> 287 /// <param name="node"></param>
288 public override void Parse(XmlNode node) 288 public override void Parse(XmlNode node)
289 { 289 {
290 if( node == null ) 290 if( node == null )
291 { 291 {
292 throw new ArgumentNullException("node"); 292 throw new ArgumentNullException("node");
293 } 293 }
294 string path = Helper.AttributeValue(node, "path", "."); 294 string path = Helper.AttributeValue(node, "path", ".");
295 string pattern = Helper.AttributeValue(node, "pattern", "*"); 295 string pattern = Helper.AttributeValue(node, "pattern", "*");
296 string destination = Helper.AttributeValue(node, "destination", string.Empty); 296 string destination = Helper.AttributeValue(node, "destination", string.Empty);
297 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); 297 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
298 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); 298 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
299 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); 299 string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty);
300 if (buildAction != string.Empty) 300 if (buildAction != string.Empty)
301 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); 301 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
302 302
303 303
304 //TODO: Figure out where the subtype node is being assigned 304 //TODO: Figure out where the subtype node is being assigned
305 //string subType = Helper.AttributeValue(node, "subType", string.Empty); 305 //string subType = Helper.AttributeValue(node, "subType", string.Empty);
306 //if (subType != String.Empty) 306 //if (subType != String.Empty)
307 // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); 307 // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType);
308 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); 308 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName);
309 m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); 309 m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString()));
310 m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); 310 m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
311 if ( m_Link ) 311 if ( m_Link )
312 { 312 {
313 m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); 313 m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty );
314 } 314 }
315 m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); 315 m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) );
316 316
317 if ( buildAction == "Copy") 317 if ( buildAction == "Copy")
318 m_Destination = destination; 318 m_Destination = destination;
319 319
320 if(path != null && path.Length == 0) 320 if(path != null && path.Length == 0)
321 path = ".";//use current directory 321 path = ".";//use current directory
322 322
323 //throw new WarningException("Match must have a 'path' attribute"); 323 //throw new WarningException("Match must have a 'path' attribute");
324 324
325 if(pattern == null) 325 if(pattern == null)
326 { 326 {
327 throw new WarningException("Match must have a 'pattern' attribute"); 327 throw new WarningException("Match must have a 'pattern' attribute");
328 } 328 }
329 329
330 path = Helper.NormalizePath(path); 330 path = Helper.NormalizePath(path);
331 if(!Directory.Exists(path)) 331 if(!Directory.Exists(path))
332 { 332 {
333 throw new WarningException("Match path does not exist: {0}", path); 333 throw new WarningException("Match path does not exist: {0}", path);
334 } 334 }
335 335
336 try 336 try
337 { 337 {
338 if(useRegex) 338 if(useRegex)
339 { 339 {
340 m_Regex = new Regex(pattern); 340 m_Regex = new Regex(pattern);
341 } 341 }
342 } 342 }
343 catch(ArgumentException ex) 343 catch(ArgumentException ex)
344 { 344 {
345 throw new WarningException("Could not compile regex pattern: {0}", ex.Message); 345 throw new WarningException("Could not compile regex pattern: {0}", ex.Message);
346 } 346 }
347 347
348 348
349 foreach(XmlNode child in node.ChildNodes) 349 foreach(XmlNode child in node.ChildNodes)
350 { 350 {
351 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 351 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
352 if(dataNode is ExcludeNode) 352 if(dataNode is ExcludeNode)
353 { 353 {
354 ExcludeNode excludeNode = (ExcludeNode)dataNode; 354 ExcludeNode excludeNode = (ExcludeNode)dataNode;
355 m_Exclusions.Add( excludeNode ); 355 m_Exclusions.Add( excludeNode );
356 } 356 }
357 } 357 }
358 358
359 RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); 359 RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions );
360 360
@@ -371,8 +371,8 @@ namespace Prebuild.Core.Nodes
371 throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); 371 throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern);
372 } 372 }
373 m_Regex = null; 373 m_Regex = null;
374 } 374 }
375 375
376 #endregion 376 #endregion
377 } 377 }
378} 378}
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs
index d45bd34..490fd6f 100644
--- a/Prebuild/src/Core/Nodes/OptionsNode.cs
+++ b/Prebuild/src/Core/Nodes/OptionsNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,273 +34,291 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [DataNode("Options")] 40 [DataNode("Options")]
41 public class OptionsNode : DataNode 41 public class OptionsNode : DataNode
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); 45 private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>();
46 46
47 [OptionNode("CompilerDefines")] 47 [OptionNode("CompilerDefines")]
48 private string m_CompilerDefines = ""; 48 private string m_CompilerDefines = "";
49 49
50 /// <summary> 50 /// <summary>
51 /// 51 ///
52 /// </summary> 52 /// </summary>
53 public string CompilerDefines 53 public string CompilerDefines
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_CompilerDefines; 57 return m_CompilerDefines;
58 } 58 }
59 set 59 set
60 { 60 {
61 m_CompilerDefines = value; 61 m_CompilerDefines = value;
62 } 62 }
63 } 63 }
64 64
65 [OptionNode("OptimizeCode")] 65 [OptionNode("OptimizeCode")]
66 private bool m_OptimizeCode; 66 private bool m_OptimizeCode;
67 67
68 /// <summary> 68 /// <summary>
69 /// 69 ///
70 /// </summary> 70 /// </summary>
71 public bool OptimizeCode 71 public bool OptimizeCode
72 { 72 {
73 get 73 get
74 { 74 {
75 return m_OptimizeCode; 75 return m_OptimizeCode;
76 } 76 }
77 set 77 set
78 { 78 {
79 m_OptimizeCode = value; 79 m_OptimizeCode = value;
80 } 80 }
81 } 81 }
82 82
83 [OptionNode("CheckUnderflowOverflow")] 83 [OptionNode("CheckUnderflowOverflow")]
84 private bool m_CheckUnderflowOverflow; 84 private bool m_CheckUnderflowOverflow;
85 85
86 /// <summary> 86 /// <summary>
87 /// 87 ///
88 /// </summary> 88 /// </summary>
89 public bool CheckUnderflowOverflow 89 public bool CheckUnderflowOverflow
90 { 90 {
91 get 91 get
92 { 92 {
93 return m_CheckUnderflowOverflow; 93 return m_CheckUnderflowOverflow;
94 } 94 }
95 set 95 set
96 { 96 {
97 m_CheckUnderflowOverflow = value; 97 m_CheckUnderflowOverflow = value;
98 } 98 }
99 } 99 }
100 100
101 [OptionNode("AllowUnsafe")] 101 [OptionNode("AllowUnsafe")]
102 private bool m_AllowUnsafe; 102 private bool m_AllowUnsafe;
103 103
104 /// <summary> 104 /// <summary>
105 /// 105 ///
106 /// </summary> 106 /// </summary>
107 public bool AllowUnsafe 107 public bool AllowUnsafe
108 { 108 {
109 get 109 get
110 { 110 {
111 return m_AllowUnsafe; 111 return m_AllowUnsafe;
112 } 112 }
113 set 113 set
114 { 114 {
115 m_AllowUnsafe = value; 115 m_AllowUnsafe = value;
116 } 116 }
117 } 117 }
118 118
119 [OptionNode("PreBuildEvent")] 119 [OptionNode("PreBuildEvent")]
120 private string m_PreBuildEvent; 120 private string m_PreBuildEvent;
121 121
122 /// <summary> 122 /// <summary>
123 /// 123 ///
124 /// </summary> 124 /// </summary>
125 public string PreBuildEvent 125 public string PreBuildEvent
126 { 126 {
127 get 127 get
128 { 128 {
129 return m_PreBuildEvent; 129 return m_PreBuildEvent;
130 } 130 }
131 set 131 set
132 { 132 {
133 m_PreBuildEvent = value; 133 m_PreBuildEvent = value;
134 } 134 }
135 } 135 }
136 136
137 [OptionNode("PostBuildEvent")] 137 [OptionNode("PostBuildEvent")]
138 private string m_PostBuildEvent; 138 private string m_PostBuildEvent;
139 139
140 /// <summary> 140 /// <summary>
141 /// 141 ///
142 /// </summary> 142 /// </summary>
143 public string PostBuildEvent 143 public string PostBuildEvent
144 { 144 {
145 get 145 get
146 { 146 {
147 return m_PostBuildEvent; 147 return m_PostBuildEvent;
148 } 148 }
149 set 149 set
150 { 150 {
151 m_PostBuildEvent = value; 151 m_PostBuildEvent = value;
152 } 152 }
153 } 153 }
154 154
155 [OptionNode("PreBuildEventArgs")] 155 [OptionNode("PreBuildEventArgs")]
156 private string m_PreBuildEventArgs; 156 private string m_PreBuildEventArgs;
157 157
158 /// <summary> 158 /// <summary>
159 /// 159 ///
160 /// </summary> 160 /// </summary>
161 public string PreBuildEventArgs 161 public string PreBuildEventArgs
162 { 162 {
163 get 163 get
164 { 164 {
165 return m_PreBuildEventArgs; 165 return m_PreBuildEventArgs;
166 } 166 }
167 set 167 set
168 { 168 {
169 m_PreBuildEventArgs = value; 169 m_PreBuildEventArgs = value;
170 } 170 }
171 } 171 }
172 172
173 [OptionNode("PostBuildEventArgs")] 173 [OptionNode("PostBuildEventArgs")]
174 private string m_PostBuildEventArgs; 174 private string m_PostBuildEventArgs;
175 175
176 /// <summary> 176 /// <summary>
177 /// 177 ///
178 /// </summary> 178 /// </summary>
179 public string PostBuildEventArgs 179 public string PostBuildEventArgs
180 { 180 {
181 get 181 get
182 { 182 {
183 return m_PostBuildEventArgs; 183 return m_PostBuildEventArgs;
184 } 184 }
185 set 185 set
186 { 186 {
187 m_PostBuildEventArgs = value; 187 m_PostBuildEventArgs = value;
188 } 188 }
189 } 189 }
190 190
191 [OptionNode("RunPostBuildEvent")] 191 [OptionNode("RunPostBuildEvent")]
192 private string m_RunPostBuildEvent; 192 private string m_RunPostBuildEvent;
193 193
194 /// <summary> 194 /// <summary>
195 /// 195 ///
196 /// </summary> 196 /// </summary>
197 public string RunPostBuildEvent 197 public string RunPostBuildEvent
198 { 198 {
199 get 199 get
200 { 200 {
201 return m_RunPostBuildEvent; 201 return m_RunPostBuildEvent;
202 } 202 }
203 set 203 set
204 { 204 {
205 m_RunPostBuildEvent = value; 205 m_RunPostBuildEvent = value;
206 } 206 }
207 } 207 }
208 208
209 [OptionNode("RunScript")] 209 [OptionNode("RunScript")]
210 private string m_RunScript; 210 private string m_RunScript;
211 211
212 /// <summary> 212 /// <summary>
213 /// 213 ///
214 /// </summary> 214 /// </summary>
215 public string RunScript 215 public string RunScript
216 { 216 {
217 get 217 get
218 { 218 {
219 return m_RunScript; 219 return m_RunScript;
220 } 220 }
221 set 221 set
222 { 222 {
223 m_RunScript = value; 223 m_RunScript = value;
224 } 224 }
225 } 225 }
226 226
227 [OptionNode("WarningLevel")] 227 [OptionNode("WarningLevel")]
228 private int m_WarningLevel = 4; 228 private int m_WarningLevel = 4;
229 229
230 /// <summary> 230 /// <summary>
231 /// 231 ///
232 /// </summary> 232 /// </summary>
233 public int WarningLevel 233 public int WarningLevel
234 { 234 {
235 get 235 get
236 { 236 {
237 return m_WarningLevel; 237 return m_WarningLevel;
238 } 238 }
239 set 239 set
240 { 240 {
241 m_WarningLevel = value; 241 m_WarningLevel = value;
242 } 242 }
243 } 243 }
244 244
245 [OptionNode("WarningsAsErrors")] 245 [OptionNode("WarningsAsErrors")]
246 private bool m_WarningsAsErrors; 246 private bool m_WarningsAsErrors;
247 247
248 /// <summary> 248 /// <summary>
249 /// 249 ///
250 /// </summary> 250 /// </summary>
251 public bool WarningsAsErrors 251 public bool WarningsAsErrors
252 { 252 {
253 get 253 get
254 { 254 {
255 return m_WarningsAsErrors; 255 return m_WarningsAsErrors;
256 } 256 }
257 set 257 set
258 { 258 {
259 m_WarningsAsErrors = value; 259 m_WarningsAsErrors = value;
260 } 260 }
261 } 261 }
262 262
263 [OptionNode("SuppressWarnings")] 263 [OptionNode("SuppressWarnings")]
264 private string m_SuppressWarnings = ""; 264 private string m_SuppressWarnings = "";
265 265
266 /// <summary> 266 /// <summary>
267 /// 267 ///
268 /// </summary> 268 /// </summary>
269 public string SuppressWarnings 269 public string SuppressWarnings
270 { 270 {
271 get 271 get
272 { 272 {
273 return m_SuppressWarnings; 273 return m_SuppressWarnings;
274 } 274 }
275 set 275 set
276 { 276 {
277 m_SuppressWarnings = value; 277 m_SuppressWarnings = value;
278 } 278 }
279 } 279 }
280 280
281 [OptionNode("OutputPath")] 281 [OptionNode("Prefer32Bit")]
282 private string m_OutputPath = "bin/"; 282 private bool m_Prefer32Bit;
283 283
284 /// <summary> 284 /// <summary>
285 /// 285 ///
286 /// </summary> 286 /// </summary>
287 public string OutputPath 287 public bool Prefer32Bit
288 { 288 {
289 get 289 get
290 { 290 {
291 return m_OutputPath; 291 return m_Prefer32Bit;
292 } 292 }
293 set 293 set
294 { 294 {
295 m_OutputPath = value; 295 m_Prefer32Bit = value;
296 } 296 }
297 } 297 }
298
299 [OptionNode("OutputPath")]
300 private string m_OutputPath = "bin/";
301
302 /// <summary>
303 ///
304 /// </summary>
305 public string OutputPath
306 {
307 get
308 {
309 return m_OutputPath;
310 }
311 set
312 {
313 m_OutputPath = value;
314 }
315 }
298 316
299 [OptionNode("GenerateDocumentation")] 317 [OptionNode("GenerateDocumentation")]
300 private bool m_GenerateDocumentation; 318 private bool m_GenerateDocumentation;
301 319
302 /// <summary> 320 /// <summary>
303 /// 321 ///
304 /// </summary> 322 /// </summary>
305 public bool GenerateDocumentation 323 public bool GenerateDocumentation
306 { 324 {
@@ -314,321 +332,321 @@ namespace Prebuild.Core.Nodes
314 } 332 }
315 } 333 }
316 334
317 [OptionNode("GenerateXmlDocFile")] 335 [OptionNode("GenerateXmlDocFile")]
318 private bool m_GenerateXmlDocFile; 336 private bool m_GenerateXmlDocFile;
319 337
320 /// <summary> 338 /// <summary>
321 /// 339 ///
322 /// </summary> 340 /// </summary>
323 public bool GenerateXmlDocFile 341 public bool GenerateXmlDocFile
324 { 342 {
325 get 343 get
326 { 344 {
327 return m_GenerateXmlDocFile; 345 return m_GenerateXmlDocFile;
328 } 346 }
329 set 347 set
330 { 348 {
331 m_GenerateXmlDocFile = value; 349 m_GenerateXmlDocFile = value;
332 } 350 }
333 } 351 }
334 352
335 [OptionNode("XmlDocFile")] 353 [OptionNode("XmlDocFile")]
336 private string m_XmlDocFile = ""; 354 private string m_XmlDocFile = "";
337 355
338 /// <summary> 356 /// <summary>
339 /// 357 ///
340 /// </summary> 358 /// </summary>
341 public string XmlDocFile 359 public string XmlDocFile
342 { 360 {
343 get 361 get
344 { 362 {
345 return m_XmlDocFile; 363 return m_XmlDocFile;
346 } 364 }
347 set 365 set
348 { 366 {
349 m_XmlDocFile = value; 367 m_XmlDocFile = value;
350 } 368 }
351 } 369 }
352 370
353 [OptionNode("KeyFile")] 371 [OptionNode("KeyFile")]
354 private string m_KeyFile = ""; 372 private string m_KeyFile = "";
355 373
356 /// <summary> 374 /// <summary>
357 /// 375 ///
358 /// </summary> 376 /// </summary>
359 public string KeyFile 377 public string KeyFile
360 { 378 {
361 get 379 get
362 { 380 {
363 return m_KeyFile; 381 return m_KeyFile;
364 } 382 }
365 set 383 set
366 { 384 {
367 m_KeyFile = value; 385 m_KeyFile = value;
368 } 386 }
369 } 387 }
370 388
371 [OptionNode("DebugInformation")] 389 [OptionNode("DebugInformation")]
372 private bool m_DebugInformation; 390 private bool m_DebugInformation;
373 391
374 /// <summary> 392 /// <summary>
375 /// 393 ///
376 /// </summary> 394 /// </summary>
377 public bool DebugInformation 395 public bool DebugInformation
378 { 396 {
379 get 397 get
380 { 398 {
381 return m_DebugInformation; 399 return m_DebugInformation;
382 } 400 }
383 set 401 set
384 { 402 {
385 m_DebugInformation = value; 403 m_DebugInformation = value;
386 } 404 }
387 } 405 }
388 406
389 [OptionNode("RegisterComInterop")] 407 [OptionNode("RegisterComInterop")]
390 private bool m_RegisterComInterop; 408 private bool m_RegisterComInterop;
391 409
392 /// <summary> 410 /// <summary>
393 /// 411 ///
394 /// </summary> 412 /// </summary>
395 public bool RegisterComInterop 413 public bool RegisterComInterop
396 { 414 {
397 get 415 get
398 { 416 {
399 return m_RegisterComInterop; 417 return m_RegisterComInterop;
400 } 418 }
401 set 419 set
402 { 420 {
403 m_RegisterComInterop = value; 421 m_RegisterComInterop = value;
404 } 422 }
405 } 423 }
406 424
407 [OptionNode("RemoveIntegerChecks")] 425 [OptionNode("RemoveIntegerChecks")]
408 private bool m_RemoveIntegerChecks; 426 private bool m_RemoveIntegerChecks;
409 427
410 /// <summary> 428 /// <summary>
411 /// 429 ///
412 /// </summary> 430 /// </summary>
413 public bool RemoveIntegerChecks 431 public bool RemoveIntegerChecks
414 { 432 {
415 get 433 get
416 { 434 {
417 return m_RemoveIntegerChecks; 435 return m_RemoveIntegerChecks;
418 } 436 }
419 set 437 set
420 { 438 {
421 m_RemoveIntegerChecks = value; 439 m_RemoveIntegerChecks = value;
422 } 440 }
423 } 441 }
424 442
425 [OptionNode("IncrementalBuild")] 443 [OptionNode("IncrementalBuild")]
426 private bool m_IncrementalBuild; 444 private bool m_IncrementalBuild;
427 445
428 /// <summary> 446 /// <summary>
429 /// 447 ///
430 /// </summary> 448 /// </summary>
431 public bool IncrementalBuild 449 public bool IncrementalBuild
432 { 450 {
433 get 451 get
434 { 452 {
435 return m_IncrementalBuild; 453 return m_IncrementalBuild;
436 } 454 }
437 set 455 set
438 { 456 {
439 m_IncrementalBuild = value; 457 m_IncrementalBuild = value;
440 } 458 }
441 } 459 }
442 460
443 [OptionNode("BaseAddress")] 461 [OptionNode("BaseAddress")]
444 private string m_BaseAddress = "285212672"; 462 private string m_BaseAddress = "285212672";
445 463
446 /// <summary> 464 /// <summary>
447 /// 465 ///
448 /// </summary> 466 /// </summary>
449 public string BaseAddress 467 public string BaseAddress
450 { 468 {
451 get 469 get
452 { 470 {
453 return m_BaseAddress; 471 return m_BaseAddress;
454 } 472 }
455 set 473 set
456 { 474 {
457 m_BaseAddress = value; 475 m_BaseAddress = value;
458 } 476 }
459 } 477 }
460 478
461 [OptionNode("FileAlignment")] 479 [OptionNode("FileAlignment")]
462 private int m_FileAlignment = 4096; 480 private int m_FileAlignment = 4096;
463 481
464 /// <summary> 482 /// <summary>
465 /// 483 ///
466 /// </summary> 484 /// </summary>
467 public int FileAlignment 485 public int FileAlignment
468 { 486 {
469 get 487 get
470 { 488 {
471 return m_FileAlignment; 489 return m_FileAlignment;
472 } 490 }
473 set 491 set
474 { 492 {
475 m_FileAlignment = value; 493 m_FileAlignment = value;
476 } 494 }
477 } 495 }
478 496
479 [OptionNode("NoStdLib")] 497 [OptionNode("NoStdLib")]
480 private bool m_NoStdLib; 498 private bool m_NoStdLib;
481 499
482 /// <summary> 500 /// <summary>
483 /// 501 ///
484 /// </summary> 502 /// </summary>
485 public bool NoStdLib 503 public bool NoStdLib
486 { 504 {
487 get 505 get
488 { 506 {
489 return m_NoStdLib; 507 return m_NoStdLib;
490 } 508 }
491 set 509 set
492 { 510 {
493 m_NoStdLib = value; 511 m_NoStdLib = value;
494 } 512 }
495 } 513 }
496 514
497 private readonly List<string> m_FieldsDefined = new List<string>(); 515 private readonly List<string> m_FieldsDefined = new List<string>();
498 516
499 #endregion 517 #endregion
500 518
501 #region Constructors 519 #region Constructors
502 520
503 /// <summary> 521 /// <summary>
504 /// Initializes the <see cref="OptionsNode"/> class. 522 /// Initializes the <see cref="OptionsNode"/> class.
505 /// </summary> 523 /// </summary>
506 static OptionsNode() 524 static OptionsNode()
507 { 525 {
508 Type t = typeof(OptionsNode); 526 Type t = typeof(OptionsNode);
509 527
510 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) 528 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
511 { 529 {
512 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); 530 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false);
513 if(attrs == null || attrs.Length < 1) 531 if(attrs == null || attrs.Length < 1)
514 { 532 {
515 continue; 533 continue;
516 } 534 }
517 535
518 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; 536 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0];
519 m_OptionFields[ona.NodeName] = f; 537 m_OptionFields[ona.NodeName] = f;
520 } 538 }
521 } 539 }
522 540
523 #endregion 541 #endregion
524 542
525 #region Properties 543 #region Properties
526 544
527 /// <summary> 545 /// <summary>
528 /// Gets the <see cref="Object"/> at the specified index. 546 /// Gets the <see cref="Object"/> at the specified index.
529 /// </summary> 547 /// </summary>
530 /// <value></value> 548 /// <value></value>
531 public object this[string index] 549 public object this[string index]
532 { 550 {
533 get 551 get
534 { 552 {
535 if(!m_OptionFields.ContainsKey(index)) 553 if(!m_OptionFields.ContainsKey(index))
536 { 554 {
537 return null; 555 return null;
538 } 556 }
539 557
540 FieldInfo f = m_OptionFields[index]; 558 FieldInfo f = m_OptionFields[index];
541 return f.GetValue(this); 559 return f.GetValue(this);
542 } 560 }
543 } 561 }
544 562
545 /// <summary> 563 /// <summary>
546 /// Gets the <see cref="Object"/> at the specified index. 564 /// Gets the <see cref="Object"/> at the specified index.
547 /// </summary> 565 /// </summary>
548 /// <value></value> 566 /// <value></value>
549 public object this[string index, object defaultValue] 567 public object this[string index, object defaultValue]
550 { 568 {
551 get 569 get
552 { 570 {
553 object valueObject = this[index]; 571 object valueObject = this[index];
554 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) 572 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0)
555 { 573 {
556 return defaultValue; 574 return defaultValue;
557 } 575 }
558 return valueObject; 576 return valueObject;
559 } 577 }
560 } 578 }
561 579
562 580
563 #endregion 581 #endregion
564 582
565 #region Private Methods 583 #region Private Methods
566 584
567 private void FlagDefined(string name) 585 private void FlagDefined(string name)
568 { 586 {
569 if(!m_FieldsDefined.Contains(name)) 587 if(!m_FieldsDefined.Contains(name))
570 { 588 {
571 m_FieldsDefined.Add(name); 589 m_FieldsDefined.Add(name);
572 } 590 }
573 } 591 }
574 592
575 private void SetOption(string nodeName, string val) 593 private void SetOption(string nodeName, string val)
576 { 594 {
577 lock(m_OptionFields) 595 lock(m_OptionFields)
578 { 596 {
579 if(!m_OptionFields.ContainsKey(nodeName)) 597 if(!m_OptionFields.ContainsKey(nodeName))
580 { 598 {
581 return; 599 return;
582 } 600 }
583 601
584 FieldInfo f = m_OptionFields[nodeName]; 602 FieldInfo f = m_OptionFields[nodeName];
585 f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); 603 f.SetValue(this, Helper.TranslateValue(f.FieldType, val));
586 FlagDefined(f.Name); 604 FlagDefined(f.Name);
587 } 605 }
588 } 606 }
589 607
590 #endregion 608 #endregion
591 609
592 #region Public Methods 610 #region Public Methods
593 611
594 /// <summary> 612 /// <summary>
595 /// Parses the specified node. 613 /// Parses the specified node.
596 /// </summary> 614 /// </summary>
597 /// <param name="node">The node.</param> 615 /// <param name="node">The node.</param>
598 public override void Parse(XmlNode node) 616 public override void Parse(XmlNode node)
599 { 617 {
600 if( node == null ) 618 if( node == null )
601 { 619 {
602 throw new ArgumentNullException("node"); 620 throw new ArgumentNullException("node");
603 } 621 }
604 622
605 foreach(XmlNode child in node.ChildNodes) 623 foreach(XmlNode child in node.ChildNodes)
606 { 624 {
607 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); 625 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText));
608 } 626 }
609 } 627 }
610 628
611 /// <summary> 629 /// <summary>
612 /// Copies to. 630 /// Copies to.
613 /// </summary> 631 /// </summary>
614 /// <param name="opt">The opt.</param> 632 /// <param name="opt">The opt.</param>
615 public void CopyTo(OptionsNode opt) 633 public void CopyTo(OptionsNode opt)
616 { 634 {
617 if(opt == null) 635 if(opt == null)
618 { 636 {
619 return; 637 return;
620 } 638 }
621 639
622 foreach(FieldInfo f in m_OptionFields.Values) 640 foreach(FieldInfo f in m_OptionFields.Values)
623 { 641 {
624 if(m_FieldsDefined.Contains(f.Name)) 642 if(m_FieldsDefined.Contains(f.Name))
625 { 643 {
626 f.SetValue(opt, f.GetValue(this)); 644 f.SetValue(opt, f.GetValue(this));
627 opt.m_FieldsDefined.Add(f.Name); 645 opt.m_FieldsDefined.Add(f.Name);
628 } 646 }
629 } 647 }
630 } 648 }
631 649
632 #endregion 650 #endregion
633 } 651 }
634} 652}
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs
index b05ffc6..8ca8e49 100644
--- a/Prebuild/src/Core/Nodes/ProcessNode.cs
+++ b/Prebuild/src/Core/Nodes/ProcessNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,77 +32,77 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("Process")] 38 [DataNode("Process")]
39 public class ProcessNode : DataNode 39 public class ProcessNode : DataNode
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Path; 43 private string m_Path;
44 private bool m_IsValid = true; 44 private bool m_IsValid = true;
45 45
46 #endregion 46 #endregion
47 47
48 #region Properties 48 #region Properties
49 49
50 /// <summary> 50 /// <summary>
51 /// Gets the path. 51 /// Gets the path.
52 /// </summary> 52 /// </summary>
53 /// <value>The path.</value> 53 /// <value>The path.</value>
54 public string Path 54 public string Path
55 { 55 {
56 get 56 get
57 { 57 {
58 return m_Path; 58 return m_Path;
59 } 59 }
60 } 60 }
61 61
62 /// <summary> 62 /// <summary>
63 /// Gets a value indicating whether this instance is valid. 63 /// Gets a value indicating whether this instance is valid.
64 /// </summary> 64 /// </summary>
65 /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value> 65 /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
66 public bool IsValid 66 public bool IsValid
67 { 67 {
68 get 68 get
69 { 69 {
70 return m_IsValid; 70 return m_IsValid;
71 } 71 }
72 } 72 }
73 73
74 #endregion 74 #endregion
75 75
76 #region Public Methods 76 #region Public Methods
77 77
78 /// <summary> 78 /// <summary>
79 /// Parses the specified node. 79 /// Parses the specified node.
80 /// </summary> 80 /// </summary>
81 /// <param name="node">The node.</param> 81 /// <param name="node">The node.</param>
82 public override void Parse(XmlNode node) 82 public override void Parse(XmlNode node)
83 { 83 {
84 if( node == null ) 84 if( node == null )
85 { 85 {
86 throw new ArgumentNullException("node"); 86 throw new ArgumentNullException("node");
87 } 87 }
88 88
89 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 89 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
90 if(m_Path == null) 90 if(m_Path == null)
91 { 91 {
92 m_Path = ""; 92 m_Path = "";
93 } 93 }
94 94
95 try 95 try
96 { 96 {
97 m_Path = Helper.ResolvePath(m_Path); 97 m_Path = Helper.ResolvePath(m_Path);
98 } 98 }
99 catch(ArgumentException) 99 catch(ArgumentException)
100 { 100 {
101 Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path); 101 Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path);
102 m_IsValid = false; 102 m_IsValid = false;
103 } 103 }
104 } 104 }
105 105
106 #endregion 106 #endregion
107 } 107 }
108} 108}
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs
index e02b11b..9622d89 100644
--- a/Prebuild/src/Core/Nodes/ProjectNode.cs
+++ b/Prebuild/src/Core/Nodes/ProjectNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,190 +34,205 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// A set of values that the Project's type can be 38 /// A set of values that the Project's type can be
39 /// </summary> 39 /// </summary>
40 public enum ProjectType 40 public enum ProjectType
41 { 41 {
42 /// <summary>
43 /// The project is a console executable
44 /// </summary>
45 Exe,
46 /// <summary>
47 /// The project is a windows executable
48 /// </summary>
49 WinExe,
50 /// <summary>
51 /// The project is a library
52 /// </summary>
53 Library,
54 /// <summary>
55 /// The project is a website
56 /// </summary>
57 Web,
58 }
59
60 /// <summary>
61 ///
62 /// </summary>
63 public enum ClrRuntime
64 {
65 /// <summary>
66 ///
67 /// </summary>
68 Microsoft,
69 /// <summary>
70 ///
71 /// </summary>
72 Mono
73 }
74 /// <summary>
75 /// The version of the .NET framework to use (Required for VS2008)
76 /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks>
77 /// </summary>
78 public enum FrameworkVersion
79 {
80 /// <summary>
81 /// .NET 2.0
82 /// </summary>
83 v2_0,
84 /// <summary>
85 /// .NET 3.0
86 /// </summary>
87 v3_0,
88 /// <summary>
89 /// .NET 3.5
90 /// </summary>
91 v3_5,
92 /// <summary>
93 /// .NET 4.0
94 /// </summary>
95 v4_0,
42 /// <summary> 96 /// <summary>
43 /// The project is a console executable 97 /// .NET 4.5
44 /// </summary>
45 Exe,
46 /// <summary>
47 /// The project is a windows executable
48 /// </summary>
49 WinExe,
50 /// <summary>
51 /// The project is a library
52 /// </summary>
53 Library,
54 /// <summary>
55 /// The project is a website
56 /// </summary>
57 Web,
58 }
59
60 /// <summary>
61 ///
62 /// </summary>
63 public enum ClrRuntime
64 {
65 /// <summary>
66 ///
67 /// </summary>
68 Microsoft,
69 /// <summary>
70 ///
71 /// </summary>
72 Mono
73 }
74 /// <summary>
75 /// The version of the .NET framework to use (Required for VS2008)
76 /// <remarks>We don't need .NET 1.1 in here, it'll default when using vs2003.</remarks>
77 /// </summary>
78 public enum FrameworkVersion
79 {
80 /// <summary>
81 /// .NET 2.0
82 /// </summary>
83 v2_0,
84 /// <summary>
85 /// .NET 3.0
86 /// </summary> 98 /// </summary>
87 v3_0, 99 v4_5,
88 /// <summary> 100 /// <summary>
89 /// .NET 3.5 101 /// .NET 4.5.1
90 /// </summary> 102 /// </summary>
91 v3_5, 103 v4_5_1,
92 /// <summary> 104 /// <summary>
93 /// .NET 4.0 105 /// .NET 4.6
94 /// </summary> 106 /// </summary>
95 v4_0, 107 v4_6,
96 /// <summary> 108 /// <summary>
97 /// .NET 4.5 109 /// .NET 4.6.1
98 /// </summary> 110 /// </summary>
99 v4_5, 111 v4_6_1
100 /// <summary>
101 /// .NET 4.5.1
102 /// </summary>
103 v4_5_1
104 } 112 }
105 /// <summary> 113 /// <summary>
106 /// The Node object representing /Prebuild/Solution/Project elements 114 /// The Node object representing /Prebuild/Solution/Project elements
107 /// </summary> 115 /// </summary>
108 [DataNode("Project")] 116 [DataNode("Project")]
109 public class ProjectNode : DataNode, IComparable 117 public class ProjectNode : DataNode, IComparable
110 { 118 {
111 #region Fields 119 #region Fields
112 120
113 private string m_Name = "unknown"; 121 private string m_Name = "unknown";
114 private string m_Path = ""; 122 private string m_Path = "";
115 private string m_FullPath = ""; 123 private string m_FullPath = "";
116 private string m_AssemblyName; 124 private string m_AssemblyName;
117 private string m_AppIcon = ""; 125 private string m_AppIcon = "";
126 private string m_ApplicationManifest = "";
118 private string m_ConfigFile = ""; 127 private string m_ConfigFile = "";
119 private string m_DesignerFolder = ""; 128 private string m_DesignerFolder = "";
120 private string m_Language = "C#"; 129 private string m_Language = "C#";
121 private ProjectType m_Type = ProjectType.Exe; 130 private ProjectType m_Type = ProjectType.Exe;
122 private ClrRuntime m_Runtime = ClrRuntime.Microsoft; 131 private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
123 private FrameworkVersion m_Framework = FrameworkVersion.v2_0; 132 private FrameworkVersion m_Framework = FrameworkVersion.v2_0;
124 private string m_StartupObject = ""; 133 private bool m_useFramework = true;
125 private string m_RootNamespace; 134 private string m_StartupObject = "";
126 private string m_FilterGroups = ""; 135 private string m_RootNamespace;
127 private string m_Version = ""; 136 private string m_FilterGroups = "";
128 private Guid m_Guid; 137 private string m_Version = "";
138 private Guid m_Guid;
129 private string m_DebugStartParameters; 139 private string m_DebugStartParameters;
130 140
131 private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>(); 141 private readonly Dictionary<string, ConfigurationNode> m_Configurations = new Dictionary<string, ConfigurationNode>();
132 private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>(); 142 private readonly List<ReferencePathNode> m_ReferencePaths = new List<ReferencePathNode>();
133 private readonly List<ReferenceNode> m_References = new List<ReferenceNode>(); 143 private readonly List<ReferenceNode> m_References = new List<ReferenceNode>();
134 private readonly List<AuthorNode> m_Authors = new List<AuthorNode>(); 144 private readonly List<AuthorNode> m_Authors = new List<AuthorNode>();
135 private FilesNode m_Files; 145 private FilesNode m_Files;
136 146
137 #endregion 147 #endregion
138 148
139 #region Properties 149 #region Properties
140 150
141 /// <summary> 151 /// <summary>
142 /// Gets the name. 152 /// Gets the name.
143 /// </summary> 153 /// </summary>
144 /// <value>The name.</value> 154 /// <value>The name.</value>
145 public string Name 155 public string Name
146 { 156 {
147 get 157 get
148 { 158 {
149 return m_Name; 159 return m_Name;
150 } 160 }
151 } 161 }
152 /// <summary> 162 /// <summary>
153 /// The version of the .NET Framework to compile under 163 /// The version of the .NET Framework to compile under
154 /// </summary> 164 /// </summary>
155 public FrameworkVersion FrameworkVersion 165 public FrameworkVersion FrameworkVersion
156 { 166 {
157 get 167 get
158 { 168 {
159 return m_Framework; 169 return m_Framework;
160 } 170 }
161 } 171 set
162 /// <summary>
163 /// Gets the path.
164 /// </summary>
165 /// <value>The path.</value>
166 public string Path
167 {
168 get
169 {
170 return m_Path;
171 }
172 }
173
174 /// <summary>
175 /// Gets the filter groups.
176 /// </summary>
177 /// <value>The filter groups.</value>
178 public string FilterGroups
179 {
180 get
181 {
182 return m_FilterGroups;
183 }
184 }
185
186 /// <summary>
187 /// Gets the project's version
188 /// </summary>
189 /// <value>The project's version.</value>
190 public string Version
191 {
192 get
193 {
194 return m_Version;
195 }
196 }
197
198 /// <summary>
199 /// Gets the full path.
200 /// </summary>
201 /// <value>The full path.</value>
202 public string FullPath
203 {
204 get
205 {
206 return m_FullPath;
207 }
208 }
209
210 /// <summary>
211 /// Gets the name of the assembly.
212 /// </summary>
213 /// <value>The name of the assembly.</value>
214 public string AssemblyName
215 {
216 get
217 { 172 {
218 return m_AssemblyName; 173 m_Framework = value;
219 } 174 m_useFramework = false;
220 } 175 }
176 }
177 /// <summary>
178 /// Gets the path.
179 /// </summary>
180 /// <value>The path.</value>
181 public string Path
182 {
183 get
184 {
185 return m_Path;
186 }
187 }
188
189 /// <summary>
190 /// Gets the filter groups.
191 /// </summary>
192 /// <value>The filter groups.</value>
193 public string FilterGroups
194 {
195 get
196 {
197 return m_FilterGroups;
198 }
199 }
200
201 /// <summary>
202 /// Gets the project's version
203 /// </summary>
204 /// <value>The project's version.</value>
205 public string Version
206 {
207 get
208 {
209 return m_Version;
210 }
211 }
212
213 /// <summary>
214 /// Gets the full path.
215 /// </summary>
216 /// <value>The full path.</value>
217 public string FullPath
218 {
219 get
220 {
221 return m_FullPath;
222 }
223 }
224
225 /// <summary>
226 /// Gets the name of the assembly.
227 /// </summary>
228 /// <value>The name of the assembly.</value>
229 public string AssemblyName
230 {
231 get
232 {
233 return m_AssemblyName;
234 }
235 }
221 236
222 /// <summary> 237 /// <summary>
223 /// Gets the app icon. 238 /// Gets the app icon.
@@ -232,347 +247,362 @@ namespace Prebuild.Core.Nodes
232 } 247 }
233 248
234 /// <summary> 249 /// <summary>
235 /// Gets the app icon. 250 /// Gets the Application Manifest.
236 /// </summary>
237 /// <value>The app icon.</value>
238 public string ConfigFile
239 {
240 get
241 {
242 return m_ConfigFile;
243 }
244 }
245
246 /// <summary>
247 ///
248 /// </summary>
249 public string DesignerFolder
250 {
251 get
252 {
253 return m_DesignerFolder;
254 }
255 }
256
257 /// <summary>
258 /// Gets the language.
259 /// </summary>
260 /// <value>The language.</value>
261 public string Language
262 {
263 get
264 {
265 return m_Language;
266 }
267 }
268
269 /// <summary>
270 /// Gets the type.
271 /// </summary>
272 /// <value>The type.</value>
273 public ProjectType Type
274 {
275 get
276 {
277 return m_Type;
278 }
279 }
280
281 /// <summary>
282 /// Gets the runtime.
283 /// </summary>
284 /// <value>The runtime.</value>
285 public ClrRuntime Runtime
286 {
287 get
288 {
289 return m_Runtime;
290 }
291 }
292
293 private bool m_GenerateAssemblyInfoFile;
294
295 /// <summary>
296 ///
297 /// </summary>
298 public bool GenerateAssemblyInfoFile
299 {
300 get
301 {
302 return m_GenerateAssemblyInfoFile;
303 }
304 set
305 {
306 m_GenerateAssemblyInfoFile = value;
307 }
308 }
309
310 /// <summary>
311 /// Gets the startup object.
312 /// </summary> 251 /// </summary>
313 /// <value>The startup object.</value> 252 /// <value>The Application Manifest.</value>
314 public string StartupObject 253 public string ApplicationManifest
315 { 254 {
316 get 255 get
317 { 256 {
318 return m_StartupObject; 257 return m_ApplicationManifest;
319 } 258 }
320 } 259 }
321 260
322 /// <summary> 261 /// <summary>
323 /// Gets the root namespace. 262 /// Gets the app icon.
324 /// </summary> 263 /// </summary>
325 /// <value>The root namespace.</value> 264 /// <value>The app icon.</value>
326 public string RootNamespace 265 public string ConfigFile
327 { 266 {
328 get 267 get
329 { 268 {
330 return m_RootNamespace; 269 return m_ConfigFile;
331 } 270 }
332 } 271 }
333 272
334 /// <summary> 273 /// <summary>
335 /// Gets the configurations. 274 ///
336 /// </summary> 275 /// </summary>
337 /// <value>The configurations.</value> 276 public string DesignerFolder
277 {
278 get
279 {
280 return m_DesignerFolder;
281 }
282 }
283
284 /// <summary>
285 /// Gets the language.
286 /// </summary>
287 /// <value>The language.</value>
288 public string Language
289 {
290 get
291 {
292 return m_Language;
293 }
294 }
295
296 /// <summary>
297 /// Gets the type.
298 /// </summary>
299 /// <value>The type.</value>
300 public ProjectType Type
301 {
302 get
303 {
304 return m_Type;
305 }
306 }
307
308 /// <summary>
309 /// Gets the runtime.
310 /// </summary>
311 /// <value>The runtime.</value>
312 public ClrRuntime Runtime
313 {
314 get
315 {
316 return m_Runtime;
317 }
318 }
319
320 private bool m_GenerateAssemblyInfoFile;
321
322 /// <summary>
323 ///
324 /// </summary>
325 public bool GenerateAssemblyInfoFile
326 {
327 get
328 {
329 return m_GenerateAssemblyInfoFile;
330 }
331 set
332 {
333 m_GenerateAssemblyInfoFile = value;
334 }
335 }
336
337 /// <summary>
338 /// Gets the startup object.
339 /// </summary>
340 /// <value>The startup object.</value>
341 public string StartupObject
342 {
343 get
344 {
345 return m_StartupObject;
346 }
347 }
348
349 /// <summary>
350 /// Gets the root namespace.
351 /// </summary>
352 /// <value>The root namespace.</value>
353 public string RootNamespace
354 {
355 get
356 {
357 return m_RootNamespace;
358 }
359 }
360
361 /// <summary>
362 /// Gets the configurations.
363 /// </summary>
364 /// <value>The configurations.</value>
338 public List<ConfigurationNode> Configurations 365 public List<ConfigurationNode> Configurations
339 { 366 {
340 get 367 get
341 { 368 {
342 List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values); 369 List<ConfigurationNode> tmp = new List<ConfigurationNode>(ConfigurationsTable.Values);
343 tmp.Sort(); 370 tmp.Sort();
344 return tmp; 371 return tmp;
345 } 372 }
346 } 373 }
347 374
348 /// <summary> 375 /// <summary>
349 /// Gets the configurations table. 376 /// Gets the configurations table.
350 /// </summary> 377 /// </summary>
351 /// <value>The configurations table.</value> 378 /// <value>The configurations table.</value>
352 public Dictionary<string, ConfigurationNode> ConfigurationsTable 379 public Dictionary<string, ConfigurationNode> ConfigurationsTable
353 { 380 {
354 get 381 get
355 { 382 {
356 return m_Configurations; 383 return m_Configurations;
357 } 384 }
358 } 385 }
359 386
360 /// <summary> 387 /// <summary>
361 /// Gets the reference paths. 388 /// Gets the reference paths.
362 /// </summary> 389 /// </summary>
363 /// <value>The reference paths.</value> 390 /// <value>The reference paths.</value>
364 public List<ReferencePathNode> ReferencePaths 391 public List<ReferencePathNode> ReferencePaths
365 { 392 {
366 get 393 get
367 { 394 {
368 List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths); 395 List<ReferencePathNode> tmp = new List<ReferencePathNode>(m_ReferencePaths);
369 tmp.Sort(); 396 tmp.Sort();
370 return tmp; 397 return tmp;
371 } 398 }
372 } 399 }
373 400
374 /// <summary> 401 /// <summary>
375 /// Gets the references. 402 /// Gets the references.
376 /// </summary> 403 /// </summary>
377 /// <value>The references.</value> 404 /// <value>The references.</value>
378 public List<ReferenceNode> References 405 public List<ReferenceNode> References
379 { 406 {
380 get 407 get
381 { 408 {
382 List<ReferenceNode> tmp = new List<ReferenceNode>(m_References); 409 List<ReferenceNode> tmp = new List<ReferenceNode>(m_References);
383 tmp.Sort(); 410 tmp.Sort();
384 return tmp; 411 return tmp;
385 } 412 }
386 } 413 }
387 414
388 /// <summary> 415 /// <summary>
389 /// Gets the Authors list. 416 /// Gets the Authors list.
390 /// </summary> 417 /// </summary>
391 /// <value>The list of the project's authors.</value> 418 /// <value>The list of the project's authors.</value>
392 public List<AuthorNode> Authors 419 public List<AuthorNode> Authors
393 { 420 {
394 get 421 get
395 { 422 {
396 return m_Authors; 423 return m_Authors;
397 } 424 }
398 } 425 }
399 426
400 /// <summary> 427 /// <summary>
401 /// Gets the files. 428 /// Gets the files.
402 /// </summary> 429 /// </summary>
403 /// <value>The files.</value> 430 /// <value>The files.</value>
404 public FilesNode Files 431 public FilesNode Files
405 { 432 {
406 get 433 get
407 { 434 {
408 return m_Files; 435 return m_Files;
409 } 436 }
410 } 437 }
411 438
412 /// <summary> 439 /// <summary>
413 /// Gets or sets the parent. 440 /// Gets or sets the parent.
414 /// </summary> 441 /// </summary>
415 /// <value>The parent.</value> 442 /// <value>The parent.</value>
416 public override IDataNode Parent 443 public override IDataNode Parent
417 { 444 {
418 get 445 get
419 { 446 {
420 return base.Parent; 447 return base.Parent;
421 } 448 }
422 set 449 set
423 { 450 {
424 base.Parent = value; 451 base.Parent = value;
425 if(base.Parent is SolutionNode && m_Configurations.Count < 1) 452 if(base.Parent is SolutionNode && m_Configurations.Count < 1)
426 { 453 {
427 SolutionNode parent = (SolutionNode)base.Parent; 454 SolutionNode parent = (SolutionNode)base.Parent;
428 foreach(ConfigurationNode conf in parent.Configurations) 455 foreach(ConfigurationNode conf in parent.Configurations)
429 { 456 {
430 m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); 457 m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone();
431 } 458 }
432 } 459 }
433 } 460 }
434 } 461 }
435 462
436 /// <summary> 463 /// <summary>
437 /// Gets the GUID. 464 /// Gets the GUID.
438 /// </summary> 465 /// </summary>
439 /// <value>The GUID.</value> 466 /// <value>The GUID.</value>
440 public Guid Guid 467 public Guid Guid
441 { 468 {
442 get 469 get
443 { 470 {
444 return m_Guid; 471 return m_Guid;
445 } 472 }
446 } 473 }
447 474
448 public string DebugStartParameters 475 public string DebugStartParameters
449 { 476 {
450 get 477 get
451 { 478 {
452 return m_DebugStartParameters; 479 return m_DebugStartParameters;
453 } 480 }
454 } 481 }
455 482
456 #endregion 483 #endregion
457 484
458 #region Private Methods 485 #region Private Methods
459 486
460 private void HandleConfiguration(ConfigurationNode conf) 487 private void HandleConfiguration(ConfigurationNode conf)
461 { 488 {
462 if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, 489 if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first,
463 //so it *may* override changes to the same properties for configurations defines at the project level 490 //so it *may* override changes to the same properties for configurations defines at the project level
464 { 491 {
465 foreach(ConfigurationNode confNode in m_Configurations.Values) 492 foreach(ConfigurationNode confNode in m_Configurations.Values)
466 { 493 {
467 conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides 494 conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides
468 } 495 }
469 } 496 }
470 if(m_Configurations.ContainsKey(conf.NameAndPlatform)) 497 if(m_Configurations.ContainsKey(conf.NameAndPlatform))
471 { 498 {
472 ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; 499 ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform];
473 conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides 500 conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides
474 } 501 }
475 else 502 else
476 { 503 {
477 m_Configurations[conf.NameAndPlatform] = conf; 504 m_Configurations[conf.NameAndPlatform] = conf;
478 } 505 }
479 } 506 }
480 507
481 #endregion 508 #endregion
482 509
483 #region Public Methods 510 #region Public Methods
484 511
485 /// <summary> 512 /// <summary>
486 /// Parses the specified node. 513 /// Parses the specified node.
487 /// </summary> 514 /// </summary>
488 /// <param name="node">The node.</param> 515 /// <param name="node">The node.</param>
489 public override void Parse(XmlNode node) 516 public override void Parse(XmlNode node)
490 { 517 {
491 m_Name = Helper.AttributeValue(node, "name", m_Name); 518 m_Name = Helper.AttributeValue(node, "name", m_Name);
492 m_Path = Helper.AttributeValue(node, "path", m_Path); 519 m_Path = Helper.AttributeValue(node, "path", m_Path);
493 m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); 520 m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups);
494 m_Version = Helper.AttributeValue(node, "version", m_Version); 521 m_Version = Helper.AttributeValue(node, "version", m_Version);
495 m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); 522 m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon);
523 m_ApplicationManifest = Helper.AttributeValue(node, "appmanifest", m_ApplicationManifest);
496 m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); 524 m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile);
497 m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); 525 m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder);
498 m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 526 m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName);
499 m_Language = Helper.AttributeValue(node, "language", m_Language); 527 m_Language = Helper.AttributeValue(node, "language", m_Language);
500 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); 528 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
501 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); 529 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
502 m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); 530 if(m_useFramework)
531 m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework);
532
503 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); 533 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
504 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); 534 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
505 535
506 int hash = m_Name.GetHashCode(); 536 int hash = m_Name.GetHashCode();
507 Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 537 Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
508 string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); 538 string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString());
509 m_Guid = new Guid(guid); 539 m_Guid = new Guid(guid);
510 540
511 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); 541 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
512 m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); 542 m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty);
513 543
514 if(string.IsNullOrEmpty(m_AssemblyName)) 544 if(string.IsNullOrEmpty(m_AssemblyName))
515 { 545 {
516 m_AssemblyName = m_Name; 546 m_AssemblyName = m_Name;
517 } 547 }
518 548
519 if(string.IsNullOrEmpty(m_RootNamespace)) 549 if(string.IsNullOrEmpty(m_RootNamespace))
520 { 550 {
521 m_RootNamespace = m_Name; 551 m_RootNamespace = m_Name;
522 } 552 }
523 553
524 m_FullPath = m_Path; 554 m_FullPath = m_Path;
525 try 555 try
526 { 556 {
527 m_FullPath = Helper.ResolvePath(m_FullPath); 557 m_FullPath = Helper.ResolvePath(m_FullPath);
528 } 558 }
529 catch 559 catch
530 { 560 {
531 throw new WarningException("Could not resolve Solution path: {0}", m_Path); 561 throw new WarningException("Could not resolve Solution path: {0}", m_Path);
532 } 562 }
533 563
534 Kernel.Instance.CurrentWorkingDirectory.Push(); 564 Kernel.Instance.CurrentWorkingDirectory.Push();
535 try 565 try
536 { 566 {
537 Helper.SetCurrentDir(m_FullPath); 567 Helper.SetCurrentDir(m_FullPath);
538 568
539 if( node == null ) 569 if( node == null )
540 { 570 {
541 throw new ArgumentNullException("node"); 571 throw new ArgumentNullException("node");
542 } 572 }
543 573
544 foreach(XmlNode child in node.ChildNodes) 574 foreach(XmlNode child in node.ChildNodes)
545 { 575 {
546 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 576 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
547 if(dataNode is ConfigurationNode) 577 if(dataNode is ConfigurationNode)
548 { 578 {
549 HandleConfiguration((ConfigurationNode)dataNode); 579 HandleConfiguration((ConfigurationNode)dataNode);
550 } 580 }
551 else if(dataNode is ReferencePathNode) 581 else if(dataNode is ReferencePathNode)
552 { 582 {
553 m_ReferencePaths.Add((ReferencePathNode)dataNode); 583 m_ReferencePaths.Add((ReferencePathNode)dataNode);
554 } 584 }
555 else if(dataNode is ReferenceNode) 585 else if(dataNode is ReferenceNode)
556 { 586 {
557 m_References.Add((ReferenceNode)dataNode); 587 m_References.Add((ReferenceNode)dataNode);
558 } 588 }
559 else if(dataNode is AuthorNode) 589 else if(dataNode is AuthorNode)
560 { 590 {
561 m_Authors.Add((AuthorNode)dataNode); 591 m_Authors.Add((AuthorNode)dataNode);
562 } 592 }
563 else if(dataNode is FilesNode) 593 else if(dataNode is FilesNode)
564 { 594 {
565 m_Files = (FilesNode)dataNode; 595 m_Files = (FilesNode)dataNode;
566 } 596 }
567 } 597 }
568 } 598 }
569 finally 599 finally
570 { 600 {
571 Kernel.Instance.CurrentWorkingDirectory.Pop(); 601 Kernel.Instance.CurrentWorkingDirectory.Pop();
572 } 602 }
573 } 603 }
574 604
575 #endregion 605 #endregion
576 606
577 #region IComparable Members 607 #region IComparable Members
578 608
@@ -582,6 +612,6 @@ namespace Prebuild.Core.Nodes
582 return m_Name.CompareTo(that.m_Name); 612 return m_Name.CompareTo(that.m_Name);
583 } 613 }
584 614
585 #endregion 615 #endregion
586 } 616 }
587} 617}
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs
index 9afb512..9c5d1a3 100644
--- a/Prebuild/src/Core/Nodes/ReferenceNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,104 +32,104 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("Reference")] 38 [DataNode("Reference")]
39 public class ReferenceNode : DataNode, IComparable 39 public class ReferenceNode : DataNode, IComparable
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Name = "unknown"; 43 private string m_Name = "unknown";
44 private string m_Path; 44 private string m_Path;
45 private string m_LocalCopy; 45 private string m_LocalCopy;
46 private string m_Version; 46 private string m_Version;
47 47
48 #endregion 48 #endregion
49 49
50 #region Properties 50 #region Properties
51 51
52 /// <summary> 52 /// <summary>
53 /// Gets the name. 53 /// Gets the name.
54 /// </summary> 54 /// </summary>
55 /// <value>The name.</value> 55 /// <value>The name.</value>
56 public string Name 56 public string Name
57 { 57 {
58 get 58 get
59 { 59 {
60 return m_Name; 60 return m_Name;
61 } 61 }
62 } 62 }
63 63
64 /// <summary> 64 /// <summary>
65 /// Gets the path. 65 /// Gets the path.
66 /// </summary> 66 /// </summary>
67 /// <value>The path.</value> 67 /// <value>The path.</value>
68 public string Path 68 public string Path
69 { 69 {
70 get 70 get
71 { 71 {
72 return m_Path; 72 return m_Path;
73 } 73 }
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Gets a value indicating whether [local copy specified]. 77 /// Gets a value indicating whether [local copy specified].
78 /// </summary> 78 /// </summary>
79 /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value> 79 /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value>
80 public bool LocalCopySpecified 80 public bool LocalCopySpecified
81 { 81 {
82 get 82 get
83 { 83 {
84 return ( m_LocalCopy != null && m_LocalCopy.Length == 0); 84 return ( m_LocalCopy != null && m_LocalCopy.Length == 0);
85 } 85 }
86 } 86 }
87 87
88 /// <summary> 88 /// <summary>
89 /// Gets a value indicating whether [local copy]. 89 /// Gets a value indicating whether [local copy].
90 /// </summary> 90 /// </summary>
91 /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value> 91 /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value>
92 public bool LocalCopy 92 public bool LocalCopy
93 { 93 {
94 get 94 get
95 { 95 {
96 if( m_LocalCopy == null) 96 if( m_LocalCopy == null)
97 { 97 {
98 return false; 98 return false;
99 } 99 }
100 return bool.Parse(m_LocalCopy); 100 return bool.Parse(m_LocalCopy);
101 } 101 }
102 } 102 }
103 103
104 /// <summary> 104 /// <summary>
105 /// Gets the version. 105 /// Gets the version.
106 /// </summary> 106 /// </summary>
107 /// <value>The version.</value> 107 /// <value>The version.</value>
108 public string Version 108 public string Version
109 { 109 {
110 get 110 get
111 { 111 {
112 return m_Version; 112 return m_Version;
113 } 113 }
114 } 114 }
115 115
116 #endregion 116 #endregion
117 117
118 #region Public Methods 118 #region Public Methods
119 119
120 /// <summary> 120 /// <summary>
121 /// Parses the specified node. 121 /// Parses the specified node.
122 /// </summary> 122 /// </summary>
123 /// <param name="node">The node.</param> 123 /// <param name="node">The node.</param>
124 public override void Parse(XmlNode node) 124 public override void Parse(XmlNode node)
125 { 125 {
126 m_Name = Helper.AttributeValue(node, "name", m_Name); 126 m_Name = Helper.AttributeValue(node, "name", m_Name);
127 m_Path = Helper.AttributeValue(node, "path", m_Path); 127 m_Path = Helper.AttributeValue(node, "path", m_Path);
128 m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy); 128 m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy);
129 m_Version = Helper.AttributeValue(node, "version", m_Version); 129 m_Version = Helper.AttributeValue(node, "version", m_Version);
130 } 130 }
131 131
132 #endregion 132 #endregion
133 133
134 #region IComparable Members 134 #region IComparable Members
135 135
@@ -140,5 +140,5 @@ namespace Prebuild.Core.Nodes
140 } 140 }
141 141
142 #endregion 142 #endregion
143 } 143 }
144} 144}
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
index 29c63c5..7331cd7 100644
--- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs
+++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -32,57 +32,57 @@ using Prebuild.Core.Utilities;
32 32
33namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 [DataNode("ReferencePath")] 38 [DataNode("ReferencePath")]
39 public class ReferencePathNode : DataNode, IComparable 39 public class ReferencePathNode : DataNode, IComparable
40 { 40 {
41 #region Fields 41 #region Fields
42 42
43 private string m_Path; 43 private string m_Path;
44 44
45 #endregion 45 #endregion
46 46
47 #region Properties 47 #region Properties
48 48
49 /// <summary> 49 /// <summary>
50 /// Gets the path. 50 /// Gets the path.
51 /// </summary> 51 /// </summary>
52 /// <value>The path.</value> 52 /// <value>The path.</value>
53 public string Path 53 public string Path
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_Path; 57 return m_Path;
58 } 58 }
59 } 59 }
60 60
61 #endregion 61 #endregion
62 62
63 #region Public Methods 63 #region Public Methods
64 64
65 /// <summary> 65 /// <summary>
66 /// Parses the specified node. 66 /// Parses the specified node.
67 /// </summary> 67 /// </summary>
68 /// <param name="node">The node.</param> 68 /// <param name="node">The node.</param>
69 public override void Parse(XmlNode node) 69 public override void Parse(XmlNode node)
70 { 70 {
71 if( node == null ) 71 if( node == null )
72 { 72 {
73 throw new ArgumentNullException("node"); 73 throw new ArgumentNullException("node");
74 } 74 }
75 75
76 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText); 76 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
77 if(m_Path == null) 77 if(m_Path == null)
78 { 78 {
79 m_Path = ""; 79 m_Path = "";
80 } 80 }
81 81
82 m_Path = m_Path.Trim(); 82 m_Path = m_Path.Trim();
83 } 83 }
84 84
85 #endregion 85 #endregion
86 86
87 #region IComparable Members 87 #region IComparable Members
88 88
@@ -93,5 +93,5 @@ namespace Prebuild.Core.Nodes
93 } 93 }
94 94
95 #endregion 95 #endregion
96 } 96 }
97} 97}
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs
index e1d5b3b..10c0223 100644
--- a/Prebuild/src/Core/Nodes/SolutionNode.cs
+++ b/Prebuild/src/Core/Nodes/SolutionNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,35 +34,35 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [DataNode("Solution")] 40 [DataNode("Solution")]
41 [DataNode("EmbeddedSolution")] 41 [DataNode("EmbeddedSolution")]
42 [DebuggerDisplay("{Name}")] 42 [DebuggerDisplay("{Name}")]
43 public class SolutionNode : DataNode 43 public class SolutionNode : DataNode
44 { 44 {
45 #region Fields 45 #region Fields
46 46
47 private Guid m_Guid = Guid.NewGuid(); 47 private Guid m_Guid = Guid.NewGuid();
48 private string m_Name = "unknown"; 48 private string m_Name = "unknown";
49 private string m_Path = ""; 49 private string m_Path = "";
50 private string m_FullPath = ""; 50 private string m_FullPath = "";
51 private string m_ActiveConfig; 51 private string m_ActiveConfig;
52 private string m_Version = "1.0.0"; 52 private string m_Version = "1.0.0";
53 53
54 private OptionsNode m_Options; 54 private OptionsNode m_Options;
55 private FilesNode m_Files; 55 private FilesNode m_Files;
56 private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); 56 private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection();
57 private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>(); 57 private readonly Dictionary<string, ProjectNode> m_Projects = new Dictionary<string, ProjectNode>();
58 private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>(); 58 private readonly Dictionary<string, DatabaseProjectNode> m_DatabaseProjects = new Dictionary<string, DatabaseProjectNode>();
59 private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>(); 59 private readonly List<ProjectNode> m_ProjectsOrder = new List<ProjectNode>();
60 private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>(); 60 private readonly Dictionary<string, SolutionNode> m_Solutions = new Dictionary<string, SolutionNode>();
61 private CleanupNode m_Cleanup; 61 private CleanupNode m_Cleanup;
62 62
63 #endregion 63 #endregion
64 64
65 #region Properties 65 #region Properties
66 public override IDataNode Parent 66 public override IDataNode Parent
67 { 67 {
68 get 68 get
@@ -84,142 +84,142 @@ namespace Prebuild.Core.Nodes
84 } 84 }
85 } 85 }
86 86
87 public CleanupNode Cleanup 87 public CleanupNode Cleanup
88 { 88 {
89 get 89 get
90 { 90 {
91 return m_Cleanup; 91 return m_Cleanup;
92 } 92 }
93 set 93 set
94 { 94 {
95 m_Cleanup = value; 95 m_Cleanup = value;
96 } 96 }
97 } 97 }
98 98
99 public Guid Guid 99 public Guid Guid
100 { 100 {
101 get 101 get
102 { 102 {
103 return m_Guid; 103 return m_Guid;
104 } 104 }
105 set 105 set
106 { 106 {
107 m_Guid = value; 107 m_Guid = value;
108 }
109 }
110 /// <summary>
111 /// Gets or sets the active config.
112 /// </summary>
113 /// <value>The active config.</value>
114 public string ActiveConfig
115 {
116 get
117 {
118 return m_ActiveConfig;
119 }
120 set
121 {
122 m_ActiveConfig = value;
123 }
124 }
125
126 /// <summary>
127 /// Gets the name.
128 /// </summary>
129 /// <value>The name.</value>
130 public string Name
131 {
132 get
133 {
134 return m_Name;
135 }
136 }
137
138 /// <summary>
139 /// Gets the path.
140 /// </summary>
141 /// <value>The path.</value>
142 public string Path
143 {
144 get
145 {
146 return m_Path;
147 }
148 }
149
150 /// <summary>
151 /// Gets the full path.
152 /// </summary>
153 /// <value>The full path.</value>
154 public string FullPath
155 {
156 get
157 {
158 return m_FullPath;
159 }
160 }
161
162 /// <summary>
163 /// Gets the version.
164 /// </summary>
165 /// <value>The version.</value>
166 public string Version
167 {
168 get
169 {
170 return m_Version;
171 }
172 }
173
174 /// <summary>
175 /// Gets the options.
176 /// </summary>
177 /// <value>The options.</value>
178 public OptionsNode Options
179 {
180 get
181 {
182 return m_Options;
183 }
184 }
185
186 /// <summary>
187 /// Gets the files.
188 /// </summary>
189 /// <value>The files.</value>
190 public FilesNode Files
191 {
192 get
193 {
194 return m_Files;
195 }
196 }
197
198 /// <summary>
199 /// Gets the configurations.
200 /// </summary>
201 /// <value>The configurations.</value>
202 public ConfigurationNodeCollection Configurations
203 {
204 get
205 {
206 ConfigurationNodeCollection tmp = new ConfigurationNodeCollection();
207 tmp.AddRange(ConfigurationsTable);
208 return tmp;
209 }
210 }
211
212 /// <summary>
213 /// Gets the configurations table.
214 /// </summary>
215 /// <value>The configurations table.</value>
216 public ConfigurationNodeCollection ConfigurationsTable
217 {
218 get
219 {
220 return m_Configurations;
221 } 108 }
222 } 109 }
110 /// <summary>
111 /// Gets or sets the active config.
112 /// </summary>
113 /// <value>The active config.</value>
114 public string ActiveConfig
115 {
116 get
117 {
118 return m_ActiveConfig;
119 }
120 set
121 {
122 m_ActiveConfig = value;
123 }
124 }
125
126 /// <summary>
127 /// Gets the name.
128 /// </summary>
129 /// <value>The name.</value>
130 public string Name
131 {
132 get
133 {
134 return m_Name;
135 }
136 }
137
138 /// <summary>
139 /// Gets the path.
140 /// </summary>
141 /// <value>The path.</value>
142 public string Path
143 {
144 get
145 {
146 return m_Path;
147 }
148 }
149
150 /// <summary>
151 /// Gets the full path.
152 /// </summary>
153 /// <value>The full path.</value>
154 public string FullPath
155 {
156 get
157 {
158 return m_FullPath;
159 }
160 }
161
162 /// <summary>
163 /// Gets the version.
164 /// </summary>
165 /// <value>The version.</value>
166 public string Version
167 {
168 get
169 {
170 return m_Version;
171 }
172 }
173
174 /// <summary>
175 /// Gets the options.
176 /// </summary>
177 /// <value>The options.</value>
178 public OptionsNode Options
179 {
180 get
181 {
182 return m_Options;
183 }
184 }
185
186 /// <summary>
187 /// Gets the files.
188 /// </summary>
189 /// <value>The files.</value>
190 public FilesNode Files
191 {
192 get
193 {
194 return m_Files;
195 }
196 }
197
198 /// <summary>
199 /// Gets the configurations.
200 /// </summary>
201 /// <value>The configurations.</value>
202 public ConfigurationNodeCollection Configurations
203 {
204 get
205 {
206 ConfigurationNodeCollection tmp = new ConfigurationNodeCollection();
207 tmp.AddRange(ConfigurationsTable);
208 return tmp;
209 }
210 }
211
212 /// <summary>
213 /// Gets the configurations table.
214 /// </summary>
215 /// <value>The configurations table.</value>
216 public ConfigurationNodeCollection ConfigurationsTable
217 {
218 get
219 {
220 return m_Configurations;
221 }
222 }
223 /// <summary> 223 /// <summary>
224 /// Gets the database projects. 224 /// Gets the database projects.
225 /// </summary> 225 /// </summary>
@@ -250,106 +250,106 @@ namespace Prebuild.Core.Nodes
250 return m_Solutions; 250 return m_Solutions;
251 } 251 }
252 } 252 }
253 /// <summary> 253 /// <summary>
254 /// Gets the projects. 254 /// Gets the projects.
255 /// </summary> 255 /// </summary>
256 /// <value>The projects.</value> 256 /// <value>The projects.</value>
257 public ICollection<ProjectNode> Projects 257 public ICollection<ProjectNode> Projects
258 { 258 {
259 get 259 get
260 { 260 {
261 List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values); 261 List<ProjectNode> tmp = new List<ProjectNode>(m_Projects.Values);
262 tmp.Sort(); 262 tmp.Sort();
263 return tmp; 263 return tmp;
264 } 264 }
265 } 265 }
266 266
267 /// <summary> 267 /// <summary>
268 /// Gets the projects table. 268 /// Gets the projects table.
269 /// </summary> 269 /// </summary>
270 /// <value>The projects table.</value> 270 /// <value>The projects table.</value>
271 public Dictionary<string, ProjectNode> ProjectsTable 271 public Dictionary<string, ProjectNode> ProjectsTable
272 { 272 {
273 get 273 get
274 { 274 {
275 return m_Projects; 275 return m_Projects;
276 } 276 }
277 } 277 }
278 278
279 /// <summary> 279 /// <summary>
280 /// Gets the projects table. 280 /// Gets the projects table.
281 /// </summary> 281 /// </summary>
282 /// <value>The projects table.</value> 282 /// <value>The projects table.</value>
283 public List<ProjectNode> ProjectsTableOrder 283 public List<ProjectNode> ProjectsTableOrder
284 { 284 {
285 get 285 get
286 { 286 {
287 return m_ProjectsOrder; 287 return m_ProjectsOrder;
288 } 288 }
289 } 289 }
290 290
291 #endregion 291 #endregion
292 292
293 #region Public Methods 293 #region Public Methods
294 294
295 /// <summary> 295 /// <summary>
296 /// Parses the specified node. 296 /// Parses the specified node.
297 /// </summary> 297 /// </summary>
298 /// <param name="node">The node.</param> 298 /// <param name="node">The node.</param>
299 public override void Parse(XmlNode node) 299 public override void Parse(XmlNode node)
300 { 300 {
301 m_Name = Helper.AttributeValue(node, "name", m_Name); 301 m_Name = Helper.AttributeValue(node, "name", m_Name);
302 m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig); 302 m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
303 m_Path = Helper.AttributeValue(node, "path", m_Path); 303 m_Path = Helper.AttributeValue(node, "path", m_Path);
304 m_Version = Helper.AttributeValue(node, "version", m_Version); 304 m_Version = Helper.AttributeValue(node, "version", m_Version);
305 305
306 m_FullPath = m_Path; 306 m_FullPath = m_Path;
307 try 307 try
308 { 308 {
309 m_FullPath = Helper.ResolvePath(m_FullPath); 309 m_FullPath = Helper.ResolvePath(m_FullPath);
310 } 310 }
311 catch 311 catch
312 { 312 {
313 throw new WarningException("Could not resolve solution path: {0}", m_Path); 313 throw new WarningException("Could not resolve solution path: {0}", m_Path);
314 } 314 }
315 315
316 Kernel.Instance.CurrentWorkingDirectory.Push(); 316 Kernel.Instance.CurrentWorkingDirectory.Push();
317 try 317 try
318 { 318 {
319 Helper.SetCurrentDir(m_FullPath); 319 Helper.SetCurrentDir(m_FullPath);
320 320
321 if( node == null ) 321 if( node == null )
322 { 322 {
323 throw new ArgumentNullException("node"); 323 throw new ArgumentNullException("node");
324 } 324 }
325 325
326 foreach(XmlNode child in node.ChildNodes) 326 foreach(XmlNode child in node.ChildNodes)
327 { 327 {
328 IDataNode dataNode = Kernel.Instance.ParseNode(child, this); 328 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
329 if(dataNode is OptionsNode) 329 if(dataNode is OptionsNode)
330 { 330 {
331 m_Options = (OptionsNode)dataNode; 331 m_Options = (OptionsNode)dataNode;
332 } 332 }
333 else if(dataNode is FilesNode) 333 else if(dataNode is FilesNode)
334 { 334 {
335 m_Files = (FilesNode)dataNode; 335 m_Files = (FilesNode)dataNode;
336 } 336 }
337 else if(dataNode is ConfigurationNode) 337 else if(dataNode is ConfigurationNode)
338 { 338 {
339 ConfigurationNode configurationNode = (ConfigurationNode) dataNode; 339 ConfigurationNode configurationNode = (ConfigurationNode) dataNode;
340 m_Configurations[configurationNode.NameAndPlatform] = configurationNode; 340 m_Configurations[configurationNode.NameAndPlatform] = configurationNode;
341 341
342 // If the active configuration is null, then we populate it. 342 // If the active configuration is null, then we populate it.
343 if (ActiveConfig == null) 343 if (ActiveConfig == null)
344 { 344 {
345 ActiveConfig = configurationNode.Name; 345 ActiveConfig = configurationNode.Name;
346 } 346 }
347 } 347 }
348 else if(dataNode is ProjectNode) 348 else if(dataNode is ProjectNode)
349 { 349 {
350 m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; 350 m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode;
351 m_ProjectsOrder.Add((ProjectNode)dataNode); 351 m_ProjectsOrder.Add((ProjectNode)dataNode);
352 } 352 }
353 else if(dataNode is SolutionNode) 353 else if(dataNode is SolutionNode)
354 { 354 {
355 m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; 355 m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode;
@@ -369,14 +369,14 @@ namespace Prebuild.Core.Nodes
369 throw new WarningException("There can only be one Cleanup node."); 369 throw new WarningException("There can only be one Cleanup node.");
370 m_Cleanup = (CleanupNode)dataNode; 370 m_Cleanup = (CleanupNode)dataNode;
371 } 371 }
372 } 372 }
373 } 373 }
374 finally 374 finally
375 { 375 {
376 Kernel.Instance.CurrentWorkingDirectory.Pop(); 376 Kernel.Instance.CurrentWorkingDirectory.Pop();
377 } 377 }
378 } 378 }
379 379
380 #endregion 380 #endregion
381 } 381 }
382} 382}
diff --git a/Prebuild/src/Core/Parse/IfContext.cs b/Prebuild/src/Core/Parse/IfContext.cs
index 7729d3b..3c79d38 100644
--- a/Prebuild/src/Core/Parse/IfContext.cs
+++ b/Prebuild/src/Core/Parse/IfContext.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -27,128 +27,128 @@ using System;
27 27
28namespace Prebuild.Core.Parse 28namespace Prebuild.Core.Parse
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// 31 ///
32 /// </summary> 32 /// </summary>
33 public enum IfState 33 public enum IfState
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// 36 ///
37 /// </summary> 37 /// </summary>
38 None, 38 None,
39 /// <summary> 39 /// <summary>
40 /// 40 ///
41 /// </summary> 41 /// </summary>
42 If, 42 If,
43 /// <summary> 43 /// <summary>
44 /// 44 ///
45 /// </summary> 45 /// </summary>
46 ElseIf, 46 ElseIf,
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 Else 50 Else
51 } 51 }
52 52
53 /// <summary> 53 /// <summary>
54 /// Summary description for IfContext. 54 /// Summary description for IfContext.
55 /// </summary> 55 /// </summary>
56 // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/) 56 // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/)
57 public class IfContext 57 public class IfContext
58 { 58 {
59 #region Properties 59 #region Properties
60 60
61 bool m_Active; 61 bool m_Active;
62 bool m_Keep; 62 bool m_Keep;
63 bool m_EverKept; 63 bool m_EverKept;
64 IfState m_State = IfState.None; 64 IfState m_State = IfState.None;
65 65
66 #endregion 66 #endregion
67 67
68 #region Constructors 68 #region Constructors
69 69
70 /// <summary> 70 /// <summary>
71 /// Initializes a new instance of the <see cref="IfContext"/> class. 71 /// Initializes a new instance of the <see cref="IfContext"/> class.
72 /// </summary> 72 /// </summary>
73 /// <param name="active">if set to <c>true</c> [active].</param> 73 /// <param name="active">if set to <c>true</c> [active].</param>
74 /// <param name="keep">if set to <c>true</c> [keep].</param> 74 /// <param name="keep">if set to <c>true</c> [keep].</param>
75 /// <param name="state">The state.</param> 75 /// <param name="state">The state.</param>
76 public IfContext(bool active, bool keep, IfState state) 76 public IfContext(bool active, bool keep, IfState state)
77 { 77 {
78 m_Active = active; 78 m_Active = active;
79 m_Keep = keep; 79 m_Keep = keep;
80 m_EverKept = keep; 80 m_EverKept = keep;
81 m_State = state; 81 m_State = state;
82 } 82 }
83 83
84 #endregion 84 #endregion
85 85
86 #region Properties 86 #region Properties
87 87
88 /// <summary> 88 /// <summary>
89 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active. 89 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active.
90 /// </summary> 90 /// </summary>
91 /// <value><c>true</c> if active; otherwise, <c>false</c>.</value> 91 /// <value><c>true</c> if active; otherwise, <c>false</c>.</value>
92 public bool Active 92 public bool Active
93 { 93 {
94 get 94 get
95 { 95 {
96 return m_Active; 96 return m_Active;
97 } 97 }
98 set 98 set
99 { 99 {
100 m_Active = value; 100 m_Active = value;
101 } 101 }
102 } 102 }
103 103
104 /// <summary> 104 /// <summary>
105 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep. 105 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep.
106 /// </summary> 106 /// </summary>
107 /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value> 107 /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value>
108 public bool Keep 108 public bool Keep
109 { 109 {
110 get 110 get
111 { 111 {
112 return m_Keep; 112 return m_Keep;
113 } 113 }
114 set 114 set
115 { 115 {
116 m_Keep = value; 116 m_Keep = value;
117 if(m_Keep) 117 if(m_Keep)
118 { 118 {
119 m_EverKept = true; 119 m_EverKept = true;
120 } 120 }
121 } 121 }
122 } 122 }
123 123
124 /// <summary> 124 /// <summary>
125 /// Gets a value indicating whether [ever kept]. 125 /// Gets a value indicating whether [ever kept].
126 /// </summary> 126 /// </summary>
127 /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value> 127 /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value>
128 public bool EverKept 128 public bool EverKept
129 { 129 {
130 get 130 get
131 { 131 {
132 return m_EverKept; 132 return m_EverKept;
133 } 133 }
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// Gets or sets the state. 137 /// Gets or sets the state.
138 /// </summary> 138 /// </summary>
139 /// <value>The state.</value> 139 /// <value>The state.</value>
140 public IfState State 140 public IfState State
141 { 141 {
142 get 142 get
143 { 143 {
144 return m_State; 144 return m_State;
145 } 145 }
146 set 146 set
147 { 147 {
148 m_State = value; 148 m_State = value;
149 } 149 }
150 } 150 }
151 151
152 #endregion 152 #endregion
153 } 153 }
154} 154}
diff --git a/Prebuild/src/Core/Parse/Preprocessor.cs b/Prebuild/src/Core/Parse/Preprocessor.cs
index 0cd6e82..0648fad 100644
--- a/Prebuild/src/Core/Parse/Preprocessor.cs
+++ b/Prebuild/src/Core/Parse/Preprocessor.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -31,336 +31,336 @@ using System.Xml;
31 31
32namespace Prebuild.Core.Parse 32namespace Prebuild.Core.Parse
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// 35 ///
36 /// </summary> 36 /// </summary>
37 public enum OperatorSymbol 37 public enum OperatorSymbol
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// 40 ///
41 /// </summary> 41 /// </summary>
42 None, 42 None,
43 /// <summary> 43 /// <summary>
44 /// 44 ///
45 /// </summary> 45 /// </summary>
46 Equal, 46 Equal,
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 NotEqual, 50 NotEqual,
51 /// <summary> 51 /// <summary>
52 /// 52 ///
53 /// </summary> 53 /// </summary>
54 LessThan, 54 LessThan,
55 /// <summary> 55 /// <summary>
56 /// 56 ///
57 /// </summary> 57 /// </summary>
58 GreaterThan, 58 GreaterThan,
59 /// <summary> 59 /// <summary>
60 /// 60 ///
61 /// </summary> 61 /// </summary>
62 LessThanEqual, 62 LessThanEqual,
63 /// <summary> 63 /// <summary>
64 /// 64 ///
65 /// </summary> 65 /// </summary>
66 GreaterThanEqual 66 GreaterThanEqual
67 } 67 }
68 68
69 /// <summary> 69 /// <summary>
70 /// 70 ///
71 /// </summary> 71 /// </summary>
72 public class Preprocessor 72 public class Preprocessor
73 { 73 {
74 #region Constants 74 #region Constants
75 75
76 /// <summary> 76 /// <summary>
77 /// Includes the regex to look for file tags in the <?include 77 /// Includes the regex to look for file tags in the <?include
78 /// ?> processing instruction. 78 /// ?> processing instruction.
79 /// </summary> 79 /// </summary>
80 private static readonly Regex includeFileRegex = new Regex("file=\"(.+?)\""); 80 private static readonly Regex includeFileRegex = new Regex("file=\"(.+?)\"");
81 81
82 #endregion 82 #endregion
83 83
84 #region Fields 84 #region Fields
85 85
86 readonly XmlDocument m_OutDoc = new XmlDocument(); 86 readonly XmlDocument m_OutDoc = new XmlDocument();
87 readonly Stack<IfContext> m_IfStack = new Stack<IfContext>(); 87 readonly Stack<IfContext> m_IfStack = new Stack<IfContext>();
88 readonly Dictionary<string, object> m_Variables = new Dictionary<string, object>(); 88 readonly Dictionary<string, object> m_Variables = new Dictionary<string, object>();
89 89
90 #endregion 90 #endregion
91 91
92 #region Constructors 92 #region Constructors
93 93
94 /// <summary> 94 /// <summary>
95 /// Initializes a new instance of the <see cref="Preprocessor"/> class. 95 /// Initializes a new instance of the <see cref="Preprocessor"/> class.
96 /// </summary> 96 /// </summary>
97 public Preprocessor() 97 public Preprocessor()
98 { 98 {
99 RegisterVariable("OS", GetOS()); 99 RegisterVariable("OS", GetOS());
100 RegisterVariable("RuntimeVersion", Environment.Version.Major); 100 RegisterVariable("RuntimeVersion", Environment.Version.Major);
101 RegisterVariable("RuntimeMajor", Environment.Version.Major); 101 RegisterVariable("RuntimeMajor", Environment.Version.Major);
102 RegisterVariable("RuntimeMinor", Environment.Version.Minor); 102 RegisterVariable("RuntimeMinor", Environment.Version.Minor);
103 RegisterVariable("RuntimeRevision", Environment.Version.Revision); 103 RegisterVariable("RuntimeRevision", Environment.Version.Revision);
104 } 104 }
105 105
106 #endregion 106 #endregion
107 107
108 #region Properties 108 #region Properties
109 109
110 /// <summary> 110 /// <summary>
111 /// Gets the processed doc. 111 /// Gets the processed doc.
112 /// </summary> 112 /// </summary>
113 /// <value>The processed doc.</value> 113 /// <value>The processed doc.</value>
114 public XmlDocument ProcessedDoc 114 public XmlDocument ProcessedDoc
115 { 115 {
116 get 116 get
117 { 117 {
118 return m_OutDoc; 118 return m_OutDoc;
119 } 119 }
120 } 120 }
121 121
122 #endregion 122 #endregion
123 123
124 #region Private Methods 124 #region Private Methods
125 125
126 /// <summary> 126 /// <summary>
127 /// Parts of this code were taken from NAnt and is subject to the GPL 127 /// Parts of this code were taken from NAnt and is subject to the GPL
128 /// as per NAnt's license. Thanks to the NAnt guys for this little gem. 128 /// as per NAnt's license. Thanks to the NAnt guys for this little gem.
129 /// </summary> 129 /// </summary>
130 /// <returns></returns> 130 /// <returns></returns>
131 public static string GetOS() 131 public static string GetOS()
132 { 132 {
133 PlatformID platId = Environment.OSVersion.Platform; 133 PlatformID platId = Environment.OSVersion.Platform;
134 if(platId == PlatformID.Win32NT || platId == PlatformID.Win32Windows) 134 if(platId == PlatformID.Win32NT || platId == PlatformID.Win32Windows)
135 { 135 {
136 return "Win32"; 136 return "Win32";
137 } 137 }
138 138
139 if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa")) 139 if (File.Exists("/System/Library/Frameworks/Cocoa.framework/Cocoa"))
140 { 140 {
141 return "MACOSX"; 141 return "MACOSX";
142 } 142 }
143 143
144 /* 144 /*
145 * .NET 1.x, under Mono, the UNIX code is 128. Under 145 * .NET 1.x, under Mono, the UNIX code is 128. Under
146 * .NET 2.x, Mono or MS, the UNIX code is 4 146 * .NET 2.x, Mono or MS, the UNIX code is 4
147 */ 147 */
148 if(Environment.Version.Major == 1) 148 if(Environment.Version.Major == 1)
149 { 149 {
150 if((int)platId == 128) 150 if((int)platId == 128)
151 { 151 {
152 return "UNIX"; 152 return "UNIX";
153 } 153 }
154 } 154 }
155 else if((int)platId == 4) 155 else if((int)platId == 4)
156 { 156 {
157 return "UNIX"; 157 return "UNIX";
158 } 158 }
159 159
160 return "Unknown"; 160 return "Unknown";
161 } 161 }
162 162
163 private static bool CompareNum(OperatorSymbol oper, int val1, int val2) 163 private static bool CompareNum(OperatorSymbol oper, int val1, int val2)
164 { 164 {
165 switch(oper) 165 switch(oper)
166 { 166 {
167 case OperatorSymbol.Equal: 167 case OperatorSymbol.Equal:
168 return (val1 == val2); 168 return (val1 == val2);
169 case OperatorSymbol.NotEqual: 169 case OperatorSymbol.NotEqual:
170 return (val1 != val2); 170 return (val1 != val2);
171 case OperatorSymbol.LessThan: 171 case OperatorSymbol.LessThan:
172 return (val1 < val2); 172 return (val1 < val2);
173 case OperatorSymbol.LessThanEqual: 173 case OperatorSymbol.LessThanEqual:
174 return (val1 <= val2); 174 return (val1 <= val2);
175 case OperatorSymbol.GreaterThan: 175 case OperatorSymbol.GreaterThan:
176 return (val1 > val2); 176 return (val1 > val2);
177 case OperatorSymbol.GreaterThanEqual: 177 case OperatorSymbol.GreaterThanEqual:
178 return (val1 >= val2); 178 return (val1 >= val2);
179 } 179 }
180 180
181 throw new WarningException("Unknown operator type"); 181 throw new WarningException("Unknown operator type");
182 } 182 }
183 183
184 private static bool CompareStr(OperatorSymbol oper, string val1, string val2) 184 private static bool CompareStr(OperatorSymbol oper, string val1, string val2)
185 { 185 {
186 switch(oper) 186 switch(oper)
187 { 187 {
188 case OperatorSymbol.Equal: 188 case OperatorSymbol.Equal:
189 return (val1 == val2); 189 return (val1 == val2);
190 case OperatorSymbol.NotEqual: 190 case OperatorSymbol.NotEqual:
191 return (val1 != val2); 191 return (val1 != val2);
192 case OperatorSymbol.LessThan: 192 case OperatorSymbol.LessThan:
193 return (val1.CompareTo(val2) < 0); 193 return (val1.CompareTo(val2) < 0);
194 case OperatorSymbol.LessThanEqual: 194 case OperatorSymbol.LessThanEqual:
195 return (val1.CompareTo(val2) <= 0); 195 return (val1.CompareTo(val2) <= 0);
196 case OperatorSymbol.GreaterThan: 196 case OperatorSymbol.GreaterThan:
197 return (val1.CompareTo(val2) > 0); 197 return (val1.CompareTo(val2) > 0);
198 case OperatorSymbol.GreaterThanEqual: 198 case OperatorSymbol.GreaterThanEqual:
199 return (val1.CompareTo(val2) >= 0); 199 return (val1.CompareTo(val2) >= 0);
200 } 200 }
201 201
202 throw new WarningException("Unknown operator type"); 202 throw new WarningException("Unknown operator type");
203 } 203 }
204 204
205 private static char NextChar(int idx, string str) 205 private static char NextChar(int idx, string str)
206 { 206 {
207 if((idx + 1) >= str.Length) 207 if((idx + 1) >= str.Length)
208 { 208 {
209 return Char.MaxValue; 209 return Char.MaxValue;
210 } 210 }
211 211
212 return str[idx + 1]; 212 return str[idx + 1];
213 } 213 }
214 // Very very simple expression parser. Can only match expressions of the form 214 // Very very simple expression parser. Can only match expressions of the form
215 // <var> <op> <value>: 215 // <var> <op> <value>:
216 // OS = Windows 216 // OS = Windows
217 // OS != Linux 217 // OS != Linux
218 // RuntimeMinor > 0 218 // RuntimeMinor > 0
219 private bool ParseExpression(string exp) 219 private bool ParseExpression(string exp)
220 { 220 {
221 if(exp == null) 221 if(exp == null)
222 { 222 {
223 throw new ArgumentException("Invalid expression, cannot be null"); 223 throw new ArgumentException("Invalid expression, cannot be null");
224 } 224 }
225 225
226 exp = exp.Trim(); 226 exp = exp.Trim();
227 if(exp.Length < 1) 227 if(exp.Length < 1)
228 { 228 {
229 throw new ArgumentException("Invalid expression, cannot be 0 length"); 229 throw new ArgumentException("Invalid expression, cannot be 0 length");
230 } 230 }
231 231
232 string id = ""; 232 string id = "";
233 string str = ""; 233 string str = "";
234 OperatorSymbol oper = OperatorSymbol.None; 234 OperatorSymbol oper = OperatorSymbol.None;
235 bool inStr = false; 235 bool inStr = false;
236 236
237 for(int i = 0; i < exp.Length; i++) 237 for(int i = 0; i < exp.Length; i++)
238 { 238 {
239 char c = exp[i]; 239 char c = exp[i];
240 if(Char.IsWhiteSpace(c)) 240 if(Char.IsWhiteSpace(c))
241 { 241 {
242 continue; 242 continue;
243 } 243 }
244 244
245 if(Char.IsLetterOrDigit(c) || c == '_') 245 if(Char.IsLetterOrDigit(c) || c == '_')
246 { 246 {
247 if(inStr) 247 if(inStr)
248 { 248 {
249 str += c; 249 str += c;
250 } 250 }
251 else 251 else
252 { 252 {
253 id += c; 253 id += c;
254 } 254 }
255 } 255 }
256 else if(c == '\"') 256 else if(c == '\"')
257 { 257 {
258 inStr = !inStr; 258 inStr = !inStr;
259 if(inStr) 259 if(inStr)
260 { 260 {
261 str = ""; 261 str = "";
262 } 262 }
263 } 263 }
264 else 264 else
265 { 265 {
266 if(inStr) 266 if(inStr)
267 { 267 {
268 str += c; 268 str += c;
269 } 269 }
270 else 270 else
271 { 271 {
272 switch(c) 272 switch(c)
273 { 273 {
274 case '=': 274 case '=':
275 oper = OperatorSymbol.Equal; 275 oper = OperatorSymbol.Equal;
276 break; 276 break;
277 277
278 case '!': 278 case '!':
279 if(NextChar(i, exp) == '=') 279 if(NextChar(i, exp) == '=')
280 { 280 {
281 oper = OperatorSymbol.NotEqual; 281 oper = OperatorSymbol.NotEqual;
282 } 282 }
283 283
284 break; 284 break;
285 285
286 case '<': 286 case '<':
287 if(NextChar(i, exp) == '=') 287 if(NextChar(i, exp) == '=')
288 { 288 {
289 oper = OperatorSymbol.LessThanEqual; 289 oper = OperatorSymbol.LessThanEqual;
290 } 290 }
291 else 291 else
292 { 292 {
293 oper = OperatorSymbol.LessThan; 293 oper = OperatorSymbol.LessThan;
294 } 294 }
295 295
296 break; 296 break;
297 297
298 case '>': 298 case '>':
299 if(NextChar(i, exp) == '=') 299 if(NextChar(i, exp) == '=')
300 { 300 {
301 oper = OperatorSymbol.GreaterThanEqual; 301 oper = OperatorSymbol.GreaterThanEqual;
302 } 302 }
303 else 303 else
304 { 304 {
305 oper = OperatorSymbol.GreaterThan; 305 oper = OperatorSymbol.GreaterThan;
306 } 306 }
307 307
308 break; 308 break;
309 } 309 }
310 } 310 }
311 } 311 }
312 } 312 }
313 313
314 314
315 if(inStr) 315 if(inStr)
316 { 316 {
317 throw new WarningException("Expected end of string in expression"); 317 throw new WarningException("Expected end of string in expression");
318 } 318 }
319 319
320 if(oper == OperatorSymbol.None) 320 if(oper == OperatorSymbol.None)
321 { 321 {
322 throw new WarningException("Expected operator in expression"); 322 throw new WarningException("Expected operator in expression");
323 } 323 }
324 if(id.Length < 1) 324 if(id.Length < 1)
325 { 325 {
326 throw new WarningException("Expected identifier in expression"); 326 throw new WarningException("Expected identifier in expression");
327 } 327 }
328 if(str.Length < 1) 328 if(str.Length < 1)
329 { 329 {
330 throw new WarningException("Expected value in expression"); 330 throw new WarningException("Expected value in expression");
331 } 331 }
332 332
333 bool ret; 333 bool ret;
334 try 334 try
335 { 335 {
336 object val = m_Variables[id.ToLower()]; 336 object val = m_Variables[id.ToLower()];
337 if(val == null) 337 if(val == null)
338 { 338 {
339 throw new WarningException("Unknown identifier '{0}'", id); 339 throw new WarningException("Unknown identifier '{0}'", id);
340 } 340 }
341 341
342 Type t = val.GetType(); 342 Type t = val.GetType();
343 if(t.IsAssignableFrom(typeof(int))) 343 if(t.IsAssignableFrom(typeof(int)))
344 { 344 {
345 int numVal = (int)val; 345 int numVal = (int)val;
346 int numVal2 = Int32.Parse(str); 346 int numVal2 = Int32.Parse(str);
347 ret = CompareNum(oper, numVal, numVal2); 347 ret = CompareNum(oper, numVal, numVal2);
348 } 348 }
349 else 349 else
350 { 350 {
351 string strVal = val.ToString(); 351 string strVal = val.ToString();
352 string strVal2 = str; 352 string strVal2 = str;
353 ret = CompareStr(oper, strVal, strVal2); 353 ret = CompareStr(oper, strVal, strVal2);
354 } 354 }
355 } 355 }
356 catch(ArgumentException ex) 356 catch(ArgumentException ex)
357 { 357 {
358 ex.ToString(); 358 ex.ToString();
359 throw new WarningException("Invalid value type for system variable '{0}', expected int", id); 359 throw new WarningException("Invalid value type for system variable '{0}', expected int", id);
360 } 360 }
361 361
362 return ret; 362 return ret;
363 } 363 }
364 364
365 /// <summary> 365 /// <summary>
366 /// Taken from current Prebuild included in OpenSim 0.7.x 366 /// Taken from current Prebuild included in OpenSim 0.7.x
@@ -376,13 +376,13 @@ namespace Prebuild.Core.Parse
376 if (!include.Contains ("*")) { 376 if (!include.Contains ("*")) {
377 return; 377 return;
378 } 378 }
379 379
380 // Console.WriteLine("Processing {0}", include); 380 // Console.WriteLine("Processing {0}", include);
381 381
382 // Break up the include into pre and post wildcard sections 382 // Break up the include into pre and post wildcard sections
383 string preWildcard = include.Substring (0, include.IndexOf ("*")); 383 string preWildcard = include.Substring (0, include.IndexOf ("*"));
384 string postWildcard = include.Substring (include.IndexOf ("*") + 2); 384 string postWildcard = include.Substring (include.IndexOf ("*") + 2);
385 385
386 // If preWildcard is a directory, recurse 386 // If preWildcard is a directory, recurse
387 if (Directory.Exists (preWildcard)) { 387 if (Directory.Exists (preWildcard)) {
388 string[] directories = Directory.GetDirectories (preWildcard); 388 string[] directories = Directory.GetDirectories (preWildcard);
@@ -390,7 +390,7 @@ namespace Prebuild.Core.Parse
390 Array.Reverse (directories); 390 Array.Reverse (directories);
391 foreach (string dirPath in directories) { 391 foreach (string dirPath in directories) {
392 //Console.WriteLine ("Scanning : {0}", dirPath); 392 //Console.WriteLine ("Scanning : {0}", dirPath);
393 393
394 string includeFile = Path.Combine (dirPath, postWildcard); 394 string includeFile = Path.Combine (dirPath, postWildcard);
395 if (includeFile.Contains ("*")) { 395 if (includeFile.Contains ("*")) {
396 // postWildcard included another wildcard, recurse. 396 // postWildcard included another wildcard, recurse.
@@ -408,10 +408,10 @@ namespace Prebuild.Core.Parse
408 // preWildcard is not a path to a directory, so the wildcard is in the filename 408 // preWildcard is not a path to a directory, so the wildcard is in the filename
409 string searchFilename = Path.GetFileName (preWildcard.Substring (preWildcard.IndexOf ("/") + 1) + "*" + postWildcard); 409 string searchFilename = Path.GetFileName (preWildcard.Substring (preWildcard.IndexOf ("/") + 1) + "*" + postWildcard);
410 Console.WriteLine ("searchFilename: {0}", searchFilename); 410 Console.WriteLine ("searchFilename: {0}", searchFilename);
411 411
412 string searchDirectory = Path.GetDirectoryName (preWildcard); 412 string searchDirectory = Path.GetDirectoryName (preWildcard);
413 Console.WriteLine ("searchDirectory: {0}", searchDirectory); 413 Console.WriteLine ("searchDirectory: {0}", searchDirectory);
414 414
415 string[] files = Directory.GetFiles (searchDirectory, searchFilename); 415 string[] files = Directory.GetFiles (searchDirectory, searchFilename);
416 Array.Sort (files); 416 Array.Sort (files);
417 Array.Reverse (files); 417 Array.Reverse (files);
@@ -426,227 +426,227 @@ namespace Prebuild.Core.Parse
426 } 426 }
427 } 427 }
428 428
429 #endregion 429 #endregion
430 430
431 #region Public Methods 431 #region Public Methods
432 432
433 /// <summary> 433 /// <summary>
434 /// 434 ///
435 /// </summary> 435 /// </summary>
436 /// <param name="name"></param> 436 /// <param name="name"></param>
437 /// <param name="variableValue"></param> 437 /// <param name="variableValue"></param>
438 public void RegisterVariable(string name, object variableValue) 438 public void RegisterVariable(string name, object variableValue)
439 { 439 {
440 if(name == null || variableValue == null) 440 if(name == null || variableValue == null)
441 { 441 {
442 return; 442 return;
443 } 443 }
444 444
445 m_Variables[name.ToLower()] = variableValue; 445 m_Variables[name.ToLower()] = variableValue;
446 } 446 }
447 447
448 /// <summary> 448 /// <summary>
449 /// Performs validation on the xml source as well as evaluates conditional and flow expresions 449 /// Performs validation on the xml source as well as evaluates conditional and flow expresions
450 /// </summary> 450 /// </summary>
451 /// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception> 451 /// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception>
452 /// <param name="initialReader"></param> 452 /// <param name="initialReader"></param>
453 /// <returns>the output xml </returns> 453 /// <returns>the output xml </returns>
454 public string Process(XmlReader initialReader) 454 public string Process(XmlReader initialReader)
455 { 455 {
456 if(initialReader == null) 456 if(initialReader == null)
457 { 457 {
458 throw new ArgumentException("Invalid XML reader to pre-process"); 458 throw new ArgumentException("Invalid XML reader to pre-process");
459 } 459 }
460 460
461 IfContext context = new IfContext(true, true, IfState.None); 461 IfContext context = new IfContext(true, true, IfState.None);
462 StringWriter xmlText = new StringWriter(); 462 StringWriter xmlText = new StringWriter();
463 XmlTextWriter writer = new XmlTextWriter(xmlText); 463 XmlTextWriter writer = new XmlTextWriter(xmlText);
464 writer.Formatting = Formatting.Indented; 464 writer.Formatting = Formatting.Indented;
465 465
466 // Create a queue of XML readers and add the initial 466 // Create a queue of XML readers and add the initial
467 // reader to it. Then we process until we run out of 467 // reader to it. Then we process until we run out of
468 // readers which lets the <?include?> operation add more 468 // readers which lets the <?include?> operation add more
469 // readers to generate a multi-file parser and not require 469 // readers to generate a multi-file parser and not require
470 // XML fragments that a recursive version would use. 470 // XML fragments that a recursive version would use.
471 Stack<XmlReader> readerStack = new Stack<XmlReader>(); 471 Stack<XmlReader> readerStack = new Stack<XmlReader>();
472 readerStack.Push(initialReader); 472 readerStack.Push(initialReader);
473 473
474 while(readerStack.Count > 0) 474 while(readerStack.Count > 0)
475 { 475 {
476 // Pop off the next reader. 476 // Pop off the next reader.
477 XmlReader reader = readerStack.Pop(); 477 XmlReader reader = readerStack.Pop();
478 478
479 // Process through this XML reader until it is 479 // Process through this XML reader until it is
480 // completed (or it is replaced by the include 480 // completed (or it is replaced by the include
481 // operation). 481 // operation).
482 while(reader.Read()) 482 while(reader.Read())
483 { 483 {
484 // The prebuild file has a series of processing 484 // The prebuild file has a series of processing
485 // instructions which allow for specific 485 // instructions which allow for specific
486 // inclusions based on operating system or to 486 // inclusions based on operating system or to
487 // include additional files. 487 // include additional files.
488 if(reader.NodeType == XmlNodeType.ProcessingInstruction) 488 if(reader.NodeType == XmlNodeType.ProcessingInstruction)
489 { 489 {
490 bool ignore = false; 490 bool ignore = false;
491 491
492 switch(reader.LocalName) 492 switch(reader.LocalName)
493 { 493 {
494 case "include": 494 case "include":
495 // use regular expressions to parse out the attributes. 495 // use regular expressions to parse out the attributes.
496 MatchCollection matches = includeFileRegex.Matches(reader.Value); 496 MatchCollection matches = includeFileRegex.Matches(reader.Value);
497 497
498 // make sure there is only one file attribute. 498 // make sure there is only one file attribute.
499 if(matches.Count > 1) 499 if(matches.Count > 1)
500 { 500 {
501 throw new WarningException("An <?include ?> node was found, but it specified more than one file."); 501 throw new WarningException("An <?include ?> node was found, but it specified more than one file.");
502 } 502 }
503 503
504 if(matches.Count == 0) 504 if(matches.Count == 0)
505 { 505 {
506 throw new WarningException("An <?include ?> node was found, but it did not specify the file attribute."); 506 throw new WarningException("An <?include ?> node was found, but it did not specify the file attribute.");
507 } 507 }
508 508
509 // ***** Adding for wildcard handling 509 // ***** Adding for wildcard handling
510 // Push current reader back onto the stack. 510 // Push current reader back onto the stack.
511 readerStack.Push (reader); 511 readerStack.Push (reader);
512 512
513 // Pull the file out from the regex and make sure it is a valid file before using it. 513 // Pull the file out from the regex and make sure it is a valid file before using it.
514 string filename = matches[0].Groups[1].Value; 514 string filename = matches[0].Groups[1].Value;
515 515
516 filename = String.Join (Path.DirectorySeparatorChar.ToString (), filename.Split (new char[] { '/', '\\' })); 516 filename = String.Join (Path.DirectorySeparatorChar.ToString (), filename.Split (new char[] { '/', '\\' }));
517 517
518 if (!filename.Contains ("*")) { 518 if (!filename.Contains ("*")) {
519 519
520 FileInfo includeFile = new FileInfo (filename); 520 FileInfo includeFile = new FileInfo (filename);
521 if (!includeFile.Exists) { 521 if (!includeFile.Exists) {
522 throw new WarningException ("Cannot include file: " + includeFile.FullName); 522 throw new WarningException ("Cannot include file: " + includeFile.FullName);
523 } 523 }
524 524
525 // Create a new reader object for this file. Then put the old reader back on the stack and start 525 // Create a new reader object for this file. Then put the old reader back on the stack and start
526 // processing using this new XML reader. 526 // processing using this new XML reader.
527 527
528 XmlReader newReader = new XmlTextReader (includeFile.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); 528 XmlReader newReader = new XmlTextReader (includeFile.Open (FileMode.Open, FileAccess.Read, FileShare.Read));
529 reader = newReader; 529 reader = newReader;
530 readerStack.Push (reader); 530 readerStack.Push (reader);
531 531
532 } else { 532 } else {
533 WildCardInclude (readerStack, filename); 533 WildCardInclude (readerStack, filename);
534 } 534 }
535 535
536 reader = (XmlReader)readerStack.Pop (); 536 reader = (XmlReader)readerStack.Pop ();
537 ignore = true; 537 ignore = true;
538 break; 538 break;
539 539
540 case "if": 540 case "if":
541 m_IfStack.Push(context); 541 m_IfStack.Push(context);
542 context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If); 542 context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If);
543 ignore = true; 543 ignore = true;
544 break; 544 break;
545 545
546 case "elseif": 546 case "elseif":
547 if(m_IfStack.Count == 0) 547 if(m_IfStack.Count == 0)
548 { 548 {
549 throw new WarningException("Unexpected 'elseif' outside of 'if'"); 549 throw new WarningException("Unexpected 'elseif' outside of 'if'");
550 } 550 }
551 if(context.State != IfState.If && context.State != IfState.ElseIf) 551 if(context.State != IfState.If && context.State != IfState.ElseIf)
552 { 552 {
553 throw new WarningException("Unexpected 'elseif' outside of 'if'"); 553 throw new WarningException("Unexpected 'elseif' outside of 'if'");
554 } 554 }
555 555
556 context.State = IfState.ElseIf; 556 context.State = IfState.ElseIf;
557 if(!context.EverKept) 557 if(!context.EverKept)
558 { 558 {
559 context.Keep = ParseExpression(reader.Value); 559 context.Keep = ParseExpression(reader.Value);
560 } 560 }
561 else 561 else
562 { 562 {
563 context.Keep = false; 563 context.Keep = false;
564 } 564 }
565 565
566 ignore = true; 566 ignore = true;
567 break; 567 break;
568 568
569 case "else": 569 case "else":
570 if(m_IfStack.Count == 0) 570 if(m_IfStack.Count == 0)
571 { 571 {
572 throw new WarningException("Unexpected 'else' outside of 'if'"); 572 throw new WarningException("Unexpected 'else' outside of 'if'");
573 } 573 }
574 if(context.State != IfState.If && context.State != IfState.ElseIf) 574 if(context.State != IfState.If && context.State != IfState.ElseIf)
575 { 575 {
576 throw new WarningException("Unexpected 'else' outside of 'if'"); 576 throw new WarningException("Unexpected 'else' outside of 'if'");
577 } 577 }
578 578
579 context.State = IfState.Else; 579 context.State = IfState.Else;
580 context.Keep = !context.EverKept; 580 context.Keep = !context.EverKept;
581 ignore = true; 581 ignore = true;
582 break; 582 break;
583 583
584 case "endif": 584 case "endif":
585 if(m_IfStack.Count == 0) 585 if(m_IfStack.Count == 0)
586 { 586 {
587 throw new WarningException("Unexpected 'endif' outside of 'if'"); 587 throw new WarningException("Unexpected 'endif' outside of 'if'");
588 } 588 }
589 589
590 context = m_IfStack.Pop(); 590 context = m_IfStack.Pop();
591 ignore = true; 591 ignore = true;
592 break; 592 break;
593 } 593 }
594 594
595 if(ignore) 595 if(ignore)
596 { 596 {
597 continue; 597 continue;
598 } 598 }
599 }//end pre-proc instruction 599 }//end pre-proc instruction
600 600
601 if(!context.Active || !context.Keep) 601 if(!context.Active || !context.Keep)
602 { 602 {
603 continue; 603 continue;
604 } 604 }
605 605
606 switch(reader.NodeType) 606 switch(reader.NodeType)
607 { 607 {
608 case XmlNodeType.Element: 608 case XmlNodeType.Element:
609 bool empty = reader.IsEmptyElement; 609 bool empty = reader.IsEmptyElement;
610 writer.WriteStartElement(reader.Name); 610 writer.WriteStartElement(reader.Name);
611 611
612 while (reader.MoveToNextAttribute()) 612 while (reader.MoveToNextAttribute())
613 { 613 {
614 writer.WriteAttributeString(reader.Name, reader.Value); 614 writer.WriteAttributeString(reader.Name, reader.Value);
615 } 615 }
616 616
617 if(empty) 617 if(empty)
618 { 618 {
619 writer.WriteEndElement(); 619 writer.WriteEndElement();
620 } 620 }
621 621
622 break; 622 break;
623 623
624 case XmlNodeType.EndElement: 624 case XmlNodeType.EndElement:
625 writer.WriteEndElement(); 625 writer.WriteEndElement();
626 break; 626 break;
627 627
628 case XmlNodeType.Text: 628 case XmlNodeType.Text:
629 writer.WriteString(reader.Value); 629 writer.WriteString(reader.Value);
630 break; 630 break;
631 631
632 case XmlNodeType.CDATA: 632 case XmlNodeType.CDATA:
633 writer.WriteCData(reader.Value); 633 writer.WriteCData(reader.Value);
634 break; 634 break;
635 635
636 default: 636 default:
637 break; 637 break;
638 } 638 }
639 } 639 }
640 640
641 if(m_IfStack.Count != 0) 641 if(m_IfStack.Count != 0)
642 { 642 {
643 throw new WarningException("Mismatched 'if', 'endif' pair"); 643 throw new WarningException("Mismatched 'if', 'endif' pair");
644 } 644 }
645 } 645 }
646 646
647 return xmlText.ToString(); 647 return xmlText.ToString();
648 } 648 }
649 649
650 #endregion 650 #endregion
651 } 651 }
652} 652}
diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
index c52c4f1..485e4dd 100644
--- a/Prebuild/src/Core/Targets/AutotoolsTarget.cs
+++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
@@ -51,10 +51,10 @@ POSSIBILITY OF SUCH DAMAGE.
51 distribute, sublicense, and/or sell copies of the Software, and to 51 distribute, sublicense, and/or sell copies of the Software, and to
52 permit persons to whom the Software is furnished to do so, subject to 52 permit persons to whom the Software is furnished to do so, subject to
53 the following conditions: 53 the following conditions:
54 54
55 The above copyright notice and this permission notice shall be 55 The above copyright notice and this permission notice shall be
56 included in all copies or substantial portions of the Software. 56 included in all copies or substantial portions of the Software.
57 57
58 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 58 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
59 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 59 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 60 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -156,7 +156,7 @@ namespace Prebuild.Core.Targets
156 156
157 157
158 /// <summary> 158 /// <summary>
159 /// 159 ///
160 /// </summary> 160 /// </summary>
161 [Target("autotools")] 161 [Target("autotools")]
162 public class AutotoolsTarget : ITarget 162 public class AutotoolsTarget : ITarget
@@ -650,7 +650,7 @@ namespace Prebuild.Core.Targets
650 string tempAssemblyFile = Path.Combine(Path.GetTempPath(), project.Name + "-temp.dll"); 650 string tempAssemblyFile = Path.Combine(Path.GetTempPath(), project.Name + "-temp.dll");
651 System.CodeDom.Compiler.CompilerParameters cparam = 651 System.CodeDom.Compiler.CompilerParameters cparam =
652 new System.CodeDom.Compiler.CompilerParameters(args, tempAssemblyFile); 652 new System.CodeDom.Compiler.CompilerParameters(args, tempAssemblyFile);
653 653
654 System.CodeDom.Compiler.CompilerResults cr = 654 System.CodeDom.Compiler.CompilerResults cr =
655 cscp.CompileAssemblyFromFile(cparam, sources); 655 cscp.CompileAssemblyFromFile(cparam, sources);
656 656
@@ -673,11 +673,11 @@ namespace Prebuild.Core.Targets
673 if (File.Exists(tempAssemblyFile)) 673 if (File.Exists(tempAssemblyFile))
674 File.Delete(tempAssemblyFile); 674 File.Delete(tempAssemblyFile);
675 } 675 }
676 catch 676 catch
677 { 677 {
678 Console.WriteLine("Error! '{0}'", e); 678 Console.WriteLine("Error! '{0}'", e);
679 } 679 }
680 680
681 } 681 }
682 682
683 // Tell the user if there's a problem copying the file 683 // Tell the user if there's a problem copying the file
@@ -977,7 +977,7 @@ namespace Prebuild.Core.Targets
977 977
978 if(autotoolsStream == null) { 978 if(autotoolsStream == null) {
979 979
980 /* 980 /*
981 * try without the default namespace prepended, in 981 * try without the default namespace prepended, in
982 * case prebuild.exe assembly was compiled with 982 * case prebuild.exe assembly was compiled with
983 * something other than Visual Studio .NET 983 * something other than Visual Studio .NET
diff --git a/Prebuild/src/Core/Targets/DebugTarget.cs b/Prebuild/src/Core/Targets/DebugTarget.cs
index be8aea9..d78064f 100644
--- a/Prebuild/src/Core/Targets/DebugTarget.cs
+++ b/Prebuild/src/Core/Targets/DebugTarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -41,62 +41,62 @@ using Prebuild.Core.Nodes;
41#if (DEBUG && _DEBUG_TARGET) 41#if (DEBUG && _DEBUG_TARGET)
42namespace Prebuild.Core.Targets 42namespace Prebuild.Core.Targets
43{ 43{
44 [Target("debug")] 44 [Target("debug")]
45 public class DebugTarget : ITarget 45 public class DebugTarget : ITarget
46 { 46 {
47#region Fields 47#region Fields
48 48
49 private Kernel m_Kernel = null; 49 private Kernel m_Kernel = null;
50 50
51#endregion 51#endregion
52 52
53#region ITarget Members 53#region ITarget Members
54 54
55 public void Write() 55 public void Write()
56 { 56 {
57 foreach(SolutionNode s in m_Kernel.Solutions) 57 foreach(SolutionNode s in m_Kernel.Solutions)
58 { 58 {
59 Console.WriteLine("Solution [ {0}, {1} ]", s.Name, s.Path); 59 Console.WriteLine("Solution [ {0}, {1} ]", s.Name, s.Path);
60 foreach(string file in s.Files) 60 foreach(string file in s.Files)
61{ 61{
62 Console.WriteLine("\tFile [ {0} ]", file); 62 Console.WriteLine("\tFile [ {0} ]", file);
63} 63}
64 64
65 foreach(ProjectNode proj in s.Projects) 65 foreach(ProjectNode proj in s.Projects)
66 { 66 {
67 Console.WriteLine("\tProject [ {0}, {1}. {2} ]", proj.Name, proj.Path, proj.Language); 67 Console.WriteLine("\tProject [ {0}, {1}. {2} ]", proj.Name, proj.Path, proj.Language);
68 foreach(string file in proj.Files) 68 foreach(string file in proj.Files)
69 Console.WriteLine("\t\tFile [ {0} ]", file); 69 Console.WriteLine("\t\tFile [ {0} ]", file);
70 } 70 }
71 } 71 }
72 } 72 }
73 73
74 public void Clean() 74 public void Clean()
75 { 75 {
76 Console.WriteLine("Not implemented"); 76 Console.WriteLine("Not implemented");
77 } 77 }
78 78
79 public string Name 79 public string Name
80 { 80 {
81 get 81 get
82 { 82 {
83 return "debug"; 83 return "debug";
84 } 84 }
85 } 85 }
86 86
87 public Kernel Kernel 87 public Kernel Kernel
88 { 88 {
89 get 89 get
90 { 90 {
91 return m_Kernel; 91 return m_Kernel;
92 } 92 }
93 set 93 set
94 { 94 {
95 m_Kernel = value; 95 m_Kernel = value;
96 } 96 }
97 } 97 }
98 98
99#endregion 99#endregion
100 } 100 }
101} 101}
102#endif 102#endif
diff --git a/Prebuild/src/Core/Targets/MakefileTarget.cs b/Prebuild/src/Core/Targets/MakefileTarget.cs
index 8fe1c44..54046dd 100644
--- a/Prebuild/src/Core/Targets/MakefileTarget.cs
+++ b/Prebuild/src/Core/Targets/MakefileTarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004 Crestez Leonard (cleonard@go.ro)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
diff --git a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs
index 85fe2db..ea6d2c2 100644
--- a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs
+++ b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -35,481 +35,481 @@ using Prebuild.Core.Utilities;
35 35
36namespace Prebuild.Core.Targets 36namespace Prebuild.Core.Targets
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// 39 ///
40 /// </summary> 40 /// </summary>
41 [Target("monodev")] 41 [Target("monodev")]
42 public class MonoDevelopTarget : ITarget 42 public class MonoDevelopTarget : ITarget
43 { 43 {
44 #region Fields 44 #region Fields
45 45
46 private Kernel m_Kernel; 46 private Kernel m_Kernel;
47 47
48 #endregion 48 #endregion
49 49
50 #region Private Methods 50 #region Private Methods
51 51
52 private static string PrependPath(string path) 52 private static string PrependPath(string path)
53 { 53 {
54 string tmpPath = Helper.NormalizePath(path, '/'); 54 string tmpPath = Helper.NormalizePath(path, '/');
55 Regex regex = new Regex(@"(\w):/(\w+)"); 55 Regex regex = new Regex(@"(\w):/(\w+)");
56 Match match = regex.Match(tmpPath); 56 Match match = regex.Match(tmpPath);
57 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') 57 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
58 { 58 {
59 tmpPath = Helper.NormalizePath(tmpPath); 59 tmpPath = Helper.NormalizePath(tmpPath);
60 } 60 }
61 else 61 else
62 { 62 {
63 tmpPath = Helper.NormalizePath("./" + tmpPath); 63 tmpPath = Helper.NormalizePath("./" + tmpPath);
64 } 64 }
65 65
66 return tmpPath; 66 return tmpPath;
67 } 67 }
68 68
69 private static string BuildReference(SolutionNode solution, ReferenceNode refr) 69 private static string BuildReference(SolutionNode solution, ReferenceNode refr)
70 { 70 {
71 string ret = "<ProjectReference type=\""; 71 string ret = "<ProjectReference type=\"";
72 if(solution.ProjectsTable.ContainsKey(refr.Name)) 72 if(solution.ProjectsTable.ContainsKey(refr.Name))
73 { 73 {
74 ret += "Project\""; 74 ret += "Project\"";
75 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\" refto=\"" + refr.Name + "\" />"; 75 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\" refto=\"" + refr.Name + "\" />";
76 } 76 }
77 else 77 else
78 { 78 {
79 ProjectNode project = (ProjectNode)refr.Parent; 79 ProjectNode project = (ProjectNode)refr.Parent;
80 string fileRef = FindFileReference(refr.Name, project); 80 string fileRef = FindFileReference(refr.Name, project);
81 81
82 if(refr.Path != null || fileRef != null) 82 if(refr.Path != null || fileRef != null)
83 { 83 {
84 ret += "Assembly\" refto=\""; 84 ret += "Assembly\" refto=\"";
85 85
86 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; 86 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef;
87 87
88 ret += finalPath; 88 ret += finalPath;
89 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; 89 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
90 return ret; 90 return ret;
91 } 91 }
92 92
93 ret += "Gac\""; 93 ret += "Gac\"";
94 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\""; 94 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\"";
95 ret += " refto=\""; 95 ret += " refto=\"";
96 try 96 try
97 { 97 {
98 /* 98 /*
99 Day changed to 28 Mar 2007 99 Day changed to 28 Mar 2007
100 ... 100 ...
101 08:09 < cj> is there anything that replaces Assembly.LoadFromPartialName() ? 101 08:09 < cj> is there anything that replaces Assembly.LoadFromPartialName() ?
102 08:09 < jonp> no 102 08:09 < jonp> no
103 08:10 < jonp> in their infinite wisdom [sic], microsoft decided that the 103 08:10 < jonp> in their infinite wisdom [sic], microsoft decided that the
104 ability to load any assembly version by-name was an inherently 104 ability to load any assembly version by-name was an inherently
105 bad idea 105 bad idea
106 08:11 < cj> I'm thinking of a bunch of four-letter words right now... 106 08:11 < cj> I'm thinking of a bunch of four-letter words right now...
107 08:11 < cj> security through making it difficult for the developer!!! 107 08:11 < cj> security through making it difficult for the developer!!!
108 08:12 < jonp> just use the Obsolete API 108 08:12 < jonp> just use the Obsolete API
109 08:12 < jonp> it should still work 109 08:12 < jonp> it should still work
110 08:12 < cj> alrighty. 110 08:12 < cj> alrighty.
111 08:12 < jonp> you just get warnings when using it 111 08:12 < jonp> you just get warnings when using it
112 */ 112 */
113 Assembly assem = Assembly.LoadWithPartialName(refr.Name); 113 Assembly assem = Assembly.LoadWithPartialName(refr.Name);
114 ret += assem.FullName; 114 ret += assem.FullName;
115 //ret += refr.Name; 115 //ret += refr.Name;
116 } 116 }
117 catch (System.NullReferenceException e) 117 catch (System.NullReferenceException e)
118 { 118 {
119 e.ToString(); 119 e.ToString();
120 ret += refr.Name; 120 ret += refr.Name;
121 } 121 }
122 ret += "\" />"; 122 ret += "\" />";
123 } 123 }
124 124
125 return ret; 125 return ret;
126 } 126 }
127 127
128 private static string FindFileReference(string refName, ProjectNode project) 128 private static string FindFileReference(string refName, ProjectNode project)
129 { 129 {
130 foreach(ReferencePathNode refPath in project.ReferencePaths) 130 foreach(ReferencePathNode refPath in project.ReferencePaths)
131 { 131 {
132 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); 132 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
133 133
134 if(File.Exists(fullPath)) 134 if(File.Exists(fullPath))
135 { 135 {
136 return fullPath; 136 return fullPath;
137 } 137 }
138 } 138 }
139 139
140 return null; 140 return null;
141 } 141 }
142 142
143 /// <summary> 143 /// <summary>
144 /// Gets the XML doc file. 144 /// Gets the XML doc file.
145 /// </summary> 145 /// </summary>
146 /// <param name="project">The project.</param> 146 /// <param name="project">The project.</param>
147 /// <param name="conf">The conf.</param> 147 /// <param name="conf">The conf.</param>
148 /// <returns></returns> 148 /// <returns></returns>
149 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) 149 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf)
150 { 150 {
151 if( conf == null ) 151 if( conf == null )
152 { 152 {
153 throw new ArgumentNullException("conf"); 153 throw new ArgumentNullException("conf");
154 } 154 }
155 if( project == null ) 155 if( project == null )
156 { 156 {
157 throw new ArgumentNullException("project"); 157 throw new ArgumentNullException("project");
158 } 158 }
159 string docFile = (string)conf.Options["XmlDocFile"]; 159 string docFile = (string)conf.Options["XmlDocFile"];
160 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified 160 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
161 { 161 {
162 return "False"; 162 return "False";
163 } 163 }
164 return "True"; 164 return "True";
165 } 165 }
166 166
167 private void WriteProject(SolutionNode solution, ProjectNode project) 167 private void WriteProject(SolutionNode solution, ProjectNode project)
168 { 168 {
169 string csComp = "Mcs"; 169 string csComp = "Mcs";
170 string netRuntime = "Mono"; 170 string netRuntime = "Mono";
171 if(project.Runtime == ClrRuntime.Microsoft) 171 if(project.Runtime == ClrRuntime.Microsoft)
172 { 172 {
173 csComp = "Csc"; 173 csComp = "Csc";
174 netRuntime = "MsNet"; 174 netRuntime = "MsNet";
175 } 175 }
176 176
177 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); 177 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp");
178 StreamWriter ss = new StreamWriter(projFile); 178 StreamWriter ss = new StreamWriter(projFile);
179 179
180 m_Kernel.CurrentWorkingDirectory.Push(); 180 m_Kernel.CurrentWorkingDirectory.Push();
181 Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); 181 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
182 182
183 using(ss) 183 using(ss)
184 { 184 {
185 ss.WriteLine( 185 ss.WriteLine(
186 "<Project name=\"{0}\" description=\"\" standardNamespace=\"{1}\" newfilesearch=\"None\" enableviewstate=\"True\" fileversion=\"2.0\" language=\"C#\" clr-version=\"Net_2_0\" ctype=\"DotNetProject\">", 186 "<Project name=\"{0}\" description=\"\" standardNamespace=\"{1}\" newfilesearch=\"None\" enableviewstate=\"True\" fileversion=\"2.0\" language=\"C#\" clr-version=\"Net_2_0\" ctype=\"DotNetProject\">",
187 project.Name, 187 project.Name,
188 project.RootNamespace 188 project.RootNamespace
189 ); 189 );
190 190
191 int count = 0; 191 int count = 0;
192 192
193 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); 193 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig);
194 194
195 foreach(ConfigurationNode conf in project.Configurations) 195 foreach(ConfigurationNode conf in project.Configurations)
196 { 196 {
197 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"DotNetProjectConfiguration\">", conf.Name); 197 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"DotNetProjectConfiguration\">", conf.Name);
198 ss.Write(" <Output"); 198 ss.Write(" <Output");
199 ss.Write(" directory=\"{0}\"", Helper.EndPath(Helper.NormalizePath(".\\" + conf.Options["OutputPath"].ToString()))); 199 ss.Write(" directory=\"{0}\"", Helper.EndPath(Helper.NormalizePath(".\\" + conf.Options["OutputPath"].ToString())));
200 ss.Write(" assembly=\"{0}\"", project.AssemblyName); 200 ss.Write(" assembly=\"{0}\"", project.AssemblyName);
201 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); 201 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]);
202 //ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); 202 //ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
203 //ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); 203 //ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
204 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) 204 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
205 { 205 {
206 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); 206 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
207 } 207 }
208 else 208 else
209 { 209 {
210 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); 210 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
211 } 211 }
212 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) 212 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
213 { 213 {
214 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); 214 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
215 } 215 }
216 else 216 else
217 { 217 {
218 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); 218 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
219 } 219 }
220 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); 220 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
221 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); 221 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
222 ss.WriteLine(" />"); 222 ss.WriteLine(" />");
223 223
224 ss.Write(" <Build"); 224 ss.Write(" <Build");
225 ss.Write(" debugmode=\"True\""); 225 ss.Write(" debugmode=\"True\"");
226 if (project.Type == ProjectType.WinExe) 226 if (project.Type == ProjectType.WinExe)
227 { 227 {
228 ss.Write(" target=\"{0}\"", ProjectType.Exe.ToString()); 228 ss.Write(" target=\"{0}\"", ProjectType.Exe.ToString());
229 } 229 }
230 else 230 else
231 { 231 {
232 ss.Write(" target=\"{0}\"", project.Type); 232 ss.Write(" target=\"{0}\"", project.Type);
233 } 233 }
234 ss.WriteLine(" />"); 234 ss.WriteLine(" />");
235 235
236 ss.Write(" <Execution"); 236 ss.Write(" <Execution");
237 ss.Write(" runwithwarnings=\"{0}\"", !conf.Options.WarningsAsErrors); 237 ss.Write(" runwithwarnings=\"{0}\"", !conf.Options.WarningsAsErrors);
238 ss.Write(" consolepause=\"True\""); 238 ss.Write(" consolepause=\"True\"");
239 ss.Write(" runtime=\"{0}\"", netRuntime); 239 ss.Write(" runtime=\"{0}\"", netRuntime);
240 ss.Write(" clr-version=\"Net_2_0\""); 240 ss.Write(" clr-version=\"Net_2_0\"");
241 ss.WriteLine(" />"); 241 ss.WriteLine(" />");
242 242
243 ss.Write(" <CodeGeneration"); 243 ss.Write(" <CodeGeneration");
244 ss.Write(" compiler=\"{0}\"", csComp); 244 ss.Write(" compiler=\"{0}\"", csComp);
245 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); 245 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]);
246 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); 246 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]);
247 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); 247 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]);
248 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); 248 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]);
249 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); 249 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]);
250 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); 250 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]);
251 ss.Write(" mainclass=\"{0}\"", project.StartupObject); 251 ss.Write(" mainclass=\"{0}\"", project.StartupObject);
252 ss.Write(" target=\"{0}\"", project.Type); 252 ss.Write(" target=\"{0}\"", project.Type);
253 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); 253 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]);
254 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); 254 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf));
255 ss.Write(" win32Icon=\"{0}\"", project.AppIcon); 255 ss.Write(" win32Icon=\"{0}\"", project.AppIcon);
256 ss.Write(" ctype=\"CSharpCompilerParameters\""); 256 ss.Write(" ctype=\"CSharpCompilerParameters\"");
257 ss.WriteLine(" />"); 257 ss.WriteLine(" />");
258 ss.WriteLine(" </Configuration>"); 258 ss.WriteLine(" </Configuration>");
259 259
260 count++; 260 count++;
261 } 261 }
262 ss.WriteLine(" </Configurations>"); 262 ss.WriteLine(" </Configurations>");
263 263
264 ss.Write(" <DeploymentInformation"); 264 ss.Write(" <DeploymentInformation");
265 ss.Write(" target=\"\""); 265 ss.Write(" target=\"\"");
266 ss.Write(" script=\"\""); 266 ss.Write(" script=\"\"");
267 ss.Write(" strategy=\"File\""); 267 ss.Write(" strategy=\"File\"");
268 ss.WriteLine(">"); 268 ss.WriteLine(">");
269 ss.WriteLine(" <excludeFiles />"); 269 ss.WriteLine(" <excludeFiles />");
270 ss.WriteLine(" </DeploymentInformation>"); 270 ss.WriteLine(" </DeploymentInformation>");
271 271
272 ss.WriteLine(" <Contents>"); 272 ss.WriteLine(" <Contents>");
273 foreach(string file in project.Files) 273 foreach(string file in project.Files)
274 { 274 {
275 string buildAction; 275 string buildAction;
276 string dependson = ""; 276 string dependson = "";
277 string resource_id = ""; 277 string resource_id = "";
278 string copyToOutput = ""; 278 string copyToOutput = "";
279 279
280 switch(project.Files.GetBuildAction(file)) 280 switch(project.Files.GetBuildAction(file))
281 { 281 {
282 case BuildAction.None: 282 case BuildAction.None:
283 buildAction = "Nothing"; 283 buildAction = "Nothing";
284 break; 284 break;
285 285
286 case BuildAction.Content: 286 case BuildAction.Content:
287 buildAction = "Exclude"; 287 buildAction = "Exclude";
288 break; 288 break;
289 289
290 case BuildAction.EmbeddedResource: 290 case BuildAction.EmbeddedResource:
291 buildAction = "EmbedAsResource"; 291 buildAction = "EmbedAsResource";
292 break; 292 break;
293 293
294 default: 294 default:
295 buildAction = "Compile"; 295 buildAction = "Compile";
296 break; 296 break;
297 } 297 }
298 298
299 if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never) 299 if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never)
300 buildAction = "FileCopy"; 300 buildAction = "FileCopy";
301 301
302 // Sort of a hack, we try and resolve the path and make it relative, if we can. 302 // Sort of a hack, we try and resolve the path and make it relative, if we can.
303 string extension = Path.GetExtension(file); 303 string extension = Path.GetExtension(file);
304 string designer_format = string.Format(".Designer{0}", extension); 304 string designer_format = string.Format(".Designer{0}", extension);
305 305
306 if (file.EndsWith(designer_format)) 306 if (file.EndsWith(designer_format))
307 { 307 {
308 string basename = file.Substring(0, file.LastIndexOf(designer_format)); 308 string basename = file.Substring(0, file.LastIndexOf(designer_format));
309 string[] extensions = new string[] { ".cs", ".resx", ".settings" }; 309 string[] extensions = new string[] { ".cs", ".resx", ".settings" };
310 310
311 foreach(string ext in extensions) 311 foreach(string ext in extensions)
312 { 312 {
313 if (project.Files.Contains(basename + ext)) 313 if (project.Files.Contains(basename + ext))
314 { 314 {
315 dependson = string.Format(" dependson=\"{0}{1}\"", basename, ext); 315 dependson = string.Format(" dependson=\"{0}{1}\"", basename, ext);
316 break; 316 break;
317 } 317 }
318 } 318 }
319 } 319 }
320 if (extension == ".resx") 320 if (extension == ".resx")
321 { 321 {
322 buildAction = "EmbedAsResource"; 322 buildAction = "EmbedAsResource";
323 string basename = file.Substring(0, file.LastIndexOf(".resx")); 323 string basename = file.Substring(0, file.LastIndexOf(".resx"));
324 324
325 // Visual Studio type resx + form dependency 325 // Visual Studio type resx + form dependency
326 if (project.Files.Contains(basename + ".cs")) 326 if (project.Files.Contains(basename + ".cs"))
327 { 327 {
328 dependson = string.Format(" dependson=\"{0}{1}\"", basename, ".cs"); 328 dependson = string.Format(" dependson=\"{0}{1}\"", basename, ".cs");
329 } 329 }
330 330
331 // We need to specify a resources file name to avoid MissingManifestResourceExceptions 331 // We need to specify a resources file name to avoid MissingManifestResourceExceptions
332 // in libraries that are built. 332 // in libraries that are built.
333 resource_id = string.Format(" resource_id=\"{0}.{1}.resources\"", 333 resource_id = string.Format(" resource_id=\"{0}.{1}.resources\"",
334 project.AssemblyName, basename.Replace("/", ".")); 334 project.AssemblyName, basename.Replace("/", "."));
335 } 335 }
336 336
337 switch(project.Files.GetCopyToOutput(file)) 337 switch(project.Files.GetCopyToOutput(file))
338 { 338 {
339 case CopyToOutput.Always: 339 case CopyToOutput.Always:
340 copyToOutput = string.Format(" copyToOutputDirectory=\"Always\""); 340 copyToOutput = string.Format(" copyToOutputDirectory=\"Always\"");
341 break; 341 break;
342 case CopyToOutput.PreserveNewest: 342 case CopyToOutput.PreserveNewest:
343 copyToOutput = string.Format(" copyToOutputDirectory=\"PreserveNewest\""); 343 copyToOutput = string.Format(" copyToOutputDirectory=\"PreserveNewest\"");
344 break; 344 break;
345 } 345 }
346 346
347 // Sort of a hack, we try and resolve the path and make it relative, if we can. 347 // Sort of a hack, we try and resolve the path and make it relative, if we can.
348 string filePath = PrependPath(file); 348 string filePath = PrependPath(file);
349 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\"{2}{3}{4} />", 349 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\"{2}{3}{4} />",
350 filePath, buildAction, dependson, resource_id, copyToOutput); 350 filePath, buildAction, dependson, resource_id, copyToOutput);
351 } 351 }
352 ss.WriteLine(" </Contents>"); 352 ss.WriteLine(" </Contents>");
353 353
354 ss.WriteLine(" <References>"); 354 ss.WriteLine(" <References>");
355 foreach(ReferenceNode refr in project.References) 355 foreach(ReferenceNode refr in project.References)
356 { 356 {
357 ss.WriteLine(" {0}", BuildReference(solution, refr)); 357 ss.WriteLine(" {0}", BuildReference(solution, refr));
358 } 358 }
359 ss.WriteLine(" </References>"); 359 ss.WriteLine(" </References>");
360 360
361 361
362 ss.WriteLine("</Project>"); 362 ss.WriteLine("</Project>");
363 } 363 }
364 364
365 m_Kernel.CurrentWorkingDirectory.Pop(); 365 m_Kernel.CurrentWorkingDirectory.Pop();
366 } 366 }
367 367
368 private void WriteCombine(SolutionNode solution) 368 private void WriteCombine(SolutionNode solution)
369 { 369 {
370 m_Kernel.Log.Write("Creating MonoDevelop combine and project files"); 370 m_Kernel.Log.Write("Creating MonoDevelop combine and project files");
371 foreach(ProjectNode project in solution.Projects) 371 foreach(ProjectNode project in solution.Projects)
372 { 372 {
373 if(m_Kernel.AllowProject(project.FilterGroups)) 373 if(m_Kernel.AllowProject(project.FilterGroups))
374 { 374 {
375 m_Kernel.Log.Write("...Creating project: {0}", project.Name); 375 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
376 WriteProject(solution, project); 376 WriteProject(solution, project);
377 } 377 }
378 } 378 }
379 379
380 m_Kernel.Log.Write(""); 380 m_Kernel.Log.Write("");
381 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); 381 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds");
382 StreamWriter ss = new StreamWriter(combFile); 382 StreamWriter ss = new StreamWriter(combFile);
383 383
384 m_Kernel.CurrentWorkingDirectory.Push(); 384 m_Kernel.CurrentWorkingDirectory.Push();
385 Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); 385 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
386 386
387 int count = 0; 387 int count = 0;
388 388
389 using(ss) 389 using(ss)
390 { 390 {
391 ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name); 391 ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name);
392 392
393 count = 0; 393 count = 0;
394 foreach(ConfigurationNode conf in solution.Configurations) 394 foreach(ConfigurationNode conf in solution.Configurations)
395 { 395 {
396 if(count == 0) 396 if(count == 0)
397 { 397 {
398 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); 398 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name);
399 } 399 }
400 400
401 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name); 401 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name);
402 foreach(ProjectNode project in solution.Projects) 402 foreach(ProjectNode project in solution.Projects)
403 { 403 {
404 ss.WriteLine(" <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name); 404 ss.WriteLine(" <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name);
405 } 405 }
406 ss.WriteLine(" </Configuration>"); 406 ss.WriteLine(" </Configuration>");
407 407
408 count++; 408 count++;
409 } 409 }
410 ss.WriteLine(" </Configurations>"); 410 ss.WriteLine(" </Configurations>");
411 411
412 count = 0; 412 count = 0;
413 413
414 foreach(ProjectNode project in solution.Projects) 414 foreach(ProjectNode project in solution.Projects)
415 { 415 {
416 if(count == 0) 416 if(count == 0)
417 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); 417 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name);
418 418
419 ss.WriteLine(" <Execute type=\"None\" entry=\"{0}\" />", project.Name); 419 ss.WriteLine(" <Execute type=\"None\" entry=\"{0}\" />", project.Name);
420 count++; 420 count++;
421 } 421 }
422 ss.WriteLine(" </StartMode>"); 422 ss.WriteLine(" </StartMode>");
423 423
424 ss.WriteLine(" <Entries>"); 424 ss.WriteLine(" <Entries>");
425 foreach(ProjectNode project in solution.Projects) 425 foreach(ProjectNode project in solution.Projects)
426 { 426 {
427 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); 427 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
428 ss.WriteLine(" <Entry filename=\"{0}\" />", 428 ss.WriteLine(" <Entry filename=\"{0}\" />",
429 Helper.MakeFilePath(path, project.Name, "mdp")); 429 Helper.MakeFilePath(path, project.Name, "mdp"));
430 } 430 }
431 ss.WriteLine(" </Entries>"); 431 ss.WriteLine(" </Entries>");
432 432
433 ss.WriteLine("</Combine>"); 433 ss.WriteLine("</Combine>");
434 } 434 }
435 435
436 m_Kernel.CurrentWorkingDirectory.Pop(); 436 m_Kernel.CurrentWorkingDirectory.Pop();
437 } 437 }
438 438
439 private void CleanProject(ProjectNode project) 439 private void CleanProject(ProjectNode project)
440 { 440 {
441 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); 441 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
442 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp"); 442 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp");
443 Helper.DeleteIfExists(projectFile); 443 Helper.DeleteIfExists(projectFile);
444 } 444 }
445 445
446 private void CleanSolution(SolutionNode solution) 446 private void CleanSolution(SolutionNode solution)
447 { 447 {
448 m_Kernel.Log.Write("Cleaning MonoDevelop combine and project files for", solution.Name); 448 m_Kernel.Log.Write("Cleaning MonoDevelop combine and project files for", solution.Name);
449 449
450 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds"); 450 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds");
451 Helper.DeleteIfExists(slnFile); 451 Helper.DeleteIfExists(slnFile);
452 452
453 foreach(ProjectNode project in solution.Projects) 453 foreach(ProjectNode project in solution.Projects)
454 { 454 {
455 CleanProject(project); 455 CleanProject(project);
456 } 456 }
457 457
458 m_Kernel.Log.Write(""); 458 m_Kernel.Log.Write("");
459 } 459 }
460 460
461 #endregion 461 #endregion
462 462
463 #region ITarget Members 463 #region ITarget Members
464 464
465 /// <summary> 465 /// <summary>
466 /// Writes the specified kern. 466 /// Writes the specified kern.
467 /// </summary> 467 /// </summary>
468 /// <param name="kern">The kern.</param> 468 /// <param name="kern">The kern.</param>
469 public void Write(Kernel kern) 469 public void Write(Kernel kern)
470 { 470 {
471 if( kern == null ) 471 if( kern == null )
472 { 472 {
473 throw new ArgumentNullException("kern"); 473 throw new ArgumentNullException("kern");
474 } 474 }
475 m_Kernel = kern; 475 m_Kernel = kern;
476 foreach(SolutionNode solution in kern.Solutions) 476 foreach(SolutionNode solution in kern.Solutions)
477 { 477 {
478 WriteCombine(solution); 478 WriteCombine(solution);
479 } 479 }
480 m_Kernel = null; 480 m_Kernel = null;
481 } 481 }
482 482
483 /// <summary> 483 /// <summary>
484 /// Cleans the specified kern. 484 /// Cleans the specified kern.
485 /// </summary> 485 /// </summary>
486 /// <param name="kern">The kern.</param> 486 /// <param name="kern">The kern.</param>
487 public virtual void Clean(Kernel kern) 487 public virtual void Clean(Kernel kern)
488 { 488 {
489 if( kern == null ) 489 if( kern == null )
490 { 490 {
491 throw new ArgumentNullException("kern"); 491 throw new ArgumentNullException("kern");
492 } 492 }
493 m_Kernel = kern; 493 m_Kernel = kern;
494 foreach(SolutionNode sol in kern.Solutions) 494 foreach(SolutionNode sol in kern.Solutions)
495 { 495 {
496 CleanSolution(sol); 496 CleanSolution(sol);
497 } 497 }
498 m_Kernel = null; 498 m_Kernel = null;
499 } 499 }
500 500
501 /// <summary> 501 /// <summary>
502 /// Gets the name. 502 /// Gets the name.
503 /// </summary> 503 /// </summary>
504 /// <value>The name.</value> 504 /// <value>The name.</value>
505 public string Name 505 public string Name
506 { 506 {
507 get 507 get
508 { 508 {
509 return "sharpdev"; 509 return "sharpdev";
510 } 510 }
511 } 511 }
512 512
513 #endregion 513 #endregion
514 } 514 }
515} 515}
diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs
index 21bc80e..925f5ca 100644
--- a/Prebuild/src/Core/Targets/NAntTarget.cs
+++ b/Prebuild/src/Core/Targets/NAntTarget.cs
@@ -47,36 +47,36 @@ using Prebuild.Core.Utilities;
47 47
48namespace Prebuild.Core.Targets 48namespace Prebuild.Core.Targets
49{ 49{
50 /// <summary> 50 /// <summary>
51 /// 51 ///
52 /// </summary> 52 /// </summary>
53 [Target("nant")] 53 [Target("nant")]
54 public class NAntTarget : ITarget 54 public class NAntTarget : ITarget
55 { 55 {
56 #region Fields 56 #region Fields
57 57
58 private Kernel m_Kernel; 58 private Kernel m_Kernel;
59 59
60 #endregion 60 #endregion
61 61
62 #region Private Methods 62 #region Private Methods
63 63
64 private static string PrependPath(string path) 64 private static string PrependPath(string path)
65 { 65 {
66 string tmpPath = Helper.NormalizePath(path, '/'); 66 string tmpPath = Helper.NormalizePath(path, '/');
67 Regex regex = new Regex(@"(\w):/(\w+)"); 67 Regex regex = new Regex(@"(\w):/(\w+)");
68 Match match = regex.Match(tmpPath); 68 Match match = regex.Match(tmpPath);
69 //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') 69 //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
70 //{ 70 //{
71 tmpPath = Helper.NormalizePath(tmpPath); 71 tmpPath = Helper.NormalizePath(tmpPath);
72 //} 72 //}
73 // else 73 // else
74 // { 74 // {
75 // tmpPath = Helper.NormalizePath("./" + tmpPath); 75 // tmpPath = Helper.NormalizePath("./" + tmpPath);
76 // } 76 // }
77 77
78 return tmpPath; 78 return tmpPath;
79 } 79 }
80 80
81 private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr) 81 private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr)
82 { 82 {
@@ -85,7 +85,7 @@ namespace Prebuild.Core.Targets
85 { 85 {
86 return refr.Path; 86 return refr.Path;
87 } 87 }
88 88
89 if (solution.ProjectsTable.ContainsKey(refr.Name)) 89 if (solution.ProjectsTable.ContainsKey(refr.Name))
90 { 90 {
91 ProjectNode projectRef = (ProjectNode) solution.ProjectsTable[refr.Name]; 91 ProjectNode projectRef = (ProjectNode) solution.ProjectsTable[refr.Name];
@@ -113,7 +113,7 @@ namespace Prebuild.Core.Targets
113 return refr.Name + ".dll"; 113 return refr.Name + ".dll";
114 } 114 }
115 115
116 public static string GetRefFileName(string refName) 116 public static string GetRefFileName(string refName)
117 { 117 {
118 if (ExtensionSpecified(refName)) 118 if (ExtensionSpecified(refName))
119 { 119 {
@@ -140,11 +140,11 @@ namespace Prebuild.Core.Targets
140 return extension; 140 return extension;
141 } 141 }
142 142
143 private static string FindFileReference(string refName, ProjectNode project) 143 private static string FindFileReference(string refName, ProjectNode project)
144 { 144 {
145 foreach (ReferencePathNode refPath in project.ReferencePaths) 145 foreach (ReferencePathNode refPath in project.ReferencePaths)
146 { 146 {
147 string fullPath = Helper.MakeFilePath(refPath.Path, refName); 147 string fullPath = Helper.MakeFilePath(refPath.Path, refName);
148 148
149 if (File.Exists(fullPath)) 149 if (File.Exists(fullPath))
150 { 150 {
@@ -153,10 +153,10 @@ namespace Prebuild.Core.Targets
153 153
154 fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); 154 fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
155 155
156 if (File.Exists(fullPath)) 156 if (File.Exists(fullPath))
157 { 157 {
158 return fullPath; 158 return fullPath;
159 } 159 }
160 160
161 fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe"); 161 fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe");
162 162
@@ -164,162 +164,205 @@ namespace Prebuild.Core.Targets
164 { 164 {
165 return fullPath; 165 return fullPath;
166 } 166 }
167 } 167 }
168 168
169 return null; 169 return null;
170 } 170 }
171 171
172 /// <summary> 172 /// <summary>
173 /// Gets the XML doc file. 173 /// Gets the XML doc file.
174 /// </summary> 174 /// </summary>
175 /// <param name="project">The project.</param> 175 /// <param name="project">The project.</param>
176 /// <param name="conf">The conf.</param> 176 /// <param name="conf">The conf.</param>
177 /// <returns></returns> 177 /// <returns></returns>
178 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) 178 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
179 { 179 {
180 if (conf == null) 180 if (conf == null)
181 { 181 {
182 throw new ArgumentNullException("conf"); 182 throw new ArgumentNullException("conf");
183 } 183 }
184 if (project == null) 184 if (project == null)
185 { 185 {
186 throw new ArgumentNullException("project"); 186 throw new ArgumentNullException("project");
187 } 187 }
188 string docFile = (string)conf.Options["XmlDocFile"]; 188 string docFile = (string)conf.Options["XmlDocFile"];
189 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified 189 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
190 // { 190 // {
191 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; 191 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
192 // } 192 // }
193 return docFile; 193 return docFile;
194 } 194 }
195 195
196 private void WriteProject(SolutionNode solution, ProjectNode project) 196 private void WriteProject(SolutionNode solution, ProjectNode project)
197 { 197 {
198 string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build"); 198 string projFile = Helper.MakeFilePath(project.FullPath, project.Name + GetProjectExtension(project), "build");
199 StreamWriter ss = new StreamWriter(projFile); 199 StreamWriter ss = new StreamWriter(projFile);
200 200
201 m_Kernel.CurrentWorkingDirectory.Push(); 201 m_Kernel.CurrentWorkingDirectory.Push();
202 Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); 202 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
203 bool hasDoc = false; 203 bool hasDoc = false;
204 204
205 using (ss) 205 using (ss)
206 { 206 {
207 ss.WriteLine("<?xml version=\"1.0\" ?>"); 207 ss.WriteLine("<?xml version=\"1.0\" ?>");
208 ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name); 208 ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name);
209 ss.WriteLine(" <target name=\"{0}\">", "build"); 209 ss.WriteLine(" <target name=\"{0}\">", "build");
210 ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />"); 210 ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />");
211 ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />"); 211 ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />");
212 212 ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\" flatten=\"true\">");
213 ss.Write(" <csc "); 213 ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
214 ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower()); 214 foreach (ReferenceNode refr in project.References)
215 ss.Write(" debug=\"{0}\"", "${build.debug}"); 215 {
216 ss.Write(" platform=\"${build.platform}\""); 216 if (refr.LocalCopy)
217 217 {
218 218 ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)) + "\" />", '/'));
219 foreach (ConfigurationNode conf in project.Configurations) 219 }
220 { 220 }
221 if (conf.Options.KeyFile != "") 221
222 { 222 ss.WriteLine(" </fileset>");
223 ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile); 223 ss.WriteLine(" </copy>");
224 break; 224 if (project.ConfigFile != null && project.ConfigFile.Length!=0)
225 } 225 {
226 } 226 ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${project::get-base-directory()}/${build.dir}/${project::get-name()}");
227 foreach (ConfigurationNode conf in project.Configurations) 227
228 { 228 if (project.Type == ProjectType.Library)
229 ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe); 229 {
230 break; 230 ss.Write(".dll.config\"");
231 } 231 }
232 foreach (ConfigurationNode conf in project.Configurations) 232 else
233 { 233 {
234 ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors); 234 ss.Write(".exe.config\"");
235 break; 235 }
236 } 236 ss.WriteLine(" />");
237 foreach (ConfigurationNode conf in project.Configurations) 237 }
238 { 238
239 ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines); 239 // Add the content files to just be copied
240 break; 240 ss.WriteLine(" {0}", "<copy todir=\"${project::get-base-directory()}/${build.dir}\">");
241 } 241 ss.WriteLine(" {0}", "<fileset basedir=\".\">");
242 foreach (ConfigurationNode conf in project.Configurations) 242
243 { 243 foreach (string file in project.Files)
244 ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); 244 {
245 break; 245 // Ignore if we aren't content
246 } 246 if (project.Files.GetBuildAction(file) != BuildAction.Content)
247 247 continue;
248 ss.Write(" main=\"{0}\"", project.StartupObject); 248
249 249 // Create a include tag
250 foreach (ConfigurationNode conf in project.Configurations) 250 ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
251 { 251 }
252 if (GetXmlDocFile(project, conf) != "") 252
253 { 253 ss.WriteLine(" {0}", "</fileset>");
254 ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf)); 254 ss.WriteLine(" {0}", "</copy>");
255 hasDoc = true; 255
256 } 256 ss.Write(" <csc ");
257 break; 257 ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower());
258 } 258 ss.Write(" debug=\"{0}\"", "${build.debug}");
259 ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}"); 259 ss.Write(" platform=\"${build.platform}\"");
260 if (project.Type == ProjectType.Library) 260
261 { 261
262 ss.Write(".dll\""); 262 foreach (ConfigurationNode conf in project.Configurations)
263 } 263 {
264 else 264 if (conf.Options.KeyFile != "")
265 { 265 {
266 ss.Write(".exe\""); 266 ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile);
267 } 267 break;
268 if (project.AppIcon != null && project.AppIcon.Length != 0) 268 }
269 { 269 }
270 ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/')); 270 foreach (ConfigurationNode conf in project.Configurations)
271 } 271 {
272 ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe);
273 break;
274 }
275 foreach (ConfigurationNode conf in project.Configurations)
276 {
277 ss.Write(" warnaserror=\"{0}\"", conf.Options.WarningsAsErrors);
278 break;
279 }
280 foreach (ConfigurationNode conf in project.Configurations)
281 {
282 ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines);
283 break;
284 }
285 foreach (ConfigurationNode conf in project.Configurations)
286 {
287 ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]);
288 break;
289 }
290
291 ss.Write(" main=\"{0}\"", project.StartupObject);
292
293 foreach (ConfigurationNode conf in project.Configurations)
294 {
295 if (GetXmlDocFile(project, conf) != "")
296 {
297 ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf));
298 hasDoc = true;
299 }
300 break;
301 }
302 ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}");
303 if (project.Type == ProjectType.Library)
304 {
305 ss.Write(".dll\"");
306 }
307 else
308 {
309 ss.Write(".exe\"");
310 }
311 if (project.AppIcon != null && project.AppIcon.Length != 0)
312 {
313 ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon, '/'));
314 }
272 // This disables a very different behavior between VS and NAnt. With Nant, 315 // This disables a very different behavior between VS and NAnt. With Nant,
273 // If you have using System.Xml; it will ensure System.Xml.dll is referenced, 316 // If you have using System.Xml; it will ensure System.Xml.dll is referenced,
274 // but not in VS. This will force the behaviors to match, so when it works 317 // but not in VS. This will force the behaviors to match, so when it works
275 // in nant, it will work in VS. 318 // in nant, it will work in VS.
276 ss.Write(" noconfig=\"true\""); 319 ss.Write(" noconfig=\"true\"");
277 ss.WriteLine(">"); 320 ss.WriteLine(">");
278 ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace); 321 ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace);
279 foreach (string file in project.Files) 322 foreach (string file in project.Files)
280 { 323 {
281 switch (project.Files.GetBuildAction(file)) 324 switch (project.Files.GetBuildAction(file))
282 { 325 {
283 case BuildAction.EmbeddedResource: 326 case BuildAction.EmbeddedResource:
284 ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); 327 ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
285 break; 328 break;
286 default: 329 default:
287 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) 330 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
288 { 331 {
289 ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx"); 332 ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx");
290 } 333 }
291 break; 334 break;
292 } 335 }
293 } 336 }
294 //if (project.Files.GetSubType(file).ToString() != "Code") 337 //if (project.Files.GetSubType(file).ToString() != "Code")
295 //{ 338 //{
296 // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); 339 // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
297 340
298 ss.WriteLine(" </resources>"); 341 ss.WriteLine(" </resources>");
299 ss.WriteLine(" <sources failonempty=\"true\">"); 342 ss.WriteLine(" <sources failonempty=\"true\">");
300 foreach (string file in project.Files) 343 foreach (string file in project.Files)
301 { 344 {
302 switch (project.Files.GetBuildAction(file)) 345 switch (project.Files.GetBuildAction(file))
303 { 346 {
304 case BuildAction.Compile: 347 case BuildAction.Compile:
305 ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />"); 348 ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
306 break; 349 break;
307 default: 350 default:
308 break; 351 break;
309 } 352 }
310 } 353 }
311 ss.WriteLine(" </sources>"); 354 ss.WriteLine(" </sources>");
312 ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">"); 355 ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">");
313 ss.WriteLine(" <lib>"); 356 ss.WriteLine(" <lib>");
314 ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />"); 357 ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />");
315 foreach(ReferencePathNode refPath in project.ReferencePaths) 358 foreach(ReferencePathNode refPath in project.ReferencePaths)
316 { 359 {
317 ss.WriteLine(" <include name=\"${project::get-base-directory()}/" + refPath.Path.TrimEnd('/', '\\') + "\" />"); 360 ss.WriteLine(" <include name=\"${project::get-base-directory()}/" + refPath.Path.TrimEnd('/', '\\') + "\" />");
318 } 361 }
319 ss.WriteLine(" </lib>"); 362 ss.WriteLine(" </lib>");
320 foreach (ReferenceNode refr in project.References) 363 foreach (ReferenceNode refr in project.References)
321 { 364 {
322 string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); 365 string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/');
323 if (refr.Path != null) { 366 if (refr.Path != null) {
324 if (ExtensionSpecified(refr.Name)) 367 if (ExtensionSpecified(refr.Name))
325 { 368 {
@@ -334,12 +377,12 @@ namespace Prebuild.Core.Targets
334 { 377 {
335 ss.WriteLine (" <include name=\"" + path + "\" />"); 378 ss.WriteLine (" <include name=\"" + path + "\" />");
336 } 379 }
337 } 380 }
338 ss.WriteLine(" </references>"); 381 ss.WriteLine(" </references>");
339 382
340 ss.WriteLine(" </csc>"); 383 ss.WriteLine(" </csc>");
341 384
342 foreach (ConfigurationNode conf in project.Configurations) 385 foreach (ConfigurationNode conf in project.Configurations)
343 { 386 {
344 if (!String.IsNullOrEmpty(conf.Options.OutputPath)) 387 if (!String.IsNullOrEmpty(conf.Options.OutputPath))
345 { 388 {
@@ -361,170 +404,170 @@ namespace Prebuild.Core.Targets
361 } 404 }
362 } 405 }
363 406
364 ss.WriteLine(" </target>"); 407 ss.WriteLine(" </target>");
365 408
366 ss.WriteLine(" <target name=\"clean\">"); 409 ss.WriteLine(" <target name=\"clean\">");
367 ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />"); 410 ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
368 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); 411 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
369 ss.WriteLine(" </target>"); 412 ss.WriteLine(" </target>");
370 413
371 ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">"); 414 ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">");
372 if (hasDoc) 415 if (hasDoc)
373 { 416 {
374 ss.WriteLine(" <property name=\"doc.target\" value=\"\" />"); 417 ss.WriteLine(" <property name=\"doc.target\" value=\"\" />");
375 ss.WriteLine(" <if test=\"${platform::is-unix()}\">"); 418 ss.WriteLine(" <if test=\"${platform::is-unix()}\">");
376 ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />"); 419 ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />");
377 ss.WriteLine(" </if>"); 420 ss.WriteLine(" </if>");
378 ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">"); 421 ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">");
379 ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">"); 422 ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">");
380 ss.Write(" <include name=\"${build.dir}/${project::get-name()}"); 423 ss.Write(" <include name=\"${build.dir}/${project::get-name()}");
381 if (project.Type == ProjectType.Library) 424 if (project.Type == ProjectType.Library)
382 { 425 {
383 ss.WriteLine(".dll\" />"); 426 ss.WriteLine(".dll\" />");
384 } 427 }
385 else 428 else
386 { 429 {
387 ss.WriteLine(".exe\" />"); 430 ss.WriteLine(".exe\" />");
388 } 431 }
389 432
390 ss.WriteLine(" </assemblies>"); 433 ss.WriteLine(" </assemblies>");
391 ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">"); 434 ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">");
392 ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>"); 435 ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>");
393 ss.WriteLine(" </summaries>"); 436 ss.WriteLine(" </summaries>");
394 ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">"); 437 ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">");
395 ss.WriteLine(" <include name=\"${build.dir}\" />"); 438 ss.WriteLine(" <include name=\"${build.dir}\" />");
396 // foreach(ReferenceNode refr in project.References) 439 // foreach(ReferenceNode refr in project.References)
397 // { 440 // {
398 // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/'); 441 // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
399 // if (path != "") 442 // if (path != "")
400 // { 443 // {
401 // ss.WriteLine(" <include name=\"{0}\" />", path); 444 // ss.WriteLine(" <include name=\"{0}\" />", path);
402 // } 445 // }
403 // } 446 // }
404 ss.WriteLine(" </referencepaths>"); 447 ss.WriteLine(" </referencepaths>");
405 ss.WriteLine(" <documenters>"); 448 ss.WriteLine(" <documenters>");
406 ss.WriteLine(" <documenter name=\"MSDN\">"); 449 ss.WriteLine(" <documenter name=\"MSDN\">");
407 ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />"); 450 ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />");
408 ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />"); 451 ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />");
409 ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />"); 452 ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />");
410 ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />"); 453 ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />");
411 ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />"); 454 ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />");
412 ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />"); 455 ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />");
413 ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />"); 456 ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />");
414 ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />"); 457 ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />");
415 ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />"); 458 ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />");
416 ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />"); 459 ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />");
417 ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />"); 460 ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />");
418 ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />"); 461 ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />");
419 ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />"); 462 ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />");
420 ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />"); 463 ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />");
421 ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />"); 464 ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />");
422 ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />"); 465 ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />");
423 ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />"); 466 ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />");
424 ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />"); 467 ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />");
425 ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />"); 468 ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />");
426 ss.WriteLine(" </documenter>"); 469 ss.WriteLine(" </documenter>");
427 ss.WriteLine(" </documenters>"); 470 ss.WriteLine(" </documenters>");
428 ss.WriteLine(" </ndoc>"); 471 ss.WriteLine(" </ndoc>");
429 } 472 }
430 ss.WriteLine(" </target>"); 473 ss.WriteLine(" </target>");
431 ss.WriteLine("</project>"); 474 ss.WriteLine("</project>");
432 } 475 }
433 m_Kernel.CurrentWorkingDirectory.Pop(); 476 m_Kernel.CurrentWorkingDirectory.Pop();
434 } 477 }
435 478
436 private void WriteCombine(SolutionNode solution) 479 private void WriteCombine(SolutionNode solution)
437 { 480 {
438 m_Kernel.Log.Write("Creating NAnt build files"); 481 m_Kernel.Log.Write("Creating NAnt build files");
439 foreach (ProjectNode project in solution.Projects) 482 foreach (ProjectNode project in solution.Projects)
440 { 483 {
441 if (m_Kernel.AllowProject(project.FilterGroups)) 484 if (m_Kernel.AllowProject(project.FilterGroups))
442 { 485 {
443 m_Kernel.Log.Write("...Creating project: {0}", project.Name); 486 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
444 WriteProject(solution, project); 487 WriteProject(solution, project);
445 } 488 }
446 } 489 }
447 490
448 m_Kernel.Log.Write(""); 491 m_Kernel.Log.Write("");
449 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build"); 492 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
450 StreamWriter ss = new StreamWriter(combFile); 493 StreamWriter ss = new StreamWriter(combFile);
451 494
452 m_Kernel.CurrentWorkingDirectory.Push(); 495 m_Kernel.CurrentWorkingDirectory.Push();
453 Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); 496 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
454 497
455 using (ss) 498 using (ss)
456 { 499 {
457 ss.WriteLine("<?xml version=\"1.0\" ?>"); 500 ss.WriteLine("<?xml version=\"1.0\" ?>");
458 ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name); 501 ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
459 ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>"); 502 ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
460 ss.WriteLine(); 503 ss.WriteLine();
461 504
462 //ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />"); 505 //ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />");
463 //ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />"); 506 //ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />");
464 ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />"); 507 ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />");
465 ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />"); 508 ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />");
466 ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />"); 509 ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />");
467 ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />"); 510 ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");
468 511
469 // Use the active configuration, which is the first configuration name in the prebuild file. 512 // Use the active configuration, which is the first configuration name in the prebuild file.
470 Dictionary<string,string> emittedConfigurations = new Dictionary<string, string>(); 513 Dictionary<string,string> emittedConfigurations = new Dictionary<string, string>();
471 514
472 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig); 515 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig);
473 ss.WriteLine(); 516 ss.WriteLine();
474 517
475 foreach (ConfigurationNode conf in solution.Configurations) 518 foreach (ConfigurationNode conf in solution.Configurations)
476 { 519 {
477 // If the name isn't in the emitted configurations, we give a high level target to the 520 // If the name isn't in the emitted configurations, we give a high level target to the
478 // platform specific on. This lets "Debug" point to "Debug-AnyCPU". 521 // platform specific on. This lets "Debug" point to "Debug-AnyCPU".
479 if (!emittedConfigurations.ContainsKey(conf.Name)) 522 if (!emittedConfigurations.ContainsKey(conf.Name))
480 { 523 {
481 // Add it to the dictionary so we only emit one. 524 // Add it to the dictionary so we only emit one.
482 emittedConfigurations.Add(conf.Name, conf.Platform); 525 emittedConfigurations.Add(conf.Name, conf.Platform);
483 526
484 // Write out the target block. 527 // Write out the target block.
485 ss.WriteLine(" <target name=\"{0}\" description=\"{0}|{1}\" depends=\"{0}-{1}\">", conf.Name, conf.Platform); 528 ss.WriteLine(" <target name=\"{0}\" description=\"{0}|{1}\" depends=\"{0}-{1}\">", conf.Name, conf.Platform);
486 ss.WriteLine(" </target>"); 529 ss.WriteLine(" </target>");
487 ss.WriteLine(); 530 ss.WriteLine();
488 } 531 }
489 532
490 // Write out the target for the configuration. 533 // Write out the target for the configuration.
491 ss.WriteLine(" <target name=\"{0}-{1}\" description=\"{0}|{1}\">", conf.Name, conf.Platform); 534 ss.WriteLine(" <target name=\"{0}-{1}\" description=\"{0}|{1}\">", conf.Name, conf.Platform);
492 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name); 535 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name);
493 ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower()); 536 ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
494 ss.WriteLine("\t\t <property name=\"build.platform\" value=\"{0}\" />", conf.Platform); 537 ss.WriteLine("\t\t <property name=\"build.platform\" value=\"{0}\" />", conf.Platform);
495 ss.WriteLine(" </target>"); 538 ss.WriteLine(" </target>");
496 ss.WriteLine(); 539 ss.WriteLine();
497 } 540 }
498 541
499 ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">"); 542 ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
500 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />"); 543 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
501 ss.WriteLine(" </target>"); 544 ss.WriteLine(" </target>");
502 ss.WriteLine(); 545 ss.WriteLine();
503 546
504 ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">"); 547 ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
505 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />"); 548 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
506 ss.WriteLine(" </target>"); 549 ss.WriteLine(" </target>");
507 ss.WriteLine(); 550 ss.WriteLine();
508 551
509 ss.WriteLine(" <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">"); 552 ss.WriteLine(" <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">");
510 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />"); 553 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />");
511 ss.WriteLine(" </target>"); 554 ss.WriteLine(" </target>");
512 ss.WriteLine(); 555 ss.WriteLine();
513 556
514 ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">"); 557 ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
515 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />"); 558 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
516 ss.WriteLine(" </target>"); 559 ss.WriteLine(" </target>");
517 ss.WriteLine(); 560 ss.WriteLine();
518 561
519 ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">"); 562 ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
520 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />"); 563 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
521 ss.WriteLine(" </target>"); 564 ss.WriteLine(" </target>");
522 ss.WriteLine(); 565 ss.WriteLine();
523 566
524 ss.WriteLine(" <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">"); 567 ss.WriteLine(" <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">");
525 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />"); 568 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />");
526 ss.WriteLine(" </target>"); 569 ss.WriteLine(" </target>");
527 ss.WriteLine(); 570 ss.WriteLine();
528 571
529 ss.WriteLine(" <target name=\"init\" description=\"\">"); 572 ss.WriteLine(" <target name=\"init\" description=\"\">");
530 ss.WriteLine(" <call target=\"${project.config}\" />"); 573 ss.WriteLine(" <call target=\"${project.config}\" />");
@@ -594,24 +637,6 @@ namespace Prebuild.Core.Targets
594 ss.WriteLine(" <target name=\"clean\" description=\"\">"); 637 ss.WriteLine(" <target name=\"clean\" description=\"\">");
595 ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />"); 638 ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />");
596 //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />"); 639 //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
597
598 // justincc: FIXME FIXME FIXME - A temporary OpenSim hack to clean up files when "nant clean" is executed.
599 // Should be replaced with extreme prejudice once anybody finds out if the CleanFiles stuff works or there is
600 // another working mechanism for specifying this stuff
601 ss.WriteLine(" <delete failonerror=\"false\">");
602 ss.WriteLine(" <fileset basedir=\"${bin.dir}\">");
603 ss.WriteLine(" <include name=\"OpenSim*.dll\"/>");
604 ss.WriteLine(" <include name=\"OpenSim*.dll.mdb\"/>");
605 ss.WriteLine(" <include name=\"OpenSim*.exe\"/>");
606 ss.WriteLine(" <include name=\"OpenSim*.exe.mdb\"/>");
607 ss.WriteLine(" <include name=\"ScriptEngines/*\"/>");
608 ss.WriteLine(" <include name=\"Physics/*.dll\"/>");
609 ss.WriteLine(" <include name=\"Physics/*.dll.mdb\"/>");
610 ss.WriteLine(" <exclude name=\"OpenSim.32BitLaunch.exe\"/>");
611 ss.WriteLine(" <exclude name=\"ScriptEngines/Default.lsl\"/>");
612 ss.WriteLine(" </fileset>");
613 ss.WriteLine(" </delete>");
614
615 if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0) 640 if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0)
616 { 641 {
617 foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles) 642 foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles)
@@ -625,7 +650,7 @@ namespace Prebuild.Core.Targets
625 } 650 }
626 } 651 }
627 652
628 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />"); 653 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
629 foreach (ProjectNode project in solution.Projects) 654 foreach (ProjectNode project in solution.Projects)
630 { 655 {
631 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); 656 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
diff --git a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
index 40a210d..66dd1bc 100644
--- a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
+++ b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -29,11 +29,11 @@ using Prebuild.Core.Attributes;
29 29
30namespace Prebuild.Core.Targets 30namespace Prebuild.Core.Targets
31{ 31{
32 /// <summary> 32 /// <summary>
33 /// 33 ///
34 /// </summary> 34 /// </summary>
35 [Target("sharpdev2")] 35 [Target("sharpdev2")]
36 public class SharpDevelop2Target : VS2005Target 36 public class SharpDevelop2Target : VS2005Target
37 { 37 {
38 #region Properties 38 #region Properties
39 public override string VersionName 39 public override string VersionName
@@ -45,38 +45,38 @@ namespace Prebuild.Core.Targets
45 } 45 }
46 #endregion 46 #endregion
47 47
48 #region Public Methods 48 #region Public Methods
49 49
50 /// <summary> 50 /// <summary>
51 /// Writes the specified kern. 51 /// Writes the specified kern.
52 /// </summary> 52 /// </summary>
53 /// <param name="kern">The kern.</param> 53 /// <param name="kern">The kern.</param>
54 public override void Write(Kernel kern) 54 public override void Write(Kernel kern)
55 { 55 {
56 base.Write(kern); 56 base.Write(kern);
57 } 57 }
58 58
59 /// <summary> 59 /// <summary>
60 /// Cleans the specified kern. 60 /// Cleans the specified kern.
61 /// </summary> 61 /// </summary>
62 /// <param name="kern">The kern.</param> 62 /// <param name="kern">The kern.</param>
63 public override void Clean(Kernel kern) 63 public override void Clean(Kernel kern)
64 { 64 {
65 base.Clean(kern); 65 base.Clean(kern);
66 } 66 }
67 67
68 /// <summary> 68 /// <summary>
69 /// Gets the name. 69 /// Gets the name.
70 /// </summary> 70 /// </summary>
71 /// <value>The name.</value> 71 /// <value>The name.</value>
72 public override string Name 72 public override string Name
73 { 73 {
74 get 74 get
75 { 75 {
76 return "sharpdev2"; 76 return "sharpdev2";
77 } 77 }
78 } 78 }
79 79
80 #endregion 80 #endregion
81 } 81 }
82} 82}
diff --git a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs
index acab9f4..8e32050 100644
--- a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs
+++ b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,392 +34,392 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Targets 35namespace Prebuild.Core.Targets
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [Target("sharpdev")] 40 [Target("sharpdev")]
41 public class SharpDevelopTarget : ITarget 41 public class SharpDevelopTarget : ITarget
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 private Kernel m_Kernel; 45 private Kernel m_Kernel;
46 46
47 #endregion 47 #endregion
48 48
49 #region Private Methods 49 #region Private Methods
50 50
51 private static string PrependPath(string path) 51 private static string PrependPath(string path)
52 { 52 {
53 string tmpPath = Helper.NormalizePath(path, '/'); 53 string tmpPath = Helper.NormalizePath(path, '/');
54 Regex regex = new Regex(@"(\w):/(\w+)"); 54 Regex regex = new Regex(@"(\w):/(\w+)");
55 Match match = regex.Match(tmpPath); 55 Match match = regex.Match(tmpPath);
56 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') 56 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
57 { 57 {
58 tmpPath = Helper.NormalizePath(tmpPath); 58 tmpPath = Helper.NormalizePath(tmpPath);
59 } 59 }
60 else 60 else
61 { 61 {
62 tmpPath = Helper.NormalizePath("./" + tmpPath); 62 tmpPath = Helper.NormalizePath("./" + tmpPath);
63 } 63 }
64 64
65 return tmpPath; 65 return tmpPath;
66 } 66 }
67 67
68 private static string BuildReference(SolutionNode solution, ReferenceNode refr) 68 private static string BuildReference(SolutionNode solution, ReferenceNode refr)
69 { 69 {
70 string ret = "<Reference type=\""; 70 string ret = "<Reference type=\"";
71 if(solution.ProjectsTable.ContainsKey(refr.Name)) 71 if(solution.ProjectsTable.ContainsKey(refr.Name))
72 { 72 {
73 ret += "Project\" refto=\"" + refr.Name; 73 ret += "Project\" refto=\"" + refr.Name;
74 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; 74 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
75 } 75 }
76 else 76 else
77 { 77 {
78 ProjectNode project = (ProjectNode)refr.Parent; 78 ProjectNode project = (ProjectNode)refr.Parent;
79 string fileRef = FindFileReference(refr.Name, project); 79 string fileRef = FindFileReference(refr.Name, project);
80 80
81 if(refr.Path != null || fileRef != null) 81 if(refr.Path != null || fileRef != null)
82 { 82 {
83 ret += "Assembly\" refto=\""; 83 ret += "Assembly\" refto=\"";
84 84
85 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef; 85 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef;
86 86
87 ret += finalPath; 87 ret += finalPath;
88 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; 88 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
89 return ret; 89 return ret;
90 } 90 }
91 91
92 ret += "Gac\" refto=\""; 92 ret += "Gac\" refto=\"";
93 try 93 try
94 { 94 {
95 //Assembly assem = Assembly.Load(refr.Name); 95 //Assembly assem = Assembly.Load(refr.Name);
96 ret += refr.Name;// assem.FullName; 96 ret += refr.Name;// assem.FullName;
97 } 97 }
98 catch (System.NullReferenceException e) 98 catch (System.NullReferenceException e)
99 { 99 {
100 e.ToString(); 100 e.ToString();
101 ret += refr.Name; 101 ret += refr.Name;
102 } 102 }
103 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />"; 103 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
104 } 104 }
105 105
106 return ret; 106 return ret;
107 } 107 }
108 108
109 private static string FindFileReference(string refName, ProjectNode project) 109 private static string FindFileReference(string refName, ProjectNode project)
110 { 110 {
111 foreach(ReferencePathNode refPath in project.ReferencePaths) 111 foreach(ReferencePathNode refPath in project.ReferencePaths)
112 { 112 {
113 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); 113 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
114 114
115 if(File.Exists(fullPath)) 115 if(File.Exists(fullPath))
116 { 116 {
117 return fullPath; 117 return fullPath;
118 } 118 }
119 } 119 }
120 120
121 return null; 121 return null;
122 } 122 }
123 123
124 /// <summary> 124 /// <summary>
125 /// Gets the XML doc file. 125 /// Gets the XML doc file.
126 /// </summary> 126 /// </summary>
127 /// <param name="project">The project.</param> 127 /// <param name="project">The project.</param>
128 /// <param name="conf">The conf.</param> 128 /// <param name="conf">The conf.</param>
129 /// <returns></returns> 129 /// <returns></returns>
130 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf) 130 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf)
131 { 131 {
132 if( conf == null ) 132 if( conf == null )
133 { 133 {
134 throw new ArgumentNullException("conf"); 134 throw new ArgumentNullException("conf");
135 } 135 }
136 if( project == null ) 136 if( project == null )
137 { 137 {
138 throw new ArgumentNullException("project"); 138 throw new ArgumentNullException("project");
139 } 139 }
140 string docFile = (string)conf.Options["XmlDocFile"]; 140 string docFile = (string)conf.Options["XmlDocFile"];
141 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified 141 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
142 { 142 {
143 return "False"; 143 return "False";
144 } 144 }
145 return "True"; 145 return "True";
146 } 146 }
147 147
148 private void WriteProject(SolutionNode solution, ProjectNode project) 148 private void WriteProject(SolutionNode solution, ProjectNode project)
149 { 149 {
150 string csComp = "Csc"; 150 string csComp = "Csc";
151 string netRuntime = "MsNet"; 151 string netRuntime = "MsNet";
152 if(project.Runtime == ClrRuntime.Mono) 152 if(project.Runtime == ClrRuntime.Mono)
153 { 153 {
154 csComp = "Mcs"; 154 csComp = "Mcs";
155 netRuntime = "Mono"; 155 netRuntime = "Mono";
156 } 156 }
157 157
158 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); 158 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx");
159 StreamWriter ss = new StreamWriter(projFile); 159 StreamWriter ss = new StreamWriter(projFile);
160 160
161 m_Kernel.CurrentWorkingDirectory.Push(); 161 m_Kernel.CurrentWorkingDirectory.Push();
162 Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); 162 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
163 163
164 using(ss) 164 using(ss)
165 { 165 {
166 ss.WriteLine( 166 ss.WriteLine(
167 "<Project name=\"{0}\" standardNamespace=\"{1}\" description=\"\" newfilesearch=\"None\" enableviewstate=\"True\" version=\"1.1\" projecttype=\"C#\">", 167 "<Project name=\"{0}\" standardNamespace=\"{1}\" description=\"\" newfilesearch=\"None\" enableviewstate=\"True\" version=\"1.1\" projecttype=\"C#\">",
168 project.Name, 168 project.Name,
169 project.RootNamespace 169 project.RootNamespace
170 ); 170 );
171 171
172 ss.WriteLine(" <Contents>"); 172 ss.WriteLine(" <Contents>");
173 foreach(string file in project.Files) 173 foreach(string file in project.Files)
174 { 174 {
175 string buildAction = "Compile"; 175 string buildAction = "Compile";
176 switch(project.Files.GetBuildAction(file)) 176 switch(project.Files.GetBuildAction(file))
177 { 177 {
178 case BuildAction.None: 178 case BuildAction.None:
179 buildAction = "Nothing"; 179 buildAction = "Nothing";
180 break; 180 break;
181 181
182 case BuildAction.Content: 182 case BuildAction.Content:
183 buildAction = "Exclude"; 183 buildAction = "Exclude";
184 break; 184 break;
185 185
186 case BuildAction.EmbeddedResource: 186 case BuildAction.EmbeddedResource:
187 buildAction = "EmbedAsResource"; 187 buildAction = "EmbedAsResource";
188 break; 188 break;
189 189
190 default: 190 default:
191 buildAction = "Compile"; 191 buildAction = "Compile";
192 break; 192 break;
193 } 193 }
194 194
195 // Sort of a hack, we try and resolve the path and make it relative, if we can. 195 // Sort of a hack, we try and resolve the path and make it relative, if we can.
196 string filePath = PrependPath(file); 196 string filePath = PrependPath(file);
197 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction); 197 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction);
198 } 198 }
199 ss.WriteLine(" </Contents>"); 199 ss.WriteLine(" </Contents>");
200 200
201 ss.WriteLine(" <References>"); 201 ss.WriteLine(" <References>");
202 foreach(ReferenceNode refr in project.References) 202 foreach(ReferenceNode refr in project.References)
203 { 203 {
204 ss.WriteLine(" {0}", BuildReference(solution, refr)); 204 ss.WriteLine(" {0}", BuildReference(solution, refr));
205 } 205 }
206 ss.WriteLine(" </References>"); 206 ss.WriteLine(" </References>");
207 207
208 ss.Write(" <DeploymentInformation"); 208 ss.Write(" <DeploymentInformation");
209 ss.Write(" target=\"\""); 209 ss.Write(" target=\"\"");
210 ss.Write(" script=\"\""); 210 ss.Write(" script=\"\"");
211 ss.Write(" strategy=\"File\""); 211 ss.Write(" strategy=\"File\"");
212 ss.WriteLine(" />"); 212 ss.WriteLine(" />");
213 213
214 int count = 0; 214 int count = 0;
215 215
216 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig); 216 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig);
217 217
218 foreach(ConfigurationNode conf in project.Configurations) 218 foreach(ConfigurationNode conf in project.Configurations)
219 { 219 {
220 ss.Write(" <Configuration"); 220 ss.Write(" <Configuration");
221 ss.Write(" runwithwarnings=\"True\""); 221 ss.Write(" runwithwarnings=\"True\"");
222 ss.Write(" name=\"{0}\"", conf.Name); 222 ss.Write(" name=\"{0}\"", conf.Name);
223 ss.WriteLine(">"); 223 ss.WriteLine(">");
224 ss.Write(" <CodeGeneration"); 224 ss.Write(" <CodeGeneration");
225 ss.Write(" runtime=\"{0}\"", netRuntime); 225 ss.Write(" runtime=\"{0}\"", netRuntime);
226 ss.Write(" compiler=\"{0}\"", csComp); 226 ss.Write(" compiler=\"{0}\"", csComp);
227 ss.Write(" compilerversion=\"\""); 227 ss.Write(" compilerversion=\"\"");
228 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]); 228 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]);
229 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]); 229 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]);
230 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]); 230 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]);
231 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]); 231 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]);
232 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]); 232 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]);
233 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]); 233 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]);
234 ss.Write(" mainclass=\"{0}\"", project.StartupObject); 234 ss.Write(" mainclass=\"{0}\"", project.StartupObject);
235 ss.Write(" target=\"{0}\"", project.Type); 235 ss.Write(" target=\"{0}\"", project.Type);
236 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]); 236 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]);
237 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf)); 237 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf));
238 ss.Write(" win32Icon=\"{0}\"", Helper.NormalizePath(".\\" + project.AppIcon)); 238 ss.Write(" win32Icon=\"{0}\"", Helper.NormalizePath(".\\" + project.AppIcon));
239 ss.Write(" noconfig=\"{0}\"", "False"); 239 ss.Write(" noconfig=\"{0}\"", "False");
240 ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]); 240 ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]);
241 ss.WriteLine(" />"); 241 ss.WriteLine(" />");
242 242
243 ss.Write(" <Execution"); 243 ss.Write(" <Execution");
244 ss.Write(" commandlineparameters=\"\""); 244 ss.Write(" commandlineparameters=\"\"");
245 ss.Write(" consolepause=\"True\""); 245 ss.Write(" consolepause=\"True\"");
246 ss.WriteLine(" />"); 246 ss.WriteLine(" />");
247 247
248 ss.Write(" <Output"); 248 ss.Write(" <Output");
249 ss.Write(" directory=\".\\{0}\"", Helper.NormalizePath(conf.Options["OutputPath"].ToString())); 249 ss.Write(" directory=\".\\{0}\"", Helper.NormalizePath(conf.Options["OutputPath"].ToString()));
250 ss.Write(" assembly=\"{0}\"", project.AssemblyName); 250 ss.Write(" assembly=\"{0}\"", project.AssemblyName);
251 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]); 251 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]);
252 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) 252 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
253 { 253 {
254 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); 254 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
255 } 255 }
256 else 256 else
257 { 257 {
258 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]); 258 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
259 } 259 }
260 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) 260 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
261 { 261 {
262 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); 262 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
263 } 263 }
264 else 264 else
265 { 265 {
266 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]); 266 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
267 } 267 }
268 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); 268 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
269 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]); 269 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
270 ss.WriteLine(" />"); 270 ss.WriteLine(" />");
271 ss.WriteLine(" </Configuration>"); 271 ss.WriteLine(" </Configuration>");
272 272
273 count++; 273 count++;
274 } 274 }
275 ss.WriteLine(" </Configurations>"); 275 ss.WriteLine(" </Configurations>");
276 ss.WriteLine("</Project>"); 276 ss.WriteLine("</Project>");
277 } 277 }
278 278
279 m_Kernel.CurrentWorkingDirectory.Pop(); 279 m_Kernel.CurrentWorkingDirectory.Pop();
280 } 280 }
281 281
282 private void WriteCombine(SolutionNode solution) 282 private void WriteCombine(SolutionNode solution)
283 { 283 {
284 m_Kernel.Log.Write("Creating SharpDevelop combine and project files"); 284 m_Kernel.Log.Write("Creating SharpDevelop combine and project files");
285 foreach(ProjectNode project in solution.Projects) 285 foreach(ProjectNode project in solution.Projects)
286 { 286 {
287 if(m_Kernel.AllowProject(project.FilterGroups)) 287 if(m_Kernel.AllowProject(project.FilterGroups))
288 { 288 {
289 m_Kernel.Log.Write("...Creating project: {0}", project.Name); 289 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
290 WriteProject(solution, project); 290 WriteProject(solution, project);
291 } 291 }
292 } 292 }
293 293
294 m_Kernel.Log.Write(""); 294 m_Kernel.Log.Write("");
295 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); 295 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx");
296 StreamWriter ss = new StreamWriter(combFile); 296 StreamWriter ss = new StreamWriter(combFile);
297 297
298 m_Kernel.CurrentWorkingDirectory.Push(); 298 m_Kernel.CurrentWorkingDirectory.Push();
299 Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); 299 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
300 300
301 using(ss) 301 using(ss)
302 { 302 {
303 ss.WriteLine("<Combine fileversion=\"1.0\" name=\"{0}\" description=\"\">", solution.Name); 303 ss.WriteLine("<Combine fileversion=\"1.0\" name=\"{0}\" description=\"\">", solution.Name);
304 304
305 int count = 0; 305 int count = 0;
306 foreach(ProjectNode project in solution.Projects) 306 foreach(ProjectNode project in solution.Projects)
307 { 307 {
308 if(count == 0) 308 if(count == 0)
309 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name); 309 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name);
310 310
311 ss.WriteLine(" <Execute entry=\"{0}\" type=\"None\" />", project.Name); 311 ss.WriteLine(" <Execute entry=\"{0}\" type=\"None\" />", project.Name);
312 count++; 312 count++;
313 } 313 }
314 ss.WriteLine(" </StartMode>"); 314 ss.WriteLine(" </StartMode>");
315 315
316 ss.WriteLine(" <Entries>"); 316 ss.WriteLine(" <Entries>");
317 foreach(ProjectNode project in solution.Projects) 317 foreach(ProjectNode project in solution.Projects)
318 { 318 {
319 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); 319 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
320 ss.WriteLine(" <Entry filename=\"{0}\" />", 320 ss.WriteLine(" <Entry filename=\"{0}\" />",
321 Helper.MakeFilePath(path, project.Name, "prjx")); 321 Helper.MakeFilePath(path, project.Name, "prjx"));
322 } 322 }
323 ss.WriteLine(" </Entries>"); 323 ss.WriteLine(" </Entries>");
324 324
325 count = 0; 325 count = 0;
326 foreach(ConfigurationNode conf in solution.Configurations) 326 foreach(ConfigurationNode conf in solution.Configurations)
327 { 327 {
328 if(count == 0) 328 if(count == 0)
329 { 329 {
330 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name); 330 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name);
331 } 331 }
332 332
333 ss.WriteLine(" <Configuration name=\"{0}\">", conf.Name); 333 ss.WriteLine(" <Configuration name=\"{0}\">", conf.Name);
334 foreach(ProjectNode project in solution.Projects) 334 foreach(ProjectNode project in solution.Projects)
335 { 335 {
336 ss.WriteLine(" <Entry name=\"{0}\" configurationname=\"{1}\" build=\"True\" />", project.Name, conf.Name); 336 ss.WriteLine(" <Entry name=\"{0}\" configurationname=\"{1}\" build=\"True\" />", project.Name, conf.Name);
337 } 337 }
338 ss.WriteLine(" </Configuration>"); 338 ss.WriteLine(" </Configuration>");
339 339
340 count++; 340 count++;
341 } 341 }
342 ss.WriteLine(" </Configurations>"); 342 ss.WriteLine(" </Configurations>");
343 ss.WriteLine("</Combine>"); 343 ss.WriteLine("</Combine>");
344 } 344 }
345 345
346 m_Kernel.CurrentWorkingDirectory.Pop(); 346 m_Kernel.CurrentWorkingDirectory.Pop();
347 } 347 }
348 348
349 private void CleanProject(ProjectNode project) 349 private void CleanProject(ProjectNode project)
350 { 350 {
351 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); 351 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
352 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx"); 352 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx");
353 Helper.DeleteIfExists(projectFile); 353 Helper.DeleteIfExists(projectFile);
354 } 354 }
355 355
356 private void CleanSolution(SolutionNode solution) 356 private void CleanSolution(SolutionNode solution)
357 { 357 {
358 m_Kernel.Log.Write("Cleaning SharpDevelop combine and project files for", solution.Name); 358 m_Kernel.Log.Write("Cleaning SharpDevelop combine and project files for", solution.Name);
359 359
360 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx"); 360 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx");
361 Helper.DeleteIfExists(slnFile); 361 Helper.DeleteIfExists(slnFile);
362 362
363 foreach(ProjectNode project in solution.Projects) 363 foreach(ProjectNode project in solution.Projects)
364 { 364 {
365 CleanProject(project); 365 CleanProject(project);
366 } 366 }
367 367
368 m_Kernel.Log.Write(""); 368 m_Kernel.Log.Write("");
369 } 369 }
370 370
371 #endregion 371 #endregion
372 372
373 #region ITarget Members 373 #region ITarget Members
374 374
375 /// <summary> 375 /// <summary>
376 /// Writes the specified kern. 376 /// Writes the specified kern.
377 /// </summary> 377 /// </summary>
378 /// <param name="kern">The kern.</param> 378 /// <param name="kern">The kern.</param>
379 public void Write(Kernel kern) 379 public void Write(Kernel kern)
380 { 380 {
381 if( kern == null ) 381 if( kern == null )
382 { 382 {
383 throw new ArgumentNullException("kern"); 383 throw new ArgumentNullException("kern");
384 } 384 }
385 m_Kernel = kern; 385 m_Kernel = kern;
386 foreach(SolutionNode solution in kern.Solutions) 386 foreach(SolutionNode solution in kern.Solutions)
387 { 387 {
388 WriteCombine(solution); 388 WriteCombine(solution);
389 } 389 }
390 m_Kernel = null; 390 m_Kernel = null;
391 } 391 }
392 392
393 /// <summary> 393 /// <summary>
394 /// Cleans the specified kern. 394 /// Cleans the specified kern.
395 /// </summary> 395 /// </summary>
396 /// <param name="kern">The kern.</param> 396 /// <param name="kern">The kern.</param>
397 public virtual void Clean(Kernel kern) 397 public virtual void Clean(Kernel kern)
398 { 398 {
399 if( kern == null ) 399 if( kern == null )
400 { 400 {
401 throw new ArgumentNullException("kern"); 401 throw new ArgumentNullException("kern");
402 } 402 }
403 m_Kernel = kern; 403 m_Kernel = kern;
404 foreach(SolutionNode sol in kern.Solutions) 404 foreach(SolutionNode sol in kern.Solutions)
405 { 405 {
406 CleanSolution(sol); 406 CleanSolution(sol);
407 } 407 }
408 m_Kernel = null; 408 m_Kernel = null;
409 } 409 }
410 410
411 /// <summary> 411 /// <summary>
412 /// Gets the name. 412 /// Gets the name.
413 /// </summary> 413 /// </summary>
414 /// <value>The name.</value> 414 /// <value>The name.</value>
415 public string Name 415 public string Name
416 { 416 {
417 get 417 get
418 { 418 {
419 return "sharpdev"; 419 return "sharpdev";
420 } 420 }
421 } 421 }
422 422
423 #endregion 423 #endregion
424 } 424 }
425} 425}
diff --git a/Prebuild/src/Core/Targets/ToolInfo.cs b/Prebuild/src/Core/Targets/ToolInfo.cs
index 984d20e..935c674 100644
--- a/Prebuild/src/Core/Targets/ToolInfo.cs
+++ b/Prebuild/src/Core/Targets/ToolInfo.cs
@@ -4,194 +4,194 @@ using System.Text;
4 4
5namespace Prebuild.Core.Targets 5namespace Prebuild.Core.Targets
6{ 6{
7 /// <summary> 7 /// <summary>
8 /// 8 ///
9 /// </summary> 9 /// </summary>
10 public struct ToolInfo 10 public struct ToolInfo
11 { 11 {
12 string name; 12 string name;
13 string guid; 13 string guid;
14 string fileExtension; 14 string fileExtension;
15 string xmlTag; 15 string xmlTag;
16 string importProject; 16 string importProject;
17 17
18 /// <summary> 18 /// <summary>
19 /// Gets or sets the name. 19 /// Gets or sets the name.
20 /// </summary> 20 /// </summary>
21 /// <value>The name.</value> 21 /// <value>The name.</value>
22 public string Name 22 public string Name
23 { 23 {
24 get 24 get
25 { 25 {
26 return name; 26 return name;
27 } 27 }
28 set 28 set
29 { 29 {
30 name = value; 30 name = value;
31 } 31 }
32 } 32 }
33 33
34 /// <summary> 34 /// <summary>
35 /// Gets or sets the GUID. 35 /// Gets or sets the GUID.
36 /// </summary> 36 /// </summary>
37 /// <value>The GUID.</value> 37 /// <value>The GUID.</value>
38 public string Guid 38 public string Guid
39 { 39 {
40 get 40 get
41 { 41 {
42 return guid; 42 return guid;
43 } 43 }
44 set 44 set
45 { 45 {
46 guid = value; 46 guid = value;
47 } 47 }
48 } 48 }
49 49
50 /// <summary> 50 /// <summary>
51 /// Gets or sets the file extension. 51 /// Gets or sets the file extension.
52 /// </summary> 52 /// </summary>
53 /// <value>The file extension.</value> 53 /// <value>The file extension.</value>
54 public string FileExtension 54 public string FileExtension
55 { 55 {
56 get 56 get
57 { 57 {
58 return fileExtension; 58 return fileExtension;
59 } 59 }
60 set 60 set
61 { 61 {
62 fileExtension = value; 62 fileExtension = value;
63 } 63 }
64 } 64 }
65 public string LanguageExtension 65 public string LanguageExtension
66 { 66 {
67 get 67 get
68 { 68 {
69 switch (this.Name) 69 switch (this.Name)
70 { 70 {
71 case "C#": 71 case "C#":
72 return ".cs"; 72 return ".cs";
73 case "VisualBasic": 73 case "VisualBasic":
74 return ".vb"; 74 return ".vb";
75 case "Boo": 75 case "Boo":
76 return ".boo"; 76 return ".boo";
77 default: 77 default:
78 return ".cs"; 78 return ".cs";
79 } 79 }
80 } 80 }
81 } 81 }
82 /// <summary> 82 /// <summary>
83 /// Gets or sets the XML tag. 83 /// Gets or sets the XML tag.
84 /// </summary> 84 /// </summary>
85 /// <value>The XML tag.</value> 85 /// <value>The XML tag.</value>
86 public string XmlTag 86 public string XmlTag
87 { 87 {
88 get 88 get
89 { 89 {
90 return xmlTag; 90 return xmlTag;
91 } 91 }
92 set 92 set
93 { 93 {
94 xmlTag = value; 94 xmlTag = value;
95 } 95 }
96 } 96 }
97 97
98 /// <summary> 98 /// <summary>
99 /// Gets or sets the import project property. 99 /// Gets or sets the import project property.
100 /// </summary> 100 /// </summary>
101 /// <value>The ImportProject tag.</value> 101 /// <value>The ImportProject tag.</value>
102 public string ImportProject 102 public string ImportProject
103 { 103 {
104 get 104 get
105 { 105 {
106 return importProject; 106 return importProject;
107 } 107 }
108 set 108 set
109 { 109 {
110 importProject = value; 110 importProject = value;
111 } 111 }
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// Initializes a new instance of the <see cref="ToolInfo"/> class. 115 /// Initializes a new instance of the <see cref="ToolInfo"/> class.
116 /// </summary> 116 /// </summary>
117 /// <param name="name">The name.</param> 117 /// <param name="name">The name.</param>
118 /// <param name="guid">The GUID.</param> 118 /// <param name="guid">The GUID.</param>
119 /// <param name="fileExtension">The file extension.</param> 119 /// <param name="fileExtension">The file extension.</param>
120 /// <param name="xml">The XML.</param> 120 /// <param name="xml">The XML.</param>
121 /// <param name="importProject">The import project.</param> 121 /// <param name="importProject">The import project.</param>
122 public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject) 122 public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject)
123 { 123 {
124 this.name = name; 124 this.name = name;
125 this.guid = guid; 125 this.guid = guid;
126 this.fileExtension = fileExtension; 126 this.fileExtension = fileExtension;
127 this.xmlTag = xml; 127 this.xmlTag = xml;
128 this.importProject = importProject; 128 this.importProject = importProject;
129 } 129 }
130 130
131 /// <summary> 131 /// <summary>
132 /// Initializes a new instance of the <see cref="ToolInfo"/> class. 132 /// Initializes a new instance of the <see cref="ToolInfo"/> class.
133 /// </summary> 133 /// </summary>
134 /// <param name="name">The name.</param> 134 /// <param name="name">The name.</param>
135 /// <param name="guid">The GUID.</param> 135 /// <param name="guid">The GUID.</param>
136 /// <param name="fileExtension">The file extension.</param> 136 /// <param name="fileExtension">The file extension.</param>
137 /// <param name="xml">The XML.</param> 137 /// <param name="xml">The XML.</param>
138 public ToolInfo(string name, string guid, string fileExtension, string xml) 138 public ToolInfo(string name, string guid, string fileExtension, string xml)
139 { 139 {
140 this.name = name; 140 this.name = name;
141 this.guid = guid; 141 this.guid = guid;
142 this.fileExtension = fileExtension; 142 this.fileExtension = fileExtension;
143 this.xmlTag = xml; 143 this.xmlTag = xml;
144 this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets"; 144 this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets";
145 } 145 }
146 146
147 /// <summary> 147 /// <summary>
148 /// Equals operator 148 /// Equals operator
149 /// </summary> 149 /// </summary>
150 /// <param name="obj">ToolInfo to compare</param> 150 /// <param name="obj">ToolInfo to compare</param>
151 /// <returns>true if toolInfos are equal</returns> 151 /// <returns>true if toolInfos are equal</returns>
152 public override bool Equals(object obj) 152 public override bool Equals(object obj)
153 { 153 {
154 if (obj == null) 154 if (obj == null)
155 { 155 {
156 throw new ArgumentNullException("obj"); 156 throw new ArgumentNullException("obj");
157 } 157 }
158 if (obj.GetType() != typeof(ToolInfo)) 158 if (obj.GetType() != typeof(ToolInfo))
159 return false; 159 return false;
160 160
161 ToolInfo c = (ToolInfo)obj; 161 ToolInfo c = (ToolInfo)obj;
162 return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject)); 162 return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject));
163 } 163 }
164 164
165 /// <summary> 165 /// <summary>
166 /// Equals operator 166 /// Equals operator
167 /// </summary> 167 /// </summary>
168 /// <param name="c1">ToolInfo to compare</param> 168 /// <param name="c1">ToolInfo to compare</param>
169 /// <param name="c2">ToolInfo to compare</param> 169 /// <param name="c2">ToolInfo to compare</param>
170 /// <returns>True if toolInfos are equal</returns> 170 /// <returns>True if toolInfos are equal</returns>
171 public static bool operator ==(ToolInfo c1, ToolInfo c2) 171 public static bool operator ==(ToolInfo c1, ToolInfo c2)
172 { 172 {
173 return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag)); 173 return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag));
174 } 174 }
175 175
176 /// <summary> 176 /// <summary>
177 /// Not equals operator 177 /// Not equals operator
178 /// </summary> 178 /// </summary>
179 /// <param name="c1">ToolInfo to compare</param> 179 /// <param name="c1">ToolInfo to compare</param>
180 /// <param name="c2">ToolInfo to compare</param> 180 /// <param name="c2">ToolInfo to compare</param>
181 /// <returns>True if toolInfos are not equal</returns> 181 /// <returns>True if toolInfos are not equal</returns>
182 public static bool operator !=(ToolInfo c1, ToolInfo c2) 182 public static bool operator !=(ToolInfo c1, ToolInfo c2)
183 { 183 {
184 return !(c1 == c2); 184 return !(c1 == c2);
185 } 185 }
186 186
187 /// <summary> 187 /// <summary>
188 /// Hash Code 188 /// Hash Code
189 /// </summary> 189 /// </summary>
190 /// <returns>Hash code</returns> 190 /// <returns>Hash code</returns>
191 public override int GetHashCode() 191 public override int GetHashCode()
192 { 192 {
193 return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode(); 193 return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode();
194 194
195 } 195 }
196 } 196 }
197} 197}
diff --git a/Prebuild/src/Core/Targets/VS2002Target.cs b/Prebuild/src/Core/Targets/VS2002Target.cs
index d7f6dd1..2292624 100644
--- a/Prebuild/src/Core/Targets/VS2002Target.cs
+++ b/Prebuild/src/Core/Targets/VS2002Target.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -29,59 +29,59 @@ using Prebuild.Core.Attributes;
29 29
30namespace Prebuild.Core.Targets 30namespace Prebuild.Core.Targets
31{ 31{
32 /// <summary> 32 /// <summary>
33 /// 33 ///
34 /// </summary> 34 /// </summary>
35 [Target("vs2002")] 35 [Target("vs2002")]
36 public class VS2002Target : VS2003Target 36 public class VS2002Target : VS2003Target
37 { 37 {
38 #region Private Methods 38 #region Private Methods
39 39
40 private void SetVS2002() 40 private void SetVS2002()
41 { 41 {
42 this.SolutionVersion = "7.00"; 42 this.SolutionVersion = "7.00";
43 this.ProductVersion = "7.0.9254"; 43 this.ProductVersion = "7.0.9254";
44 this.SchemaVersion = "1.0"; 44 this.SchemaVersion = "1.0";
45 this.VersionName = "2002"; 45 this.VersionName = "2002";
46 this.Version = VSVersion.VS70; 46 this.Version = VSVersion.VS70;
47 } 47 }
48 48
49 #endregion 49 #endregion
50 50
51 #region Public Methods 51 #region Public Methods
52 52
53 /// <summary> 53 /// <summary>
54 /// Writes the specified kern. 54 /// Writes the specified kern.
55 /// </summary> 55 /// </summary>
56 /// <param name="kern">The kern.</param> 56 /// <param name="kern">The kern.</param>
57 public override void Write(Kernel kern) 57 public override void Write(Kernel kern)
58 { 58 {
59 SetVS2002(); 59 SetVS2002();
60 base.Write(kern); 60 base.Write(kern);
61 } 61 }
62 62
63 /// <summary> 63 /// <summary>
64 /// Cleans the specified kern. 64 /// Cleans the specified kern.
65 /// </summary> 65 /// </summary>
66 /// <param name="kern">The kern.</param> 66 /// <param name="kern">The kern.</param>
67 public override void Clean(Kernel kern) 67 public override void Clean(Kernel kern)
68 { 68 {
69 SetVS2002(); 69 SetVS2002();
70 base.Clean(kern); 70 base.Clean(kern);
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// Gets the name. 74 /// Gets the name.
75 /// </summary> 75 /// </summary>
76 /// <value>The name.</value> 76 /// <value>The name.</value>
77 public override string Name 77 public override string Name
78 { 78 {
79 get 79 get
80 { 80 {
81 return "vs2002"; 81 return "vs2002";
82 } 82 }
83 } 83 }
84 84
85 #endregion 85 #endregion
86 } 86 }
87} 87}
diff --git a/Prebuild/src/Core/Targets/VS2003Target.cs b/Prebuild/src/Core/Targets/VS2003Target.cs
index f4b4517..10e2dc4 100644
--- a/Prebuild/src/Core/Targets/VS2003Target.cs
+++ b/Prebuild/src/Core/Targets/VS2003Target.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,560 +34,560 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Targets 35namespace Prebuild.Core.Targets
36{ 36{
37 [Target("vs2003")] 37 [Target("vs2003")]
38 public class VS2003Target : ITarget 38 public class VS2003Target : ITarget
39 { 39 {
40 40
41 #region Fields 41 #region Fields
42 42
43 string solutionVersion = "8.00"; 43 string solutionVersion = "8.00";
44 string productVersion = "7.10.3077"; 44 string productVersion = "7.10.3077";
45 string schemaVersion = "2.0"; 45 string schemaVersion = "2.0";
46 string versionName = "2003"; 46 string versionName = "2003";
47 VSVersion version = VSVersion.VS71; 47 VSVersion version = VSVersion.VS71;
48 48
49 readonly Dictionary<string, ToolInfo> m_Tools = new Dictionary<string, ToolInfo>(); 49 readonly Dictionary<string, ToolInfo> m_Tools = new Dictionary<string, ToolInfo>();
50 Kernel m_Kernel; 50 Kernel m_Kernel;
51 51
52 /// <summary> 52 /// <summary>
53 /// Gets or sets the solution version. 53 /// Gets or sets the solution version.
54 /// </summary> 54 /// </summary>
55 /// <value>The solution version.</value> 55 /// <value>The solution version.</value>
56 protected string SolutionVersion 56 protected string SolutionVersion
57 { 57 {
58 get 58 get
59 { 59 {
60 return solutionVersion; 60 return solutionVersion;
61 } 61 }
62 set 62 set
63 { 63 {
64 solutionVersion = value; 64 solutionVersion = value;
65 } 65 }
66 } 66 }
67 /// <summary> 67 /// <summary>
68 /// Gets or sets the product version. 68 /// Gets or sets the product version.
69 /// </summary> 69 /// </summary>
70 /// <value>The product version.</value> 70 /// <value>The product version.</value>
71 protected string ProductVersion 71 protected string ProductVersion
72 { 72 {
73 get 73 get
74 { 74 {
75 return productVersion; 75 return productVersion;
76 } 76 }
77 set 77 set
78 { 78 {
79 productVersion = value; 79 productVersion = value;
80 } 80 }
81 } 81 }
82 /// <summary> 82 /// <summary>
83 /// Gets or sets the schema version. 83 /// Gets or sets the schema version.
84 /// </summary> 84 /// </summary>
85 /// <value>The schema version.</value> 85 /// <value>The schema version.</value>
86 protected string SchemaVersion 86 protected string SchemaVersion
87 { 87 {
88 get 88 get
89 { 89 {
90 return schemaVersion; 90 return schemaVersion;
91 } 91 }
92 set 92 set
93 { 93 {
94 schemaVersion = value; 94 schemaVersion = value;
95 } 95 }
96 } 96 }
97 /// <summary> 97 /// <summary>
98 /// Gets or sets the name of the version. 98 /// Gets or sets the name of the version.
99 /// </summary> 99 /// </summary>
100 /// <value>The name of the version.</value> 100 /// <value>The name of the version.</value>
101 protected string VersionName 101 protected string VersionName
102 { 102 {
103 get 103 get
104 { 104 {
105 return versionName; 105 return versionName;
106 } 106 }
107 set 107 set
108 { 108 {
109 versionName = value; 109 versionName = value;
110 } 110 }
111 } 111 }
112 /// <summary> 112 /// <summary>
113 /// Gets or sets the version. 113 /// Gets or sets the version.
114 /// </summary> 114 /// </summary>
115 /// <value>The version.</value> 115 /// <value>The version.</value>
116 protected VSVersion Version 116 protected VSVersion Version
117 { 117 {
118 get 118 get
119 { 119 {
120 return version; 120 return version;
121 } 121 }
122 set 122 set
123 { 123 {
124 version = value; 124 version = value;
125 } 125 }
126 } 126 }
127 127
128 #endregion 128 #endregion
129 129
130 #region Constructors 130 #region Constructors
131 131
132 /// <summary> 132 /// <summary>
133 /// Initializes a new instance of the <see cref="VS2003Target"/> class. 133 /// Initializes a new instance of the <see cref="VS2003Target"/> class.
134 /// </summary> 134 /// </summary>
135 public VS2003Target() 135 public VS2003Target()
136 { 136 {
137 m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP"); 137 m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP");
138 m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic"); 138 m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic");
139 } 139 }
140 140
141 #endregion 141 #endregion
142 142
143 #region Private Methods 143 #region Private Methods
144 144
145 private string MakeRefPath(ProjectNode project) 145 private string MakeRefPath(ProjectNode project)
146 { 146 {
147 string ret = ""; 147 string ret = "";
148 foreach(ReferencePathNode node in project.ReferencePaths) 148 foreach(ReferencePathNode node in project.ReferencePaths)
149 { 149 {
150 try 150 try
151 { 151 {
152 string fullPath = Helper.ResolvePath(node.Path); 152 string fullPath = Helper.ResolvePath(node.Path);
153 if(ret.Length < 1) 153 if(ret.Length < 1)
154 { 154 {
155 ret = fullPath; 155 ret = fullPath;
156 } 156 }
157 else 157 else
158 { 158 {
159 ret += ";" + fullPath; 159 ret += ";" + fullPath;
160 } 160 }
161 } 161 }
162 catch(ArgumentException) 162 catch(ArgumentException)
163 { 163 {
164 m_Kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); 164 m_Kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
165 } 165 }
166 } 166 }
167 167
168 return ret; 168 return ret;
169 } 169 }
170 170
171 private void WriteProject(SolutionNode solution, ProjectNode project) 171 private void WriteProject(SolutionNode solution, ProjectNode project)
172 { 172 {
173 if(!m_Tools.ContainsKey(project.Language)) 173 if(!m_Tools.ContainsKey(project.Language))
174 { 174 {
175 throw new UnknownLanguageException("Unknown .NET language: " + project.Language); 175 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
176 } 176 }
177 177
178 ToolInfo toolInfo = m_Tools[project.Language]; 178 ToolInfo toolInfo = m_Tools[project.Language];
179 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 179 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
180 StreamWriter ps = new StreamWriter(projectFile); 180 StreamWriter ps = new StreamWriter(projectFile);
181 181
182 m_Kernel.CurrentWorkingDirectory.Push(); 182 m_Kernel.CurrentWorkingDirectory.Push();
183 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); 183 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
184 184
185 using(ps) 185 using(ps)
186 { 186 {
187 ps.WriteLine("<VisualStudioProject>"); 187 ps.WriteLine("<VisualStudioProject>");
188 ps.WriteLine(" <{0}", toolInfo.XmlTag); 188 ps.WriteLine(" <{0}", toolInfo.XmlTag);
189 ps.WriteLine("\t\t\t\tProjectType = \"Local\""); 189 ps.WriteLine("\t\t\t\tProjectType = \"Local\"");
190 ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", ProductVersion); 190 ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", ProductVersion);
191 ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", SchemaVersion); 191 ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", SchemaVersion);
192 ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper()); 192 ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper());
193 ps.WriteLine("\t\t>"); 193 ps.WriteLine("\t\t>");
194 194
195 ps.WriteLine("\t\t\t\t<Build>"); 195 ps.WriteLine("\t\t\t\t<Build>");
196 ps.WriteLine(" <Settings"); 196 ps.WriteLine(" <Settings");
197 ps.WriteLine("\t\t\t\t ApplicationIcon = \"{0}\"",project.AppIcon); 197 ps.WriteLine("\t\t\t\t ApplicationIcon = \"{0}\"",project.AppIcon);
198 ps.WriteLine("\t\t\t\t AssemblyKeyContainerName = \"\""); 198 ps.WriteLine("\t\t\t\t AssemblyKeyContainerName = \"\"");
199 ps.WriteLine("\t\t\t\t AssemblyName = \"{0}\"", project.AssemblyName); 199 ps.WriteLine("\t\t\t\t AssemblyName = \"{0}\"", project.AssemblyName);
200 ps.WriteLine("\t\t\t\t AssemblyOriginatorKeyFile = \"\""); 200 ps.WriteLine("\t\t\t\t AssemblyOriginatorKeyFile = \"\"");
201 ps.WriteLine("\t\t\t\t DefaultClientScript = \"JScript\""); 201 ps.WriteLine("\t\t\t\t DefaultClientScript = \"JScript\"");
202 ps.WriteLine("\t\t\t\t DefaultHTMLPageLayout = \"Grid\""); 202 ps.WriteLine("\t\t\t\t DefaultHTMLPageLayout = \"Grid\"");
203 ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\""); 203 ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\"");
204 ps.WriteLine("\t\t\t\t DelaySign = \"false\""); 204 ps.WriteLine("\t\t\t\t DelaySign = \"false\"");
205 205
206 if(Version == VSVersion.VS70) 206 if(Version == VSVersion.VS70)
207 { 207 {
208 ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\""); 208 ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\"");
209 } 209 }
210 210
211 ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type); 211 ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type);
212 212
213 foreach(ConfigurationNode conf in project.Configurations) 213 foreach(ConfigurationNode conf in project.Configurations)
214 { 214 {
215 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) 215 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
216 { 216 {
217 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString())); 217 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
218 } 218 }
219 else 219 else
220 { 220 {
221 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", conf.Options["PreBuildEvent"]); 221 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", conf.Options["PreBuildEvent"]);
222 } 222 }
223 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0) 223 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
224 { 224 {
225 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString())); 225 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
226 } 226 }
227 else 227 else
228 { 228 {
229 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", conf.Options["PostBuildEvent"]); 229 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", conf.Options["PostBuildEvent"]);
230 } 230 }
231 if (conf.Options["RunPostBuildEvent"] == null) 231 if (conf.Options["RunPostBuildEvent"] == null)
232 { 232 {
233 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", "OnBuildSuccess"); 233 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", "OnBuildSuccess");
234 } 234 }
235 else 235 else
236 { 236 {
237 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", conf.Options["RunPostBuildEvent"]); 237 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", conf.Options["RunPostBuildEvent"]);
238 } 238 }
239 break; 239 break;
240 } 240 }
241 241
242 ps.WriteLine("\t\t\t\t RootNamespace = \"{0}\"", project.RootNamespace); 242 ps.WriteLine("\t\t\t\t RootNamespace = \"{0}\"", project.RootNamespace);
243 ps.WriteLine("\t\t\t\t StartupObject = \"{0}\"", project.StartupObject); 243 ps.WriteLine("\t\t\t\t StartupObject = \"{0}\"", project.StartupObject);
244 ps.WriteLine("\t\t >"); 244 ps.WriteLine("\t\t >");
245 245
246 foreach(ConfigurationNode conf in project.Configurations) 246 foreach(ConfigurationNode conf in project.Configurations)
247 { 247 {
248 ps.WriteLine("\t\t\t\t <Config"); 248 ps.WriteLine("\t\t\t\t <Config");
249 ps.WriteLine("\t\t\t\t Name = \"{0}\"", conf.Name); 249 ps.WriteLine("\t\t\t\t Name = \"{0}\"", conf.Name);
250 ps.WriteLine("\t\t\t\t AllowUnsafeBlocks = \"{0}\"", conf.Options["AllowUnsafe"].ToString().ToLower()); 250 ps.WriteLine("\t\t\t\t AllowUnsafeBlocks = \"{0}\"", conf.Options["AllowUnsafe"].ToString().ToLower());
251 ps.WriteLine("\t\t\t\t BaseAddress = \"{0}\"", conf.Options["BaseAddress"]); 251 ps.WriteLine("\t\t\t\t BaseAddress = \"{0}\"", conf.Options["BaseAddress"]);
252 ps.WriteLine("\t\t\t\t CheckForOverflowUnderflow = \"{0}\"", conf.Options["CheckUnderflowOverflow"].ToString().ToLower()); 252 ps.WriteLine("\t\t\t\t CheckForOverflowUnderflow = \"{0}\"", conf.Options["CheckUnderflowOverflow"].ToString().ToLower());
253 ps.WriteLine("\t\t\t\t ConfigurationOverrideFile = \"\""); 253 ps.WriteLine("\t\t\t\t ConfigurationOverrideFile = \"\"");
254 ps.WriteLine("\t\t\t\t DefineConstants = \"{0}\"", conf.Options["CompilerDefines"]); 254 ps.WriteLine("\t\t\t\t DefineConstants = \"{0}\"", conf.Options["CompilerDefines"]);
255 ps.WriteLine("\t\t\t\t DocumentationFile = \"{0}\"", GetXmlDocFile(project, conf));//default to the assembly name 255 ps.WriteLine("\t\t\t\t DocumentationFile = \"{0}\"", GetXmlDocFile(project, conf));//default to the assembly name
256 ps.WriteLine("\t\t\t\t DebugSymbols = \"{0}\"", conf.Options["DebugInformation"].ToString().ToLower()); 256 ps.WriteLine("\t\t\t\t DebugSymbols = \"{0}\"", conf.Options["DebugInformation"].ToString().ToLower());
257 ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]); 257 ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]);
258 ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower()); 258 ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower());
259 259
260 if(Version == VSVersion.VS71) 260 if(Version == VSVersion.VS71)
261 { 261 {
262 ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower()); 262 ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower());
263 ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower()); 263 ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower());
264 } 264 }
265 265
266 ps.WriteLine("\t\t\t\t Optimize = \"{0}\"", conf.Options["OptimizeCode"].ToString().ToLower()); 266 ps.WriteLine("\t\t\t\t Optimize = \"{0}\"", conf.Options["OptimizeCode"].ToString().ToLower());
267 ps.WriteLine(" OutputPath = \"{0}\"", 267 ps.WriteLine(" OutputPath = \"{0}\"",
268 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); 268 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
269 ps.WriteLine(" RegisterForComInterop = \"{0}\"", conf.Options["RegisterComInterop"].ToString().ToLower()); 269 ps.WriteLine(" RegisterForComInterop = \"{0}\"", conf.Options["RegisterComInterop"].ToString().ToLower());
270 ps.WriteLine(" RemoveIntegerChecks = \"{0}\"", conf.Options["RemoveIntegerChecks"].ToString().ToLower()); 270 ps.WriteLine(" RemoveIntegerChecks = \"{0}\"", conf.Options["RemoveIntegerChecks"].ToString().ToLower());
271 ps.WriteLine(" TreatWarningsAsErrors = \"{0}\"", conf.Options["WarningsAsErrors"].ToString().ToLower()); 271 ps.WriteLine(" TreatWarningsAsErrors = \"{0}\"", conf.Options["WarningsAsErrors"].ToString().ToLower());
272 ps.WriteLine(" WarningLevel = \"{0}\"", conf.Options["WarningLevel"]); 272 ps.WriteLine(" WarningLevel = \"{0}\"", conf.Options["WarningLevel"]);
273 ps.WriteLine(" />"); 273 ps.WriteLine(" />");
274 } 274 }
275 275
276 ps.WriteLine(" </Settings>"); 276 ps.WriteLine(" </Settings>");
277 277
278 ps.WriteLine(" <References>"); 278 ps.WriteLine(" <References>");
279 foreach(ReferenceNode refr in project.References) 279 foreach(ReferenceNode refr in project.References)
280 { 280 {
281 ps.WriteLine(" <Reference"); 281 ps.WriteLine(" <Reference");
282 ps.WriteLine(" Name = \"{0}\"", refr.Name); 282 ps.WriteLine(" Name = \"{0}\"", refr.Name);
283 ps.WriteLine(" AssemblyName = \"{0}\"", refr.Name); 283 ps.WriteLine(" AssemblyName = \"{0}\"", refr.Name);
284 284
285 if(solution.ProjectsTable.ContainsKey(refr.Name)) 285 if(solution.ProjectsTable.ContainsKey(refr.Name))
286 { 286 {
287 ProjectNode refProject = solution.ProjectsTable[refr.Name]; 287 ProjectNode refProject = solution.ProjectsTable[refr.Name];
288 ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper()); 288 ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper());
289 ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToUpper()); 289 ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToUpper());
290 } 290 }
291 else 291 else
292 { 292 {
293 if(refr.Path != null) 293 if(refr.Path != null)
294 { 294 {
295 ps.WriteLine(" HintPath = \"{0}\"", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); 295 ps.WriteLine(" HintPath = \"{0}\"", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
296 } 296 }
297 297
298 } 298 }
299 299
300 if(refr.LocalCopySpecified) 300 if(refr.LocalCopySpecified)
301 { 301 {
302 ps.WriteLine(" Private = \"{0}\"",refr.LocalCopy); 302 ps.WriteLine(" Private = \"{0}\"",refr.LocalCopy);
303 } 303 }
304 304
305 ps.WriteLine(" />"); 305 ps.WriteLine(" />");
306 } 306 }
307 ps.WriteLine(" </References>"); 307 ps.WriteLine(" </References>");
308 308
309 ps.WriteLine(" </Build>"); 309 ps.WriteLine(" </Build>");
310 ps.WriteLine(" <Files>"); 310 ps.WriteLine(" <Files>");
311 311
312 ps.WriteLine(" <Include>"); 312 ps.WriteLine(" <Include>");
313 313
314 foreach(string file in project.Files) 314 foreach(string file in project.Files)
315 { 315 {
316 string fileName = file.Replace(".\\", ""); 316 string fileName = file.Replace(".\\", "");
317 ps.WriteLine(" <File"); 317 ps.WriteLine(" <File");
318 ps.WriteLine(" RelPath = \"{0}\"", fileName); 318 ps.WriteLine(" RelPath = \"{0}\"", fileName);
319 ps.WriteLine(" SubType = \"{0}\"", project.Files.GetSubType(file)); 319 ps.WriteLine(" SubType = \"{0}\"", project.Files.GetSubType(file));
320 ps.WriteLine(" BuildAction = \"{0}\"", project.Files.GetBuildAction(file)); 320 ps.WriteLine(" BuildAction = \"{0}\"", project.Files.GetBuildAction(file));
321 ps.WriteLine(" />"); 321 ps.WriteLine(" />");
322 322
323 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) 323 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
324 { 324 {
325 ps.WriteLine(" <File"); 325 ps.WriteLine(" <File");
326 ps.WriteLine(" RelPath = \"{0}\"", fileName.Substring(0, fileName.LastIndexOf('.')) + ".resx"); 326 ps.WriteLine(" RelPath = \"{0}\"", fileName.Substring(0, fileName.LastIndexOf('.')) + ".resx");
327 int slash = fileName.LastIndexOf('\\'); 327 int slash = fileName.LastIndexOf('\\');
328 if (slash == -1) 328 if (slash == -1)
329 { 329 {
330 ps.WriteLine(" DependentUpon = \"{0}\"", fileName); 330 ps.WriteLine(" DependentUpon = \"{0}\"", fileName);
331 } 331 }
332 else 332 else
333 { 333 {
334 ps.WriteLine(" DependentUpon = \"{0}\"", fileName.Substring(slash + 1, fileName.Length - slash - 1)); 334 ps.WriteLine(" DependentUpon = \"{0}\"", fileName.Substring(slash + 1, fileName.Length - slash - 1));
335 } 335 }
336 ps.WriteLine(" BuildAction = \"{0}\"", "EmbeddedResource"); 336 ps.WriteLine(" BuildAction = \"{0}\"", "EmbeddedResource");
337 ps.WriteLine(" />"); 337 ps.WriteLine(" />");
338 338
339 } 339 }
340 } 340 }
341 ps.WriteLine(" </Include>"); 341 ps.WriteLine(" </Include>");
342 342
343 ps.WriteLine(" </Files>"); 343 ps.WriteLine(" </Files>");
344 ps.WriteLine(" </{0}>", toolInfo.XmlTag); 344 ps.WriteLine(" </{0}>", toolInfo.XmlTag);
345 ps.WriteLine("</VisualStudioProject>"); 345 ps.WriteLine("</VisualStudioProject>");
346 } 346 }
347 347
348 ps = new StreamWriter(projectFile + ".user"); 348 ps = new StreamWriter(projectFile + ".user");
349 using(ps) 349 using(ps)
350 { 350 {
351 ps.WriteLine("<VisualStudioProject>"); 351 ps.WriteLine("<VisualStudioProject>");
352 ps.WriteLine(" <{0}>", toolInfo.XmlTag); 352 ps.WriteLine(" <{0}>", toolInfo.XmlTag);
353 ps.WriteLine(" <Build>"); 353 ps.WriteLine(" <Build>");
354 354
355 ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); 355 ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
356 foreach(ConfigurationNode conf in project.Configurations) 356 foreach(ConfigurationNode conf in project.Configurations)
357 { 357 {
358 ps.WriteLine(" <Config"); 358 ps.WriteLine(" <Config");
359 ps.WriteLine(" Name = \"{0}\"", conf.Name); 359 ps.WriteLine(" Name = \"{0}\"", conf.Name);
360 ps.WriteLine(" />"); 360 ps.WriteLine(" />");
361 } 361 }
362 ps.WriteLine(" </Settings>"); 362 ps.WriteLine(" </Settings>");
363 363
364 ps.WriteLine(" </Build>"); 364 ps.WriteLine(" </Build>");
365 ps.WriteLine(" </{0}>", toolInfo.XmlTag); 365 ps.WriteLine(" </{0}>", toolInfo.XmlTag);
366 ps.WriteLine("</VisualStudioProject>"); 366 ps.WriteLine("</VisualStudioProject>");
367 } 367 }
368 368
369 m_Kernel.CurrentWorkingDirectory.Pop(); 369 m_Kernel.CurrentWorkingDirectory.Pop();
370 } 370 }
371 371
372 /// <summary> 372 /// <summary>
373 /// Gets the XML doc file. 373 /// Gets the XML doc file.
374 /// </summary> 374 /// </summary>
375 /// <param name="project">The project.</param> 375 /// <param name="project">The project.</param>
376 /// <param name="conf">The conf.</param> 376 /// <param name="conf">The conf.</param>
377 /// <returns></returns> 377 /// <returns></returns>
378 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) 378 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
379 { 379 {
380 if( conf == null ) 380 if( conf == null )
381 { 381 {
382 throw new ArgumentNullException("conf"); 382 throw new ArgumentNullException("conf");
383 } 383 }
384 if( project == null ) 384 if( project == null )
385 { 385 {
386 throw new ArgumentNullException("project"); 386 throw new ArgumentNullException("project");
387 } 387 }
388 // if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false 388 // if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false
389 // { 389 // {
390 // return string.Empty; 390 // return string.Empty;
391 // } 391 // }
392 392
393 //default to "AssemblyName.xml" 393 //default to "AssemblyName.xml"
394 //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; 394 //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
395 //return (string)conf.Options["XmlDocFile", defaultValue]; 395 //return (string)conf.Options["XmlDocFile", defaultValue];
396 396
397 //default to no XmlDocFile file 397 //default to no XmlDocFile file
398 return (string)conf.Options["XmlDocFile", ""]; 398 return (string)conf.Options["XmlDocFile", ""];
399 } 399 }
400 400
401 private void WriteSolution(SolutionNode solution) 401 private void WriteSolution(SolutionNode solution)
402 { 402 {
403 m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", VersionName); 403 m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", VersionName);
404 404
405 foreach(ProjectNode project in solution.Projects) 405 foreach(ProjectNode project in solution.Projects)
406 { 406 {
407 if(m_Kernel.AllowProject(project.FilterGroups)) 407 if(m_Kernel.AllowProject(project.FilterGroups))
408 { 408 {
409 m_Kernel.Log.Write("...Creating project: {0}", project.Name); 409 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
410 WriteProject(solution, project); 410 WriteProject(solution, project);
411 } 411 }
412 } 412 }
413 413
414 m_Kernel.Log.Write(""); 414 m_Kernel.Log.Write("");
415 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 415 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
416 StreamWriter ss = new StreamWriter(solutionFile); 416 StreamWriter ss = new StreamWriter(solutionFile);
417 417
418 m_Kernel.CurrentWorkingDirectory.Push(); 418 m_Kernel.CurrentWorkingDirectory.Push();
419 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); 419 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
420 420
421 using(ss) 421 using(ss)
422 { 422 {
423 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); 423 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion);
424 foreach(ProjectNode project in solution.Projects) 424 foreach(ProjectNode project in solution.Projects)
425 { 425 {
426 if(!m_Tools.ContainsKey(project.Language)) 426 if(!m_Tools.ContainsKey(project.Language))
427 { 427 {
428 throw new UnknownLanguageException("Unknown .NET language: " + project.Language); 428 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
429 } 429 }
430 430
431 ToolInfo toolInfo = m_Tools[project.Language]; 431 ToolInfo toolInfo = m_Tools[project.Language];
432 432
433 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); 433 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
434 ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"", 434 ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"",
435 toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name, 435 toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name,
436 toolInfo.FileExtension), project.Guid.ToString().ToUpper()); 436 toolInfo.FileExtension), project.Guid.ToString().ToUpper());
437 437
438 ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject"); 438 ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
439 ss.WriteLine("\tEndProjectSection"); 439 ss.WriteLine("\tEndProjectSection");
440 440
441 ss.WriteLine("EndProject"); 441 ss.WriteLine("EndProject");
442 } 442 }
443 443
444 ss.WriteLine("Global"); 444 ss.WriteLine("Global");
445 445
446 ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution"); 446 ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution");
447 foreach(ConfigurationNode conf in solution.Configurations) 447 foreach(ConfigurationNode conf in solution.Configurations)
448 { 448 {
449 ss.WriteLine("\t\t{0} = {0}", conf.Name); 449 ss.WriteLine("\t\t{0} = {0}", conf.Name);
450 } 450 }
451 ss.WriteLine("\tEndGlobalSection"); 451 ss.WriteLine("\tEndGlobalSection");
452 452
453 ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution"); 453 ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution");
454 foreach(ProjectNode project in solution.Projects) 454 foreach(ProjectNode project in solution.Projects)
455 { 455 {
456 for(int i = 0; i < project.References.Count; i++) 456 for(int i = 0; i < project.References.Count; i++)
457 { 457 {
458 ReferenceNode refr = project.References[i]; 458 ReferenceNode refr = project.References[i];
459 if(solution.ProjectsTable.ContainsKey(refr.Name)) 459 if(solution.ProjectsTable.ContainsKey(refr.Name))
460 { 460 {
461 ProjectNode refProject = solution.ProjectsTable[refr.Name]; 461 ProjectNode refProject = solution.ProjectsTable[refr.Name];
462 ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})", 462 ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})",
463 project.Guid.ToString().ToUpper() 463 project.Guid.ToString().ToUpper()
464 , i, 464 , i,
465 refProject.Guid.ToString().ToUpper() 465 refProject.Guid.ToString().ToUpper()
466 ); 466 );
467 } 467 }
468 } 468 }
469 } 469 }
470 ss.WriteLine("\tEndGlobalSection"); 470 ss.WriteLine("\tEndGlobalSection");
471 471
472 ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution"); 472 ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution");
473 foreach(ProjectNode project in solution.Projects) 473 foreach(ProjectNode project in solution.Projects)
474 { 474 {
475 foreach(ConfigurationNode conf in solution.Configurations) 475 foreach(ConfigurationNode conf in solution.Configurations)
476 { 476 {
477 ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET", 477 ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET",
478 project.Guid.ToString().ToUpper(), 478 project.Guid.ToString().ToUpper(),
479 conf.Name); 479 conf.Name);
480 480
481 ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET", 481 ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET",
482 project.Guid.ToString().ToUpper(), 482 project.Guid.ToString().ToUpper(),
483 conf.Name); 483 conf.Name);
484 } 484 }
485 } 485 }
486 ss.WriteLine("\tEndGlobalSection"); 486 ss.WriteLine("\tEndGlobalSection");
487 487
488 if(solution.Files != null) 488 if(solution.Files != null)
489 { 489 {
490 ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution"); 490 ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution");
491 foreach(string file in solution.Files) 491 foreach(string file in solution.Files)
492 { 492 {
493 ss.WriteLine("\t\t{0} = {0}", file); 493 ss.WriteLine("\t\t{0} = {0}", file);
494 } 494 }
495 ss.WriteLine("\tEndGlobalSection"); 495 ss.WriteLine("\tEndGlobalSection");
496 } 496 }
497 497
498 ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution"); 498 ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution");
499 ss.WriteLine("\tEndGlobalSection"); 499 ss.WriteLine("\tEndGlobalSection");
500 ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution"); 500 ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution");
501 ss.WriteLine("\tEndGlobalSection"); 501 ss.WriteLine("\tEndGlobalSection");
502 502
503 ss.WriteLine("EndGlobal"); 503 ss.WriteLine("EndGlobal");
504 } 504 }
505 505
506 m_Kernel.CurrentWorkingDirectory.Pop(); 506 m_Kernel.CurrentWorkingDirectory.Pop();
507 } 507 }
508 508
509 private void CleanProject(ProjectNode project) 509 private void CleanProject(ProjectNode project)
510 { 510 {
511 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); 511 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
512 512
513 ToolInfo toolInfo = m_Tools[project.Language]; 513 ToolInfo toolInfo = m_Tools[project.Language];
514 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 514 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
515 string userFile = projectFile + ".user"; 515 string userFile = projectFile + ".user";
516 516
517 Helper.DeleteIfExists(projectFile); 517 Helper.DeleteIfExists(projectFile);
518 Helper.DeleteIfExists(userFile); 518 Helper.DeleteIfExists(userFile);
519 } 519 }
520 520
521 private void CleanSolution(SolutionNode solution) 521 private void CleanSolution(SolutionNode solution)
522 { 522 {
523 m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", VersionName, solution.Name); 523 m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", VersionName, solution.Name);
524 524
525 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 525 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
526 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); 526 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
527 527
528 Helper.DeleteIfExists(slnFile); 528 Helper.DeleteIfExists(slnFile);
529 Helper.DeleteIfExists(suoFile); 529 Helper.DeleteIfExists(suoFile);
530 530
531 foreach(ProjectNode project in solution.Projects) 531 foreach(ProjectNode project in solution.Projects)
532 { 532 {
533 CleanProject(project); 533 CleanProject(project);
534 } 534 }
535 535
536 m_Kernel.Log.Write(""); 536 m_Kernel.Log.Write("");
537 } 537 }
538 538
539 #endregion 539 #endregion
540 540
541 #region ITarget Members 541 #region ITarget Members
542 542
543 /// <summary> 543 /// <summary>
544 /// Writes the specified kern. 544 /// Writes the specified kern.
545 /// </summary> 545 /// </summary>
546 /// <param name="kern">The kern.</param> 546 /// <param name="kern">The kern.</param>
547 public virtual void Write(Kernel kern) 547 public virtual void Write(Kernel kern)
548 { 548 {
549 if( kern == null ) 549 if( kern == null )
550 { 550 {
551 throw new ArgumentNullException("kern"); 551 throw new ArgumentNullException("kern");
552 } 552 }
553 m_Kernel = kern; 553 m_Kernel = kern;
554 foreach(SolutionNode sol in m_Kernel.Solutions) 554 foreach(SolutionNode sol in m_Kernel.Solutions)
555 { 555 {
556 WriteSolution(sol); 556 WriteSolution(sol);
557 } 557 }
558 m_Kernel = null; 558 m_Kernel = null;
559 } 559 }
560 560
561 /// <summary> 561 /// <summary>
562 /// Cleans the specified kern. 562 /// Cleans the specified kern.
563 /// </summary> 563 /// </summary>
564 /// <param name="kern">The kern.</param> 564 /// <param name="kern">The kern.</param>
565 public virtual void Clean(Kernel kern) 565 public virtual void Clean(Kernel kern)
566 { 566 {
567 if( kern == null ) 567 if( kern == null )
568 { 568 {
569 throw new ArgumentNullException("kern"); 569 throw new ArgumentNullException("kern");
570 } 570 }
571 m_Kernel = kern; 571 m_Kernel = kern;
572 foreach(SolutionNode sol in m_Kernel.Solutions) 572 foreach(SolutionNode sol in m_Kernel.Solutions)
573 { 573 {
574 CleanSolution(sol); 574 CleanSolution(sol);
575 } 575 }
576 m_Kernel = null; 576 m_Kernel = null;
577 } 577 }
578 578
579 /// <summary> 579 /// <summary>
580 /// Gets the name. 580 /// Gets the name.
581 /// </summary> 581 /// </summary>
582 /// <value>The name.</value> 582 /// <value>The name.</value>
583 public virtual string Name 583 public virtual string Name
584 { 584 {
585 get 585 get
586 { 586 {
587 return "vs2003"; 587 return "vs2003";
588 } 588 }
589 } 589 }
590 590
591 #endregion 591 #endregion
592 } 592 }
593} 593}
diff --git a/Prebuild/src/Core/Targets/VS2005Target.cs b/Prebuild/src/Core/Targets/VS2005Target.cs
index e5a0939..9c70e26 100644
--- a/Prebuild/src/Core/Targets/VS2005Target.cs
+++ b/Prebuild/src/Core/Targets/VS2005Target.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com)
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -35,7 +35,7 @@ using Prebuild.Core.Utilities;
35namespace Prebuild.Core.Targets 35namespace Prebuild.Core.Targets
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [Target("vs2005")] 40 [Target("vs2005")]
41 public class VS2005Target : VSGenericTarget 41 public class VS2005Target : VSGenericTarget
@@ -137,9 +137,9 @@ namespace Prebuild.Core.Targets
137 /// <summary> 137 /// <summary>
138 /// Initializes a new instance of the <see cref="VS2005Target"/> class. 138 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
139 /// </summary> 139 /// </summary>
140 public VS2005Target() 140 public VS2005Target()
141 : base() 141 : base()
142 { 142 {
143 } 143 }
144 144
145 #endregion 145 #endregion
diff --git a/Prebuild/src/Core/Targets/VS2008Target.cs b/Prebuild/src/Core/Targets/VS2008Target.cs
index a3f3aca..fee4f7f 100644
--- a/Prebuild/src/Core/Targets/VS2008Target.cs
+++ b/Prebuild/src/Core/Targets/VS2008Target.cs
@@ -11,86 +11,86 @@ using System.CodeDom.Compiler;
11namespace Prebuild.Core.Targets 11namespace Prebuild.Core.Targets
12{ 12{
13 13
14 /// <summary> 14 /// <summary>
15 /// 15 ///
16 /// </summary> 16 /// </summary>
17 [Target("vs2008")] 17 [Target("vs2008")]
18 public class VS2008Target : VSGenericTarget 18 public class VS2008Target : VSGenericTarget
19 { 19 {
20 #region Fields 20 #region Fields
21 string solutionVersion = "10.00"; 21 string solutionVersion = "10.00";
22 string productVersion = "9.0.21022"; 22 string productVersion = "9.0.21022";
23 string schemaVersion = "2.0"; 23 string schemaVersion = "2.0";
24 string versionName = "Visual Studio 2008"; 24 string versionName = "Visual Studio 2008";
25 string name = "vs2008"; 25 string name = "vs2008";
26 VSVersion version = VSVersion.VS90; 26 VSVersion version = VSVersion.VS90;
27 27
28 /// <summary> 28 /// <summary>
29 /// Gets or sets the solution version. 29 /// Gets or sets the solution version.
30 /// </summary> 30 /// </summary>
31 /// <value>The solution version.</value> 31 /// <value>The solution version.</value>
32 public override string SolutionVersion 32 public override string SolutionVersion
33 { 33 {
34 get 34 get
35 { 35 {
36 return solutionVersion; 36 return solutionVersion;
37 } 37 }
38 } 38 }
39 /// <summary> 39 /// <summary>
40 /// Gets or sets the product version. 40 /// Gets or sets the product version.
41 /// </summary> 41 /// </summary>
42 /// <value>The product version.</value> 42 /// <value>The product version.</value>
43 public override string ProductVersion 43 public override string ProductVersion
44 { 44 {
45 get 45 get
46 { 46 {
47 return productVersion; 47 return productVersion;
48 } 48 }
49 } 49 }
50 /// <summary> 50 /// <summary>
51 /// Gets or sets the schema version. 51 /// Gets or sets the schema version.
52 /// </summary> 52 /// </summary>
53 /// <value>The schema version.</value> 53 /// <value>The schema version.</value>
54 public override string SchemaVersion 54 public override string SchemaVersion
55 { 55 {
56 get 56 get
57 { 57 {
58 return schemaVersion; 58 return schemaVersion;
59 } 59 }
60 } 60 }
61 /// <summary> 61 /// <summary>
62 /// Gets or sets the name of the version. 62 /// Gets or sets the name of the version.
63 /// </summary> 63 /// </summary>
64 /// <value>The name of the version.</value> 64 /// <value>The name of the version.</value>
65 public override string VersionName 65 public override string VersionName
66 { 66 {
67 get 67 get
68 { 68 {
69 return versionName; 69 return versionName;
70 } 70 }
71 } 71 }
72 /// <summary> 72 /// <summary>
73 /// Gets or sets the version. 73 /// Gets or sets the version.
74 /// </summary> 74 /// </summary>
75 /// <value>The version.</value> 75 /// <value>The version.</value>
76 public override VSVersion Version 76 public override VSVersion Version
77 { 77 {
78 get 78 get
79 { 79 {
80 return version; 80 return version;
81 } 81 }
82 } 82 }
83 /// <summary> 83 /// <summary>
84 /// Gets the name. 84 /// Gets the name.
85 /// </summary> 85 /// </summary>
86 /// <value>The name.</value> 86 /// <value>The name.</value>
87 public override string Name 87 public override string Name
88 { 88 {
89 get 89 get
90 { 90 {
91 return name; 91 return name;
92 } 92 }
93 } 93 }
94 94
95 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) 95 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
96 { 96 {
@@ -110,18 +110,18 @@ namespace Prebuild.Core.Targets
110 get { return "# Visual Studio 2008"; } 110 get { return "# Visual Studio 2008"; }
111 } 111 }
112 112
113 #endregion 113 #endregion
114 114
115 #region Constructors 115 #region Constructors
116 116
117 /// <summary> 117 /// <summary>
118 /// Initializes a new instance of the <see cref="VS2005Target"/> class. 118 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
119 /// </summary> 119 /// </summary>
120 public VS2008Target() 120 public VS2008Target()
121 : base() 121 : base()
122 { 122 {
123 } 123 }
124 124
125 #endregion 125 #endregion
126 } 126 }
127} 127}
diff --git a/Prebuild/src/Core/Targets/VS2010Target.cs b/Prebuild/src/Core/Targets/VS2010Target.cs
index b4c79dc..e8aeab5 100644
--- a/Prebuild/src/Core/Targets/VS2010Target.cs
+++ b/Prebuild/src/Core/Targets/VS2010Target.cs
@@ -11,96 +11,96 @@ using System.CodeDom.Compiler;
11namespace Prebuild.Core.Targets 11namespace Prebuild.Core.Targets
12{ 12{
13 13
14 /// <summary> 14 /// <summary>
15 /// 15 ///
16 /// </summary> 16 /// </summary>
17 [Target("vs2010")] 17 [Target("vs2010")]
18 public class VS2010Target : VSGenericTarget 18 public class VS2010Target : VSGenericTarget
19 { 19 {
20 #region Fields 20 #region Fields
21 21
22 string solutionVersion = "11.00"; 22 string solutionVersion = "11.00";
23 string productVersion = "9.0.30729"; 23 string productVersion = "9.0.30729";
24 string schemaVersion = "2.0"; 24 string schemaVersion = "2.0";
25 string versionName = "Visual Studio 2010"; 25 string versionName = "Visual Studio 2010";
26 string name = "vs2010"; 26 string name = "vs2010";
27 VSVersion version = VSVersion.VS10; 27 VSVersion version = VSVersion.VS10;
28 28
29 #endregion 29 #endregion
30 30
31 #region Properties 31 #region Properties
32 32
33 /// <summary> 33 /// <summary>
34 /// Gets or sets the solution version. 34 /// Gets or sets the solution version.
35 /// </summary> 35 /// </summary>
36 /// <value>The solution version.</value> 36 /// <value>The solution version.</value>
37 public override string SolutionVersion 37 public override string SolutionVersion
38 { 38 {
39 get 39 get
40 { 40 {
41 return solutionVersion; 41 return solutionVersion;
42 } 42 }
43 } 43 }
44 44
45 /// <summary> 45 /// <summary>
46 /// Gets or sets the product version. 46 /// Gets or sets the product version.
47 /// </summary> 47 /// </summary>
48 /// <value>The product version.</value> 48 /// <value>The product version.</value>
49 public override string ProductVersion 49 public override string ProductVersion
50 { 50 {
51 get 51 get
52 { 52 {
53 return productVersion; 53 return productVersion;
54 } 54 }
55 } 55 }
56 56
57 /// <summary> 57 /// <summary>
58 /// Gets or sets the schema version. 58 /// Gets or sets the schema version.
59 /// </summary> 59 /// </summary>
60 /// <value>The schema version.</value> 60 /// <value>The schema version.</value>
61 public override string SchemaVersion 61 public override string SchemaVersion
62 { 62 {
63 get 63 get
64 { 64 {
65 return schemaVersion; 65 return schemaVersion;
66 } 66 }
67 } 67 }
68 68
69 /// <summary> 69 /// <summary>
70 /// Gets or sets the name of the version. 70 /// Gets or sets the name of the version.
71 /// </summary> 71 /// </summary>
72 /// <value>The name of the version.</value> 72 /// <value>The name of the version.</value>
73 public override string VersionName 73 public override string VersionName
74 { 74 {
75 get 75 get
76 { 76 {
77 return versionName; 77 return versionName;
78 } 78 }
79 } 79 }
80 80
81 /// <summary> 81 /// <summary>
82 /// Gets or sets the version. 82 /// Gets or sets the version.
83 /// </summary> 83 /// </summary>
84 /// <value>The version.</value> 84 /// <value>The version.</value>
85 public override VSVersion Version 85 public override VSVersion Version
86 { 86 {
87 get 87 get
88 { 88 {
89 return version; 89 return version;
90 } 90 }
91 } 91 }
92 92
93 /// <summary> 93 /// <summary>
94 /// Gets the name. 94 /// Gets the name.
95 /// </summary> 95 /// </summary>
96 /// <value>The name.</value> 96 /// <value>The name.</value>
97 public override string Name 97 public override string Name
98 { 98 {
99 get 99 get
100 { 100 {
101 return name; 101 return name;
102 } 102 }
103 } 103 }
104 104
105 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) 105 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
106 { 106 {
@@ -110,7 +110,7 @@ namespace Prebuild.Core.Targets
110 case FrameworkVersion.v4_5: 110 case FrameworkVersion.v4_5:
111 case FrameworkVersion.v4_0: 111 case FrameworkVersion.v4_0:
112 case FrameworkVersion.v3_5: 112 case FrameworkVersion.v3_5:
113 return "ToolsVersion=\"4.0\""; 113 return "ToolsVersion=\"4.0\"";
114 case FrameworkVersion.v3_0: 114 case FrameworkVersion.v3_0:
115 return "ToolsVersion=\"3.0\""; 115 return "ToolsVersion=\"3.0\"";
116 default: 116 default:
@@ -123,18 +123,18 @@ namespace Prebuild.Core.Targets
123 get { return "# Visual Studio 2010"; } 123 get { return "# Visual Studio 2010"; }
124 } 124 }
125 125
126 #endregion 126 #endregion
127 127
128 #region Constructors 128 #region Constructors
129 129
130 /// <summary> 130 /// <summary>
131 /// Initializes a new instance of the <see cref="VS2005Target"/> class. 131 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
132 /// </summary> 132 /// </summary>
133 public VS2010Target() 133 public VS2010Target()
134 : base() 134 : base()
135 { 135 {
136 } 136 }
137 137
138 #endregion 138 #endregion
139 } 139 }
140} 140}
diff --git a/Prebuild/src/Core/Targets/VS2012Target.cs b/Prebuild/src/Core/Targets/VS2012Target.cs
new file mode 100644
index 0000000..e21c97a
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2012Target.cs
@@ -0,0 +1,138 @@
1using System;
2
3using Prebuild.Core.Attributes;
4using Prebuild.Core.Nodes;
5
6namespace Prebuild.Core.Targets
7{
8
9 /// <summary>
10 ///
11 /// </summary>
12 [Target("vs2012")]
13 public class VS2012Target : VSGenericTarget
14 {
15 #region Fields
16
17 string solutionVersion = "12.00";
18 string productVersion = "11.0.61030.0";
19 string schemaVersion = "2.0";
20 string versionName = "Visual Studio 2012";
21 string name = "vs2012";
22 VSVersion version = VSVersion.VS11;
23
24 #endregion
25
26 #region Properties
27
28 /// <summary>
29 /// Gets or sets the solution version.
30 /// </summary>
31 /// <value>The solution version.</value>
32 public override string SolutionVersion
33 {
34 get
35 {
36 return solutionVersion;
37 }
38 }
39
40 /// <summary>
41 /// Gets or sets the product version.
42 /// </summary>
43 /// <value>The product version.</value>
44 public override string ProductVersion
45 {
46 get
47 {
48 return productVersion;
49 }
50 }
51
52 /// <summary>
53 /// Gets or sets the schema version.
54 /// </summary>
55 /// <value>The schema version.</value>
56 public override string SchemaVersion
57 {
58 get
59 {
60 return schemaVersion;
61 }
62 }
63
64 /// <summary>
65 /// Gets or sets the name of the version.
66 /// </summary>
67 /// <value>The name of the version.</value>
68 public override string VersionName
69 {
70 get
71 {
72 return versionName;
73 }
74 }
75
76 /// <summary>
77 /// Gets or sets the version.
78 /// </summary>
79 /// <value>The version.</value>
80 public override VSVersion Version
81 {
82 get
83 {
84 return version;
85 }
86 }
87
88 /// <summary>
89 /// Gets the name.
90 /// </summary>
91 /// <value>The name.</value>
92 public override string Name
93 {
94 get
95 {
96 return name;
97 }
98 }
99
100 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
101 {
102 switch (frameworkVersion)
103 {
104 case FrameworkVersion.v4_6_1:
105 case FrameworkVersion.v4_6:
106 return "ToolsVersion=\"14.0\"";
107 case FrameworkVersion.v4_5_1:
108 case FrameworkVersion.v4_5:
109 case FrameworkVersion.v4_0:
110 case FrameworkVersion.v3_5:
111 return "ToolsVersion=\"4.0\"";
112 case FrameworkVersion.v3_0:
113 return "ToolsVersion=\"3.0\"";
114 default:
115 return "ToolsVersion=\"2.0\"";
116 }
117 }
118
119 public override string SolutionTag
120 {
121 get { return "# Visual Studio 2012"; }
122 }
123
124 #endregion
125
126 #region Constructors
127
128 /// <summary>
129 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
130 /// </summary>
131 public VS2012Target()
132 : base()
133 {
134 }
135
136 #endregion
137 }
138}
diff --git a/Prebuild/src/Core/Targets/VS2013Target.cs b/Prebuild/src/Core/Targets/VS2013Target.cs
new file mode 100644
index 0000000..96d8294
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2013Target.cs
@@ -0,0 +1,139 @@
1using System;
2
3using Prebuild.Core.Attributes;
4using Prebuild.Core.Nodes;
5
6namespace Prebuild.Core.Targets
7{
8
9 /// <summary>
10 ///
11 /// </summary>
12 [Target("vs2013")]
13 public class VS2013Target : VSGenericTarget
14 {
15 #region Fields
16
17 string solutionVersion = "12.00";
18 string productVersion = "12.0.31101";
19 string schemaVersion = "2.0";
20 string versionName = "Visual Studio 2013";
21 string name = "vs2013";
22 VSVersion version = VSVersion.VS12;
23
24 #endregion
25
26 #region Properties
27
28 /// <summary>
29 /// Gets or sets the solution version.
30 /// </summary>
31 /// <value>The solution version.</value>
32 public override string SolutionVersion
33 {
34 get
35 {
36 return solutionVersion;
37 }
38 }
39
40 /// <summary>
41 /// Gets or sets the product version.
42 /// </summary>
43 /// <value>The product version.</value>
44 public override string ProductVersion
45 {
46 get
47 {
48 return productVersion;
49 }
50 }
51
52 /// <summary>
53 /// Gets or sets the schema version.
54 /// </summary>
55 /// <value>The schema version.</value>
56 public override string SchemaVersion
57 {
58 get
59 {
60 return schemaVersion;
61 }
62 }
63
64 /// <summary>
65 /// Gets or sets the name of the version.
66 /// </summary>
67 /// <value>The name of the version.</value>
68 public override string VersionName
69 {
70 get
71 {
72 return versionName;
73 }
74 }
75
76 /// <summary>
77 /// Gets or sets the version.
78 /// </summary>
79 /// <value>The version.</value>
80 public override VSVersion Version
81 {
82 get
83 {
84 return version;
85 }
86 }
87
88 /// <summary>
89 /// Gets the name.
90 /// </summary>
91 /// <value>The name.</value>
92 public override string Name
93 {
94 get
95 {
96 return name;
97 }
98 }
99
100 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
101 {
102 switch (frameworkVersion)
103 {
104 case FrameworkVersion.v4_6_1:
105 case FrameworkVersion.v4_6:
106 return "ToolsVersion=\"14.0\"";
107 case FrameworkVersion.v4_5_1:
108 case FrameworkVersion.v4_5:
109 return "ToolsVersion=\"12.0\"";
110 case FrameworkVersion.v4_0:
111 case FrameworkVersion.v3_5:
112 return "ToolsVersion=\"4.0\"";
113 case FrameworkVersion.v3_0:
114 return "ToolsVersion=\"3.0\"";
115 default:
116 return "ToolsVersion=\"2.0\"";
117 }
118 }
119
120 public override string SolutionTag
121 {
122 get { return "# Visual Studio 2013"; }
123 }
124
125 #endregion
126
127 #region Constructors
128
129 /// <summary>
130 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
131 /// </summary>
132 public VS2013Target()
133 : base()
134 {
135 }
136
137 #endregion
138 }
139}
diff --git a/Prebuild/src/Core/Targets/VS2015Target.cs b/Prebuild/src/Core/Targets/VS2015Target.cs
new file mode 100644
index 0000000..b487979
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2015Target.cs
@@ -0,0 +1,143 @@
1using System;
2using System.IO;
3using System.Text;
4
5using Prebuild.Core.Attributes;
6using Prebuild.Core.Interfaces;
7using Prebuild.Core.Nodes;
8using Prebuild.Core.Utilities;
9using System.CodeDom.Compiler;
10
11namespace Prebuild.Core.Targets
12{
13
14 /// <summary>
15 ///
16 /// </summary>
17 [Target("vs2015")]
18 public class VS2015Target : VSGenericTarget
19 {
20 #region Fields
21
22 string solutionVersion = "12.00";
23 string productVersion = "14.0.23107.0";
24 string schemaVersion = "2.0";
25 string versionName = "Visual Studio 14";
26 string name = "vs2015";
27 VSVersion version = VSVersion.VS15;
28
29 #endregion
30
31 #region Properties
32
33 /// <summary>
34 /// Gets or sets the solution version.
35 /// </summary>
36 /// <value>The solution version.</value>
37 public override string SolutionVersion
38 {
39 get
40 {
41 return solutionVersion;
42 }
43 }
44
45 /// <summary>
46 /// Gets or sets the product version.
47 /// </summary>
48 /// <value>The product version.</value>
49 public override string ProductVersion
50 {
51 get
52 {
53 return productVersion;
54 }
55 }
56
57 /// <summary>
58 /// Gets or sets the schema version.
59 /// </summary>
60 /// <value>The schema version.</value>
61 public override string SchemaVersion
62 {
63 get
64 {
65 return schemaVersion;
66 }
67 }
68
69 /// <summary>
70 /// Gets or sets the name of the version.
71 /// </summary>
72 /// <value>The name of the version.</value>
73 public override string VersionName
74 {
75 get
76 {
77 return versionName;
78 }
79 }
80
81 /// <summary>
82 /// Gets or sets the version.
83 /// </summary>
84 /// <value>The version.</value>
85 public override VSVersion Version
86 {
87 get
88 {
89 return version;
90 }
91 }
92
93 /// <summary>
94 /// Gets the name.
95 /// </summary>
96 /// <value>The name.</value>
97 public override string Name
98 {
99 get
100 {
101 return name;
102 }
103 }
104
105 protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion)
106 {
107 switch (frameworkVersion)
108 {
109 case FrameworkVersion.v4_6_1:
110 case FrameworkVersion.v4_6:
111 return "ToolsVersion=\"14.0\"";
112 case FrameworkVersion.v4_5:
113 return "ToolsVersion=\"12.0\"";
114 case FrameworkVersion.v4_0:
115 case FrameworkVersion.v3_5:
116 return "ToolsVersion=\"4.0\"";
117 case FrameworkVersion.v3_0:
118 return "ToolsVersion=\"3.0\"";
119 default:
120 return "ToolsVersion=\"2.0\"";
121 }
122 }
123
124 public override string SolutionTag
125 {
126 get { return "# Visual Studio 14"; }
127 }
128
129 #endregion
130
131 #region Constructors
132
133 /// <summary>
134 /// Initializes a new instance of the <see cref="VS2012Target"/> class.
135 /// </summary>
136 public VS2015Target()
137 : base()
138 {
139 }
140
141 #endregion
142 }
143} \ No newline at end of file
diff --git a/Prebuild/src/Core/Targets/VSGenericTarget.cs b/Prebuild/src/Core/Targets/VSGenericTarget.cs
index 400788b..c12120f 100644
--- a/Prebuild/src/Core/Targets/VSGenericTarget.cs
+++ b/Prebuild/src/Core/Targets/VSGenericTarget.cs
@@ -35,141 +35,141 @@ using System.CodeDom.Compiler;
35namespace Prebuild.Core.Targets 35namespace Prebuild.Core.Targets
36{ 36{
37 37
38 /// <summary> 38 /// <summary>
39 /// 39 ///
40 /// </summary> 40 /// </summary>
41 public abstract class VSGenericTarget : ITarget 41 public abstract class VSGenericTarget : ITarget
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>(); 45 readonly Dictionary<string, ToolInfo> tools = new Dictionary<string, ToolInfo>();
46// NameValueCollection CopyFiles = new NameValueCollection(); 46// NameValueCollection CopyFiles = new NameValueCollection();
47 Kernel kernel; 47 Kernel kernel;
48 #endregion 48 #endregion
49 49
50 #region Properties 50 #region Properties
51 /// <summary> 51 /// <summary>
52 /// Gets or sets the solution version. 52 /// Gets or sets the solution version.
53 /// </summary> 53 /// </summary>
54 /// <value>The solution version.</value> 54 /// <value>The solution version.</value>
55 public abstract string SolutionVersion { get; } 55 public abstract string SolutionVersion { get; }
56 /// <summary> 56 /// <summary>
57 /// Gets or sets the product version. 57 /// Gets or sets the product version.
58 /// </summary> 58 /// </summary>
59 /// <value>The product version.</value> 59 /// <value>The product version.</value>
60 public abstract string ProductVersion { get; } 60 public abstract string ProductVersion { get; }
61 /// <summary> 61 /// <summary>
62 /// Gets or sets the schema version. 62 /// Gets or sets the schema version.
63 /// </summary> 63 /// </summary>
64 /// <value>The schema version.</value> 64 /// <value>The schema version.</value>
65 public abstract string SchemaVersion { get; } 65 public abstract string SchemaVersion { get; }
66 /// <summary> 66 /// <summary>
67 /// Gets or sets the name of the version. 67 /// Gets or sets the name of the version.
68 /// </summary> 68 /// </summary>
69 /// <value>The name of the version.</value> 69 /// <value>The name of the version.</value>
70 public abstract string VersionName { get; } 70 public abstract string VersionName { get; }
71 /// <summary> 71 /// <summary>
72 /// Gets or sets the version. 72 /// Gets or sets the version.
73 /// </summary> 73 /// </summary>
74 /// <value>The version.</value> 74 /// <value>The version.</value>
75 public abstract VSVersion Version { get; } 75 public abstract VSVersion Version { get; }
76 /// <summary> 76 /// <summary>
77 /// Gets the name. 77 /// Gets the name.
78 /// </summary> 78 /// </summary>
79 /// <value>The name.</value> 79 /// <value>The name.</value>
80 public abstract string Name { get; } 80 public abstract string Name { get; }
81 81
82 protected abstract string GetToolsVersionXml(FrameworkVersion version); 82 protected abstract string GetToolsVersionXml(FrameworkVersion version);
83 public abstract string SolutionTag { get; } 83 public abstract string SolutionTag { get; }
84 84
85 #endregion 85 #endregion
86 86
87 #region Constructors 87 #region Constructors
88 88
89 /// <summary> 89 /// <summary>
90 /// Initializes a new instance of the <see cref="VSGenericTarget"/> class. 90 /// Initializes a new instance of the <see cref="VSGenericTarget"/> class.
91 /// </summary> 91 /// </summary>
92 protected VSGenericTarget() 92 protected VSGenericTarget()
93 { 93 {
94 tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets"); 94 tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSharp.targets");
95 tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); 95 tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN");
96 tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); 96 tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets");
97 tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); 97 tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets");
98 tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); 98 tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null);
99 } 99 }
100 100
101 #endregion 101 #endregion
102 102
103 #region Private Methods 103 #region Private Methods
104 104
105 private string MakeRefPath(ProjectNode project) 105 private string MakeRefPath(ProjectNode project)
106 { 106 {
107 string ret = ""; 107 string ret = "";
108 foreach (ReferencePathNode node in project.ReferencePaths) 108 foreach (ReferencePathNode node in project.ReferencePaths)
109 { 109 {
110 try 110 try
111 { 111 {
112 string fullPath = Helper.ResolvePath(node.Path); 112 string fullPath = Helper.ResolvePath(node.Path);
113 if (ret.Length < 1) 113 if (ret.Length < 1)
114 { 114 {
115 ret = fullPath; 115 ret = fullPath;
116 } 116 }
117 else 117 else
118 { 118 {
119 ret += ";" + fullPath; 119 ret += ";" + fullPath;
120 } 120 }
121 } 121 }
122 catch (ArgumentException) 122 catch (ArgumentException)
123 { 123 {
124 kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); 124 kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
125 } 125 }
126 } 126 }
127 127
128 return ret; 128 return ret;
129 } 129 }
130 130
131 private static ProjectNode FindProjectInSolution(string name, SolutionNode solution) 131 private static ProjectNode FindProjectInSolution(string name, SolutionNode solution)
132 { 132 {
133 SolutionNode node = solution; 133 SolutionNode node = solution;
134 134
135 while (node.Parent is SolutionNode) 135 while (node.Parent is SolutionNode)
136 node = node.Parent as SolutionNode; 136 node = node.Parent as SolutionNode;
137 137
138 return FindProjectInSolutionRecursively(name, node); 138 return FindProjectInSolutionRecursively(name, node);
139 } 139 }
140 140
141 private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution) 141 private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution)
142 { 142 {
143 if (solution.ProjectsTable.ContainsKey(name)) 143 if (solution.ProjectsTable.ContainsKey(name))
144 return solution.ProjectsTable[name]; 144 return solution.ProjectsTable[name];
145 145
146 foreach (SolutionNode child in solution.Solutions) 146 foreach (SolutionNode child in solution.Solutions)
147 { 147 {
148 ProjectNode node = FindProjectInSolutionRecursively(name, child); 148 ProjectNode node = FindProjectInSolutionRecursively(name, child);
149 if (node != null) 149 if (node != null)
150 return node; 150 return node;
151 } 151 }
152 152
153 return null; 153 return null;
154 } 154 }
155 155
156 private void WriteProject(SolutionNode solution, ProjectNode project) 156 private void WriteProject(SolutionNode solution, ProjectNode project)
157 { 157 {
158 if (!tools.ContainsKey(project.Language)) 158 if (!tools.ContainsKey(project.Language))
159 { 159 {
160 throw new UnknownLanguageException("Unknown .NET language: " + project.Language); 160 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
161 } 161 }
162 162
163 ToolInfo toolInfo = tools[project.Language]; 163 ToolInfo toolInfo = tools[project.Language];
164 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 164 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
165 StreamWriter ps = new StreamWriter(projectFile); 165 StreamWriter ps = new StreamWriter(projectFile);
166 166
167 kernel.CurrentWorkingDirectory.Push(); 167 kernel.CurrentWorkingDirectory.Push();
168 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); 168 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
169 169
170 #region Project File 170 #region Project File
171 using (ps) 171 using (ps)
172 { 172 {
173 string targets = ""; 173 string targets = "";
174 174
175 if(project.Files.CopyFiles > 0) 175 if(project.Files.CopyFiles > 0)
@@ -177,347 +177,354 @@ namespace Prebuild.Core.Targets
177 else 177 else
178 targets = "Build"; 178 targets = "Build";
179 179
180 ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion)); 180 ps.WriteLine("<Project DefaultTargets=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" {1}>", targets, GetToolsVersionXml(project.FrameworkVersion));
181 ps.WriteLine(" <PropertyGroup>"); 181 ps.WriteLine(" <PropertyGroup>");
182 ps.WriteLine(" <ProjectType>Local</ProjectType>"); 182 ps.WriteLine(" <ProjectType>Local</ProjectType>");
183 ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion); 183 ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", ProductVersion);
184 ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion); 184 ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", SchemaVersion);
185 ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper()); 185 ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper());
186 186
187 // Visual Studio has a hard coded guid for the project type 187 // Visual Studio has a hard coded guid for the project type
188 if (project.Type == ProjectType.Web) 188 if (project.Type == ProjectType.Web)
189 ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>"); 189 ps.WriteLine(" <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>");
190 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>"); 190 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
191 ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon); 191 ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon);
192 ps.WriteLine(" <AssemblyKeyContainerName>"); 192 ps.WriteLine(" <AssemblyKeyContainerName>");
193 ps.WriteLine(" </AssemblyKeyContainerName>"); 193 ps.WriteLine(" </AssemblyKeyContainerName>");
194 ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName); 194 ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName);
195 foreach (ConfigurationNode conf in project.Configurations) 195 foreach (ConfigurationNode conf in project.Configurations)
196 {
197 if (conf.Options.KeyFile != "")
198 {
199 ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
200 ps.WriteLine(" <SignAssembly>true</SignAssembly>");
201 break;
202 }
203 }
204 ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
205 ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
206 ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
207 ps.WriteLine(" <DelaySign>false</DelaySign>");
208 ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", "."));
209
210 ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
211 ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
212 ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
213 ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
214 if (string.IsNullOrEmpty(project.DebugStartParameters))
215 {
216 ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters);
217 }
218 ps.WriteLine(" <FileUpgradeFlags>");
219 ps.WriteLine(" </FileUpgradeFlags>");
220
221 ps.WriteLine(" </PropertyGroup>");
222 if (!string.IsNullOrEmpty(project.ApplicationManifest))
196 { 223 {
197 if (conf.Options.KeyFile != "") 224 ps.WriteLine(" <PropertyGroup>");
198 { 225 ps.WriteLine(" <ApplicationManifest>" + project.ApplicationManifest + "</ApplicationManifest>");
199 ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
200 ps.WriteLine(" <SignAssembly>true</SignAssembly>");
201 break;
202 }
203 }
204 ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
205 ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
206 ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
207 ps.WriteLine(" <DelaySign>false</DelaySign>");
208 ps.WriteLine(" <TargetFrameworkVersion>{0}</TargetFrameworkVersion>", project.FrameworkVersion.ToString().Replace("_", "."));
209
210 ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString());
211 ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
212 ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
213 ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
214 if (string.IsNullOrEmpty(project.DebugStartParameters))
215 {
216 ps.WriteLine(" <StartArguments>{0}</StartArguments>", project.DebugStartParameters);
217 }
218 ps.WriteLine(" <FileUpgradeFlags>");
219 ps.WriteLine(" </FileUpgradeFlags>");
220
221 ps.WriteLine(" </PropertyGroup>");
222
223 foreach (ConfigurationNode conf in project.Configurations)
224 {
225 ps.Write(" <PropertyGroup ");
226 ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform);
227 ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
228 ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
229 ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
230 ps.WriteLine(" <ConfigurationOverrideFile>");
231 ps.WriteLine(" </ConfigurationOverrideFile>");
232 ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]);
233 ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
234 ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
235 ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
236 ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
237 if (project.Type != ProjectType.Web)
238 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
239 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
240 else
241 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
242 Helper.EndPath(Helper.NormalizePath("bin\\")));
243
244 ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
245 ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
246 ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
247 ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
248 ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
249 ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
250 ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform);
251 ps.WriteLine(" </PropertyGroup>"); 226 ps.WriteLine(" </PropertyGroup>");
252 } 227 }
253 228 foreach (ConfigurationNode conf in project.Configurations)
254 //ps.WriteLine(" </Settings>"); 229 {
255 230 ps.Write(" <PropertyGroup ");
256 Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>(); 231 ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform);
257 List<ReferenceNode> otherReferences = new List<ReferenceNode>(); 232 ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
258 233 ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
259 foreach (ReferenceNode refr in project.References) 234 ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
260 { 235 ps.WriteLine(" <ConfigurationOverrideFile>");
261 ProjectNode projectNode = FindProjectInSolution(refr.Name, solution); 236 ps.WriteLine(" </ConfigurationOverrideFile>");
262 237 ps.WriteLine(" <DefineConstants>{0}</DefineConstants>",
263 if (projectNode == null) 238 conf.Options["CompilerDefines"].ToString() == "" ? this.kernel.ForcedConditionals : conf.Options["CompilerDefines"] + ";" + kernel.ForcedConditionals);
264 otherReferences.Add(refr); 239 ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
265 else 240 ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
266 projectReferences.Add(refr, projectNode); 241 ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
267 } 242 ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
268 // Assembly References 243 if (project.Type != ProjectType.Web)
269 ps.WriteLine(" <ItemGroup>"); 244 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
270 245 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
271 foreach (ReferenceNode refr in otherReferences) 246 else
272 { 247 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
273 ps.Write(" <Reference"); 248 Helper.EndPath(Helper.NormalizePath("bin\\")));
274 ps.Write(" Include=\""); 249
275 ps.Write(refr.Name); 250 ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
276 ps.WriteLine("\" >"); 251 ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
277 ps.Write(" <Name>"); 252 ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
278 ps.Write(refr.Name); 253 ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
279 ps.WriteLine("</Name>"); 254 ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
280 255 ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
281 if(!String.IsNullOrEmpty(refr.Path)) 256 ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform);
282 { 257 ps.WriteLine(" <Prefer32Bit>{0}</Prefer32Bit>",conf.Options["Prefer32Bit"]);
283 // Use absolute path to assembly (for determining assembly type) 258 ps.WriteLine(" </PropertyGroup>");
284 string absolutePath = Path.Combine(project.FullPath, refr.Path); 259 }
285 if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) { 260
286 // Assembly is an executable (exe) 261 //ps.WriteLine(" </Settings>");
287 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe")); 262
288 } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) { 263 Dictionary<ReferenceNode, ProjectNode> projectReferences = new Dictionary<ReferenceNode, ProjectNode>();
289 // Assembly is an library (dll) 264 List<ReferenceNode> otherReferences = new List<ReferenceNode>();
290 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); 265
291 } else { 266 foreach (ReferenceNode refr in project.References)
292 string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll"); 267 {
293 kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath); 268 ProjectNode projectNode = FindProjectInSolution(refr.Name, solution);
294 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); 269
295 } 270 if (projectNode == null)
296 } 271 otherReferences.Add(refr);
297 272 else
298 ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy); 273 projectReferences.Add(refr, projectNode);
299 ps.WriteLine(" </Reference>"); 274 }
300 } 275 // Assembly References
301 ps.WriteLine(" </ItemGroup>"); 276 ps.WriteLine(" <ItemGroup>");
302 277
303 //Project References 278 foreach (ReferenceNode refr in otherReferences)
304 ps.WriteLine(" <ItemGroup>"); 279 {
305 foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences) 280 ps.Write(" <Reference");
306 { 281 ps.Write(" Include=\"");
307 ToolInfo tool = tools[pair.Value.Language]; 282 ps.Write(refr.Name);
308 if (tools == null) 283 ps.WriteLine("\" >");
309 throw new UnknownLanguageException(); 284 ps.Write(" <Name>");
310 285 ps.Write(refr.Name);
311 string path = 286 ps.WriteLine("</Name>");
312 Helper.MakePathRelativeTo(project.FullPath, 287
313 Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension)); 288 if(!String.IsNullOrEmpty(refr.Path))
314 ps.WriteLine(" <ProjectReference Include=\"{0}\">", path); 289 {
315 290 // Use absolute path to assembly (for determining assembly type)
316 // TODO: Allow reference to visual basic projects 291 string absolutePath = Path.Combine(project.FullPath, refr.Path);
317 ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name); 292 if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) {
318 ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper()); 293 // Assembly is an executable (exe)
319 ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper()); 294 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
320 295 } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) {
321 //This is the Copy Local flag in VS 296 // Assembly is an library (dll)
322 ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy); 297 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
323 298 } else {
324 ps.WriteLine(" </ProjectReference>"); 299 string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll");
325 } 300 kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath);
326 ps.WriteLine(" </ItemGroup>"); 301 ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
327 302 }
328 // ps.WriteLine(" </Build>"); 303 }
329 ps.WriteLine(" <ItemGroup>"); 304
330 305 ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
331 // ps.WriteLine(" <Include>"); 306 ps.WriteLine(" </Reference>");
332 List<string> list = new List<string>(); 307 }
333 308 ps.WriteLine(" </ItemGroup>");
334 foreach (string path in project.Files) 309
335 { 310 //Project References
336 string lower = path.ToLower(); 311 ps.WriteLine(" <ItemGroup>");
337 if (lower.EndsWith(".resx")) 312 foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences)
338 { 313 {
339 string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension); 314 ToolInfo tool = tools[pair.Value.Language];
340 if (!list.Contains(codebehind)) 315 if (tools == null)
341 list.Add(codebehind); 316 throw new UnknownLanguageException();
342 } 317
343 318 string path =
344 } 319 Helper.MakePathRelativeTo(project.FullPath,
345 320 Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension));
346 321 ps.WriteLine(" <ProjectReference Include=\"{0}\">", path);
347 foreach (string filePath in project.Files) 322
348 { 323 // TODO: Allow reference to visual basic projects
324 ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name);
325 ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper());
326 ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper());
327
328 //This is the Copy Local flag in VS
329 ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy);
330
331 ps.WriteLine(" </ProjectReference>");
332 }
333 ps.WriteLine(" </ItemGroup>");
334
335 // ps.WriteLine(" </Build>");
336 ps.WriteLine(" <ItemGroup>");
337
338 // ps.WriteLine(" <Include>");
339 List<string> list = new List<string>();
340
341 foreach (string path in project.Files)
342 {
343 string lower = path.ToLower();
344 if (lower.EndsWith(".resx"))
345 {
346 string codebehind = String.Format("{0}.Designer{1}", path.Substring(0, path.LastIndexOf('.')), toolInfo.LanguageExtension);
347 if (!list.Contains(codebehind))
348 list.Add(codebehind);
349 }
350
351 }
352
353
354 foreach (string filePath in project.Files)
355 {
349 // Add the filePath with the destination as the key 356 // Add the filePath with the destination as the key
350 // will use it later to form the copy parameters with Include lists 357 // will use it later to form the copy parameters with Include lists
351 // for each destination 358 // for each destination
352 if (project.Files.GetBuildAction(filePath) == BuildAction.Copy) 359 if (project.Files.GetBuildAction(filePath) == BuildAction.Copy)
353 continue; 360 continue;
354 // if (file == "Properties\\Bind.Designer.cs") 361 // if (file == "Properties\\Bind.Designer.cs")
355 // { 362 // {
356 // Console.WriteLine("Wait a minute!"); 363 // Console.WriteLine("Wait a minute!");
357 // Console.WriteLine(project.Files.GetSubType(file).ToString()); 364 // Console.WriteLine(project.Files.GetSubType(file).ToString());
358 // } 365 // }
359 SubType subType = project.Files.GetSubType(filePath); 366 SubType subType = project.Files.GetSubType(filePath);
360 367
361 // Visual Studio chokes on file names if forward slash is used as a path separator 368 // Visual Studio chokes on file names if forward slash is used as a path separator
362 // instead of backslash. So we must make sure that all file paths written to the 369 // instead of backslash. So we must make sure that all file paths written to the
363 // project file use \ as a path separator. 370 // project file use \ as a path separator.
364 string file = filePath.Replace(@"/", @"\"); 371 string file = filePath.Replace(@"/", @"\");
365 372
366 if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer 373 if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer
367 && subType != SubType.CodeBehind) 374 && subType != SubType.CodeBehind)
368 { 375 {
369 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); 376 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
370 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file)); 377 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
371 ps.WriteLine(" <SubType>Designer</SubType>"); 378 ps.WriteLine(" <SubType>Designer</SubType>");
372 ps.WriteLine(" </EmbeddedResource>"); 379 ps.WriteLine(" </EmbeddedResource>");
373 // 380 //
374 } 381 }
375 382
376 if (subType == SubType.Designer) 383 if (subType == SubType.Designer)
377 { 384 {
378 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file); 385 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
379 386
380 string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs"; 387 string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs";
381 string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs"; 388 string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs";
382 389
383 // Check for a parent .cs file with the same name as this designer file 390 // Check for a parent .cs file with the same name as this designer file
384 if (File.Exists(Helper.NormalizePath(dependent_name))) 391 if (File.Exists(Helper.NormalizePath(dependent_name)))
385 { 392 {
386 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); 393 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
387 } 394 }
388 else 395 else
389 { 396 {
390 ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>"); 397 ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
391 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name)); 398 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
392 ps.WriteLine(" <SubType>" + subType + "</SubType>"); 399 ps.WriteLine(" <SubType>" + subType + "</SubType>");
393 } 400 }
394 401
395 ps.WriteLine(" </EmbeddedResource>"); 402 ps.WriteLine(" </EmbeddedResource>");
396 if (File.Exists(Helper.NormalizePath(autogen_name))) 403 if (File.Exists(Helper.NormalizePath(autogen_name)))
397 { 404 {
398 ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name); 405 ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
399 //ps.WriteLine(" <DesignTime>True</DesignTime>"); 406 //ps.WriteLine(" <DesignTime>True</DesignTime>");
400 407
401 // If a parent .cs file exists, link this autogen file to it. Otherwise link 408 // If a parent .cs file exists, link this autogen file to it. Otherwise link
402 // to the designer file 409 // to the designer file
403 if (File.Exists(dependent_name)) 410 if (File.Exists(dependent_name))
404 { 411 {
405 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name)); 412 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
406 } 413 }
407 else 414 else
408 { 415 {
409 ps.WriteLine(" <AutoGen>True</AutoGen>"); 416 ps.WriteLine(" <AutoGen>True</AutoGen>");
410 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath)); 417 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
411 } 418 }
412 419
413 ps.WriteLine(" </Compile>"); 420 ps.WriteLine(" </Compile>");
414 } 421 }
415 list.Add(autogen_name); 422 list.Add(autogen_name);
416 } 423 }
417 if (subType == SubType.Settings) 424 if (subType == SubType.Settings)
418 { 425 {
419 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); 426 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
420 ps.WriteLine("Include=\"{0}\">", file); 427 ps.WriteLine("Include=\"{0}\">", file);
421 string fileName = Path.GetFileName(filePath); 428 string fileName = Path.GetFileName(filePath);
422 if (project.Files.GetBuildAction(filePath) == BuildAction.None) 429 if (project.Files.GetBuildAction(filePath) == BuildAction.None)
423 { 430 {
424 ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>"); 431 ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
425 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); 432 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
426 } 433 }
427 else 434 else
428 { 435 {
429 ps.WriteLine(" <SubType>Code</SubType>"); 436 ps.WriteLine(" <SubType>Code</SubType>");
430 ps.WriteLine(" <AutoGen>True</AutoGen>"); 437 ps.WriteLine(" <AutoGen>True</AutoGen>");
431 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); 438 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
432 string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.')); 439 string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
433 string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.')); 440 string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
434 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings")); 441 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
435 } 442 }
436 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); 443 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
437 } 444 }
438 else if (subType != SubType.Designer) 445 else if (subType != SubType.Designer)
439 { 446 {
440 string path = Helper.NormalizePath(file); 447 string path = Helper.NormalizePath(file);
441 string path_lower = path.ToLower(); 448 string path_lower = path.ToLower();
442 449
443 if (!list.Contains(filePath)) 450 if (!list.Contains(filePath))
444 { 451 {
445 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); 452 ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
446 453
447 int startPos = 0; 454 int startPos = 0;
448 if (project.Files.GetPreservePath(filePath)) 455 if (project.Files.GetPreservePath(filePath))
449 { 456 {
450 while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1) 457 while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1)
451 startPos++; 458 startPos++;
452 459
453 } 460 }
454 else 461 else
455 { 462 {
456 startPos = file.LastIndexOf(Path.GetFileName(path)); 463 startPos = file.LastIndexOf(Path.GetFileName(path));
457 } 464 }
458 465
459 // be sure to write out the path with backslashes so VS recognizes 466 // be sure to write out the path with backslashes so VS recognizes
460 // the file properly. 467 // the file properly.
461 ps.WriteLine("Include=\"{0}\">", file); 468 ps.WriteLine("Include=\"{0}\">", file);
462 469
463 int last_period_index = file.LastIndexOf('.'); 470 int last_period_index = file.LastIndexOf('.');
464 string short_file_name = (last_period_index >= 0) 471 string short_file_name = (last_period_index >= 0)
465 ? file.Substring(0, last_period_index) 472 ? file.Substring(0, last_period_index)
466 : file; 473 : file;
467 string extension = Path.GetExtension(path); 474 string extension = Path.GetExtension(path);
468 // make this upper case, so that when File.Exists tests for the 475 // make this upper case, so that when File.Exists tests for the
469 // existence of a designer file on a case-sensitive platform, 476 // existence of a designer file on a case-sensitive platform,
470 // it is correctly identified. 477 // it is correctly identified.
471 string designer_format = string.Format(".Designer{0}", extension); 478 string designer_format = string.Format(".Designer{0}", extension);
472 479
473 if (path_lower.EndsWith(designer_format.ToLowerInvariant())) 480 if (path_lower.EndsWith(designer_format.ToLowerInvariant()))
474 { 481 {
475 int designer_index = path.IndexOf(designer_format); 482 int designer_index = path.IndexOf(designer_format);
476 string file_name = path.Substring(0, designer_index); 483 string file_name = path.Substring(0, designer_index);
477 484
478 // There are two corrections to the next lines: 485 // There are two corrections to the next lines:
479 // 1. Fix the connection between a designer file and a form 486 // 1. Fix the connection between a designer file and a form
480 // or usercontrol that don't have an associated resx file. 487 // or usercontrol that don't have an associated resx file.
481 // 2. Connect settings files to associated designer files. 488 // 2. Connect settings files to associated designer files.
482 if (File.Exists(file_name + extension)) 489 if (File.Exists(file_name + extension))
483 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension)); 490 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
484 else if (File.Exists(file_name + ".resx")) 491 else if (File.Exists(file_name + ".resx"))
485 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx")); 492 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
486 else if (File.Exists(file_name + ".settings")) 493 else if (File.Exists(file_name + ".settings"))
487 { 494 {
488 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings")); 495 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
489 ps.WriteLine(" <AutoGen>True</AutoGen>"); 496 ps.WriteLine(" <AutoGen>True</AutoGen>");
490 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>"); 497 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
491 } 498 }
492 } 499 }
493 else if (subType == SubType.CodeBehind) 500 else if (subType == SubType.CodeBehind)
494 { 501 {
495 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name)); 502 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
496 } 503 }
497 if (project.Files.GetIsLink(filePath)) 504 if (project.Files.GetIsLink(filePath))
498 { 505 {
499 string alias = project.Files.GetLinkPath(filePath); 506 string alias = project.Files.GetLinkPath(filePath);
500 alias += file.Substring(startPos); 507 alias += file.Substring(startPos);
501 alias = Helper.NormalizePath(alias); 508 alias = Helper.NormalizePath(alias);
502 ps.WriteLine(" <Link>{0}</Link>", alias); 509 ps.WriteLine(" <Link>{0}</Link>", alias);
503 } 510 }
504 else if (project.Files.GetBuildAction(filePath) != BuildAction.None) 511 else if (project.Files.GetBuildAction(filePath) != BuildAction.None)
505 { 512 {
506 if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource) 513 if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource)
507 { 514 {
508 ps.WriteLine(" <SubType>{0}</SubType>", subType); 515 ps.WriteLine(" <SubType>{0}</SubType>", subType);
509 } 516 }
510 } 517 }
511 518
512 if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never) 519 if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never)
513 { 520 {
514 ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath)); 521 ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
515 } 522 }
516 523
517 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath)); 524 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
518 } 525 }
519 } 526 }
520 } 527 }
521 ps.WriteLine(" </ItemGroup>"); 528 ps.WriteLine(" </ItemGroup>");
522 529
523 /* 530 /*
@@ -553,420 +560,420 @@ namespace Prebuild.Core.Targets
553 ps.WriteLine(" </Target>"); 560 ps.WriteLine(" </Target>");
554 } 561 }
555 562
556 ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />"); 563 ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
557 ps.WriteLine(" <PropertyGroup>"); 564 ps.WriteLine(" <PropertyGroup>");
558 ps.WriteLine(" <PreBuildEvent>"); 565 ps.WriteLine(" <PreBuildEvent>");
559 ps.WriteLine(" </PreBuildEvent>"); 566 ps.WriteLine(" </PreBuildEvent>");
560 ps.WriteLine(" <PostBuildEvent>"); 567 ps.WriteLine(" <PostBuildEvent>");
561 ps.WriteLine(" </PostBuildEvent>"); 568 ps.WriteLine(" </PostBuildEvent>");
562 ps.WriteLine(" </PropertyGroup>"); 569 ps.WriteLine(" </PropertyGroup>");
563 ps.WriteLine("</Project>"); 570 ps.WriteLine("</Project>");
564 } 571 }
565 #endregion 572 #endregion
566 573
567 #region User File 574 #region User File
568 575
569 ps = new StreamWriter(projectFile + ".user"); 576 ps = new StreamWriter(projectFile + ".user");
570 using (ps) 577 using (ps)
571 { 578 {
572 // Get the first configuration from the project. 579 // Get the first configuration from the project.
573 ConfigurationNode firstConfiguration = null; 580 ConfigurationNode firstConfiguration = null;
574 581
575 if (project.Configurations.Count > 0) 582 if (project.Configurations.Count > 0)
576 { 583 {
577 firstConfiguration = project.Configurations[0]; 584 firstConfiguration = project.Configurations[0];
578 } 585 }
579 586
580 ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">"); 587 ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
581 //ps.WriteLine( "<VisualStudioProject>" ); 588 //ps.WriteLine( "<VisualStudioProject>" );
582 //ps.WriteLine(" <{0}>", toolInfo.XMLTag); 589 //ps.WriteLine(" <{0}>", toolInfo.XMLTag);
583 //ps.WriteLine(" <Build>"); 590 //ps.WriteLine(" <Build>");
584 ps.WriteLine(" <PropertyGroup>"); 591 ps.WriteLine(" <PropertyGroup>");
585 //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project)); 592 //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
586 593
587 if (firstConfiguration != null) 594 if (firstConfiguration != null)
588 { 595 {
589 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name); 596 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">{0}</Configuration>", firstConfiguration.Name);
590 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform); 597 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">{0}</Platform>", firstConfiguration.Platform);
591 } 598 }
592 599
593 ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project)); 600 ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project));
594 ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion); 601 ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", ProductVersion);
595 ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>"); 602 ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>");
596 ps.WriteLine(" <ProjectTrust>0</ProjectTrust>"); 603 ps.WriteLine(" <ProjectTrust>0</ProjectTrust>");
597 ps.WriteLine(" </PropertyGroup>"); 604 ps.WriteLine(" </PropertyGroup>");
598 foreach (ConfigurationNode conf in project.Configurations) 605 foreach (ConfigurationNode conf in project.Configurations)
599 { 606 {
600 ps.Write(" <PropertyGroup"); 607 ps.Write(" <PropertyGroup");
601 ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform); 608 ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|{1}' \"", conf.Name, conf.Platform);
602 ps.WriteLine(" />"); 609 ps.WriteLine(" />");
603 } 610 }
604 ps.WriteLine("</Project>"); 611 ps.WriteLine("</Project>");
605 } 612 }
606 #endregion 613 #endregion
607 614
608 kernel.CurrentWorkingDirectory.Pop(); 615 kernel.CurrentWorkingDirectory.Pop();
609 } 616 }
610 617
611 private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) 618 private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk)
612 { 619 {
613 kernel.Log.Write("Creating {0} solution and project files", VersionName); 620 kernel.Log.Write("Creating {0} solution and project files", VersionName);
614 621
615 foreach (SolutionNode child in solution.Solutions) 622 foreach (SolutionNode child in solution.Solutions)
616 { 623 {
617 kernel.Log.Write("...Creating folder: {0}", child.Name); 624 kernel.Log.Write("...Creating folder: {0}", child.Name);
618 WriteSolution(child, false); 625 WriteSolution(child, false);
619 } 626 }
620 627
621 foreach (ProjectNode project in solution.Projects) 628 foreach (ProjectNode project in solution.Projects)
622 { 629 {
623 kernel.Log.Write("...Creating project: {0}", project.Name); 630 kernel.Log.Write("...Creating project: {0}", project.Name);
624 WriteProject(solution, project); 631 WriteProject(solution, project);
625 } 632 }
626 633
627 foreach (DatabaseProjectNode project in solution.DatabaseProjects) 634 foreach (DatabaseProjectNode project in solution.DatabaseProjects)
628 { 635 {
629 kernel.Log.Write("...Creating database project: {0}", project.Name); 636 kernel.Log.Write("...Creating database project: {0}", project.Name);
630 WriteDatabaseProject(solution, project); 637 WriteDatabaseProject(solution, project);
631 } 638 }
632 639
633 if (writeSolutionToDisk) // only write main solution 640 if (writeSolutionToDisk) // only write main solution
634 { 641 {
635 kernel.Log.Write(""); 642 kernel.Log.Write("");
636 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 643 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
637 644
638 using (StreamWriter ss = new StreamWriter(solutionFile)) 645 using (StreamWriter ss = new StreamWriter(solutionFile))
639 { 646 {
640 kernel.CurrentWorkingDirectory.Push(); 647 kernel.CurrentWorkingDirectory.Push();
641 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); 648 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
642 649
643 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); 650 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion);
644 ss.WriteLine(SolutionTag); 651 ss.WriteLine(SolutionTag);
645 652
646 WriteProjectDeclarations(ss, solution, solution); 653 WriteProjectDeclarations(ss, solution, solution);
647 654
648 ss.WriteLine("Global"); 655 ss.WriteLine("Global");
649 656
650 ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); 657 ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");
651 foreach (ConfigurationNode conf in solution.Configurations) 658 foreach (ConfigurationNode conf in solution.Configurations)
652 { 659 {
653 ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform); 660 ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform);
654 } 661 }
655 ss.WriteLine("\tEndGlobalSection"); 662 ss.WriteLine("\tEndGlobalSection");
656 663
657 ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); 664 ss.WriteLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
658 WriteConfigurationLines(solution.Configurations, solution, ss); 665 WriteConfigurationLines(solution.Configurations, solution, ss);
659 ss.WriteLine("\tEndGlobalSection"); 666 ss.WriteLine("\tEndGlobalSection");
660 667
661 if (solution.Solutions.Count > 0) 668 if (solution.Solutions.Count > 0)
662 { 669 {
663 ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution"); 670 ss.WriteLine("\tGlobalSection(NestedProjects) = preSolution");
664 foreach (SolutionNode embeddedSolution in solution.Solutions) 671 foreach (SolutionNode embeddedSolution in solution.Solutions)
665 { 672 {
666 WriteNestedProjectMap(ss, embeddedSolution); 673 WriteNestedProjectMap(ss, embeddedSolution);
667 } 674 }
668 ss.WriteLine("\tEndGlobalSection"); 675 ss.WriteLine("\tEndGlobalSection");
669 } 676 }
670 677
671 ss.WriteLine("EndGlobal"); 678 ss.WriteLine("EndGlobal");
672 } 679 }
673 680
674 kernel.CurrentWorkingDirectory.Pop(); 681 kernel.CurrentWorkingDirectory.Pop();
675 } 682 }
676 } 683 }
677 684
678 private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) 685 private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution)
679 { 686 {
680 foreach (SolutionNode childSolution in embeddedSolution.Solutions) 687 foreach (SolutionNode childSolution in embeddedSolution.Solutions)
681 { 688 {
682 WriteEmbeddedSolution(writer, childSolution); 689 WriteEmbeddedSolution(writer, childSolution);
683 WriteProjectDeclarations(writer, actualSolution, childSolution); 690 WriteProjectDeclarations(writer, actualSolution, childSolution);
684 } 691 }
685 692
686 foreach (ProjectNode project in embeddedSolution.Projects) 693 foreach (ProjectNode project in embeddedSolution.Projects)
687 { 694 {
688 WriteProject(actualSolution, writer, project); 695 WriteProject(actualSolution, writer, project);
689 } 696 }
690 697
691 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) 698 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
692 { 699 {
693 WriteProject(actualSolution, writer, dbProject); 700 WriteProject(actualSolution, writer, dbProject);
694 } 701 }
695 702
696 if (actualSolution.Guid == embeddedSolution.Guid) 703 if (actualSolution.Guid == embeddedSolution.Guid)
697 { 704 {
698 WriteSolutionFiles(actualSolution, writer); 705 WriteSolutionFiles(actualSolution, writer);
699 } 706 }
700 } 707 }
701 708
702 private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution) 709 private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution)
703 { 710 {
704 foreach (ProjectNode project in embeddedSolution.Projects) 711 foreach (ProjectNode project in embeddedSolution.Projects)
705 { 712 {
706 WriteNestedProject(writer, embeddedSolution, project.Guid); 713 WriteNestedProject(writer, embeddedSolution, project.Guid);
707 } 714 }
708 715
709 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects) 716 foreach (DatabaseProjectNode dbProject in embeddedSolution.DatabaseProjects)
710 { 717 {
711 WriteNestedProject(writer, embeddedSolution, dbProject.Guid); 718 WriteNestedProject(writer, embeddedSolution, dbProject.Guid);
712 } 719 }
713 720
714 foreach (SolutionNode child in embeddedSolution.Solutions) 721 foreach (SolutionNode child in embeddedSolution.Solutions)
715 { 722 {
716 WriteNestedProject(writer, embeddedSolution, child.Guid); 723 WriteNestedProject(writer, embeddedSolution, child.Guid);
717 WriteNestedProjectMap(writer, child); 724 WriteNestedProjectMap(writer, child);
718 } 725 }
719 } 726 }
720 727
721 private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid) 728 private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid)
722 { 729 {
723 WriteNestedFolder(writer, solution.Guid, projectGuid); 730 WriteNestedFolder(writer, solution.Guid, projectGuid);
724 } 731 }
725 732
726 private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid) 733 private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid)
727 { 734 {
728 writer.WriteLine("\t\t{0} = {1}", 735 writer.WriteLine("\t\t{0} = {1}",
729 childGuid.ToString("B").ToUpper(), 736 childGuid.ToString("B").ToUpper(),
730 parentGuid.ToString("B").ToUpper()); 737 parentGuid.ToString("B").ToUpper());
731 } 738 }
732 739
733 private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss) 740 private static void WriteConfigurationLines(IEnumerable<ConfigurationNode> configurations, SolutionNode solution, TextWriter ss)
734 { 741 {
735 foreach (ProjectNode project in solution.Projects) 742 foreach (ProjectNode project in solution.Projects)
736 { 743 {
737 foreach (ConfigurationNode conf in configurations) 744 foreach (ConfigurationNode conf in configurations)
738 { 745 {
739 ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}", 746 ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}",
740 project.Guid.ToString("B").ToUpper(), 747 project.Guid.ToString("B").ToUpper(),
741 conf.NameAndPlatform); 748 conf.NameAndPlatform);
742 749
743 ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}", 750 ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}",
744 project.Guid.ToString("B").ToUpper(), 751 project.Guid.ToString("B").ToUpper(),
745 conf.NameAndPlatform); 752 conf.NameAndPlatform);
746 } 753 }
747 } 754 }
748 755
749 foreach (SolutionNode child in solution.Solutions) 756 foreach (SolutionNode child in solution.Solutions)
750 { 757 {
751 WriteConfigurationLines(configurations, child, ss); 758 WriteConfigurationLines(configurations, child, ss);
752 } 759 }
753 } 760 }
754 761
755 private void WriteSolutionFiles(SolutionNode solution, TextWriter ss) 762 private void WriteSolutionFiles(SolutionNode solution, TextWriter ss)
756 { 763 {
757 if(solution.Files != null && solution.Files.Count > 0) 764 if(solution.Files != null && solution.Files.Count > 0)
758 WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); 765 WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files);
759 } 766 }
760 767
761 private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution) 768 private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution)
762 { 769 {
763 WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files); 770 WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files);
764 } 771 }
765 772
766 private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project) 773 private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project)
767 { 774 {
768 WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath); 775 WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath);
769 } 776 }
770 777
771 private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject) 778 private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject)
772 { 779 {
773 if (solution.Files != null && solution.Files.Count > 0) 780 if (solution.Files != null && solution.Files.Count > 0)
774 WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath); 781 WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath);
775 } 782 }
776 783
777 const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\""; 784 const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\"";
778 const string ProjectDeclarationEndFormat = "EndProject"; 785 const string ProjectDeclarationEndFormat = "EndProject";
779 786
780 private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) 787 private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath)
781 { 788 {
782 if (!tools.ContainsKey(language)) 789 if (!tools.ContainsKey(language))
783 throw new UnknownLanguageException("Unknown .NET language: " + language); 790 throw new UnknownLanguageException("Unknown .NET language: " + language);
784 791
785 ToolInfo toolInfo = tools[language]; 792 ToolInfo toolInfo = tools[language];
786 793
787 string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath); 794 string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath);
788 795
789 path = Helper.MakeFilePath(path, name, toolInfo.FileExtension); 796 path = Helper.MakeFilePath(path, name, toolInfo.FileExtension);
790 797
791 WriteProject(ss, language, guid, name, path); 798 WriteProject(ss, language, guid, name, path);
792 } 799 }
793 800
794 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location) 801 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location)
795 { 802 {
796 WriteProject(writer, language, projectGuid, name, location, null); 803 WriteProject(writer, language, projectGuid, name, location, null);
797 } 804 }
798 805
799 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) 806 private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files)
800 { 807 {
801 if (!tools.ContainsKey(language)) 808 if (!tools.ContainsKey(language))
802 throw new UnknownLanguageException("Unknown .NET language: " + language); 809 throw new UnknownLanguageException("Unknown .NET language: " + language);
803 810
804 ToolInfo toolInfo = tools[language]; 811 ToolInfo toolInfo = tools[language];
805 812
806 writer.WriteLine(ProjectDeclarationBeginFormat, 813 writer.WriteLine(ProjectDeclarationBeginFormat,
807 toolInfo.Guid, 814 toolInfo.Guid,
808 name, 815 name,
809 location, 816 location,
810 projectGuid.ToString("B").ToUpper()); 817 projectGuid.ToString("B").ToUpper());
811 818
812 if (files != null) 819 if (files != null)
813 { 820 {
814 writer.WriteLine("\tProjectSection(SolutionItems) = preProject"); 821 writer.WriteLine("\tProjectSection(SolutionItems) = preProject");
815 822
816 foreach (string file in files) 823 foreach (string file in files)
817 writer.WriteLine("\t\t{0} = {0}", file); 824 writer.WriteLine("\t\t{0} = {0}", file);
818 825
819 writer.WriteLine("\tEndProjectSection"); 826 writer.WriteLine("\tEndProjectSection");
820 } 827 }
821 828
822 writer.WriteLine(ProjectDeclarationEndFormat); 829 writer.WriteLine(ProjectDeclarationEndFormat);
823 } 830 }
824 831
825 private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project) 832 private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project)
826 { 833 {
827 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp"); 834 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp");
828 IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); 835 IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " ");
829 836
830 kernel.CurrentWorkingDirectory.Push(); 837 kernel.CurrentWorkingDirectory.Push();
831 838
832 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); 839 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
833 840
834 using (ps) 841 using (ps)
835 { 842 {
836 ps.WriteLine("# Microsoft Developer Studio Project File - Database Project"); 843 ps.WriteLine("# Microsoft Developer Studio Project File - Database Project");
837 ps.WriteLine("Begin DataProject = \"{0}\"", project.Name); 844 ps.WriteLine("Begin DataProject = \"{0}\"", project.Name);
838 ps.Indent++; 845 ps.Indent++;
839 ps.WriteLine("MSDTVersion = \"80\""); 846 ps.WriteLine("MSDTVersion = \"80\"");
840 // TODO: Use the project.Files property 847 // TODO: Use the project.Files property
841 if (ContainsSqlFiles(Path.GetDirectoryName(projectFile))) 848 if (ContainsSqlFiles(Path.GetDirectoryName(projectFile)))
842 WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile)); 849 WriteDatabaseFoldersAndFiles(ps, Path.GetDirectoryName(projectFile));
843 850
844 ps.WriteLine("Begin DBRefFolder = \"Database References\""); 851 ps.WriteLine("Begin DBRefFolder = \"Database References\"");
845 ps.Indent++; 852 ps.Indent++;
846 foreach (DatabaseReferenceNode reference in project.References) 853 foreach (DatabaseReferenceNode reference in project.References)
847 { 854 {
848 ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name); 855 ps.WriteLine("Begin DBRefNode = \"{0}\"", reference.Name);
849 ps.Indent++; 856 ps.Indent++;
850 ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString); 857 ps.WriteLine("ConnectStr = \"{0}\"", reference.ConnectionString);
851 ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper()); 858 ps.WriteLine("Provider = \"{0}\"", reference.ProviderId.ToString("B").ToUpper());
852 //ps.WriteLine("Colorizer = 5"); 859 //ps.WriteLine("Colorizer = 5");
853 ps.Indent--; 860 ps.Indent--;
854 ps.WriteLine("End"); 861 ps.WriteLine("End");
855 } 862 }
856 ps.Indent--; 863 ps.Indent--;
857 ps.WriteLine("End"); 864 ps.WriteLine("End");
858 ps.Indent--; 865 ps.Indent--;
859 ps.WriteLine("End"); 866 ps.WriteLine("End");
860 867
861 ps.Flush(); 868 ps.Flush();
862 } 869 }
863 870
864 kernel.CurrentWorkingDirectory.Pop(); 871 kernel.CurrentWorkingDirectory.Pop();
865 } 872 }
866 873
867 private static bool ContainsSqlFiles(string folder) 874 private static bool ContainsSqlFiles(string folder)
868 { 875 {
869 if(Directory.GetFiles(folder, "*.sql").Length > 0) 876 if(Directory.GetFiles(folder, "*.sql").Length > 0)
870 return true; // if the folder contains 1 .sql file, that's good enough 877 return true; // if the folder contains 1 .sql file, that's good enough
871 878
872 foreach (string child in Directory.GetDirectories(folder)) 879 foreach (string child in Directory.GetDirectories(folder))
873 { 880 {
874 if (ContainsSqlFiles(child)) 881 if (ContainsSqlFiles(child))
875 return true; // if 1 child folder contains a .sql file, still good enough 882 return true; // if 1 child folder contains a .sql file, still good enough
876 } 883 }
877 884
878 return false; 885 return false;
879 } 886 }
880 887
881 private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) 888 private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder)
882 { 889 {
883 foreach (string child in Directory.GetDirectories(folder)) 890 foreach (string child in Directory.GetDirectories(folder))
884 { 891 {
885 if (ContainsSqlFiles(child)) 892 if (ContainsSqlFiles(child))
886 { 893 {
887 writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child)); 894 writer.WriteLine("Begin Folder = \"{0}\"", Path.GetFileName(child));
888 writer.Indent++; 895 writer.Indent++;
889 WriteDatabaseFoldersAndFiles(writer, child); 896 WriteDatabaseFoldersAndFiles(writer, child);
890 writer.Indent--; 897 writer.Indent--;
891 writer.WriteLine("End"); 898 writer.WriteLine("End");
892 } 899 }
893 } 900 }
894 foreach (string file in Directory.GetFiles(folder, "*.sql")) 901 foreach (string file in Directory.GetFiles(folder, "*.sql"))
895 { 902 {
896 writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file)); 903 writer.WriteLine("Script = \"{0}\"", Path.GetFileName(file));
897 } 904 }
898 } 905 }
899 906
900 private void CleanProject(ProjectNode project) 907 private void CleanProject(ProjectNode project)
901 { 908 {
902 kernel.Log.Write("...Cleaning project: {0}", project.Name); 909 kernel.Log.Write("...Cleaning project: {0}", project.Name);
903 910
904 ToolInfo toolInfo = tools[project.Language]; 911 ToolInfo toolInfo = tools[project.Language];
905 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); 912 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
906 string userFile = projectFile + ".user"; 913 string userFile = projectFile + ".user";
907 914
908 Helper.DeleteIfExists(projectFile); 915 Helper.DeleteIfExists(projectFile);
909 Helper.DeleteIfExists(userFile); 916 Helper.DeleteIfExists(userFile);
910 } 917 }
911 918
912 private void CleanSolution(SolutionNode solution) 919 private void CleanSolution(SolutionNode solution)
913 { 920 {
914 kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name); 921 kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name);
915 922
916 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); 923 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
917 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); 924 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
918 925
919 Helper.DeleteIfExists(slnFile); 926 Helper.DeleteIfExists(slnFile);
920 Helper.DeleteIfExists(suoFile); 927 Helper.DeleteIfExists(suoFile);
921 928
922 foreach (ProjectNode project in solution.Projects) 929 foreach (ProjectNode project in solution.Projects)
923 { 930 {
924 CleanProject(project); 931 CleanProject(project);
925 } 932 }
926 933
927 kernel.Log.Write(""); 934 kernel.Log.Write("");
928 } 935 }
929 936
930 #endregion 937 #endregion
931 938
932 #region ITarget Members 939 #region ITarget Members
933 940
934 /// <summary> 941 /// <summary>
935 /// Writes the specified kern. 942 /// Writes the specified kern.
936 /// </summary> 943 /// </summary>
937 /// <param name="kern">The kern.</param> 944 /// <param name="kern">The kern.</param>
938 public virtual void Write(Kernel kern) 945 public virtual void Write(Kernel kern)
939 { 946 {
940 if (kern == null) 947 if (kern == null)
941 { 948 {
942 throw new ArgumentNullException("kern"); 949 throw new ArgumentNullException("kern");
943 } 950 }
944 kernel = kern; 951 kernel = kern;
945 foreach (SolutionNode sol in kernel.Solutions) 952 foreach (SolutionNode sol in kernel.Solutions)
946 { 953 {
947 WriteSolution(sol, true); 954 WriteSolution(sol, true);
948 } 955 }
949 kernel = null; 956 kernel = null;
950 } 957 }
951 958
952 /// <summary> 959 /// <summary>
953 /// Cleans the specified kern. 960 /// Cleans the specified kern.
954 /// </summary> 961 /// </summary>
955 /// <param name="kern">The kern.</param> 962 /// <param name="kern">The kern.</param>
956 public virtual void Clean(Kernel kern) 963 public virtual void Clean(Kernel kern)
957 { 964 {
958 if (kern == null) 965 if (kern == null)
959 { 966 {
960 throw new ArgumentNullException("kern"); 967 throw new ArgumentNullException("kern");
961 } 968 }
962 kernel = kern; 969 kernel = kern;
963 foreach (SolutionNode sol in kernel.Solutions) 970 foreach (SolutionNode sol in kernel.Solutions)
964 { 971 {
965 CleanSolution(sol); 972 CleanSolution(sol);
966 } 973 }
967 kernel = null; 974 kernel = null;
968 } 975 }
969 976
970 #endregion 977 #endregion
971 } 978 }
972} 979}
diff --git a/Prebuild/src/Core/Targets/VSVersion.cs b/Prebuild/src/Core/Targets/VSVersion.cs
index a7434c6..b917878 100644
--- a/Prebuild/src/Core/Targets/VSVersion.cs
+++ b/Prebuild/src/Core/Targets/VSVersion.cs
@@ -5,16 +5,16 @@ Copyright (c) 2008-2009 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -25,30 +25,43 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
25 25
26namespace Prebuild.Core.Targets 26namespace Prebuild.Core.Targets
27{ 27{
28 /// <summary> 28 /// <summary>
29 /// 29 ///
30 /// </summary> 30 /// </summary>
31 public enum VSVersion 31 public enum VSVersion
32 { 32 {
33 /// <summary>
34 /// Visual Studio 2002
35 /// </summary>
36 VS70,
37 /// <summary>
38 /// Visual Studio 2003
39 /// </summary>
40 VS71,
41 /// <summary>
42 /// Visual Studio 2005
43 /// </summary>
44 VS80,
45 /// <summary>
46 /// Visual Studio 2008
47 /// </summary>
48 VS90,
49 /// <summary>
50 /// Visual Studio 2010
51 /// </summary>
52 VS10,
53 /// <summary>
54 /// Visual Studio 2012
55 /// </summary>
56 VS11,
57 /// <summary>
58 /// Visual Studio 2013
59 /// </summary>
60 VS12,
33 /// <summary> 61 /// <summary>
34 /// Visual Studio 2002 62 /// Visual Studio 2015
35 /// </summary> 63 /// </summary>
36 VS70, 64 VS15
37 /// <summary> 65
38 /// Visual Studio 2003 66 }
39 /// </summary>
40 VS71,
41 /// <summary>
42 /// Visual Studio 2005
43 /// </summary>
44 VS80,
45 /// <summary>
46 /// Visual Studio 2008
47 /// </summary>
48 VS90,
49 /// <summary>
50 /// Visual Studio 2010
51 /// </summary>
52 VS10
53 }
54} 67}
diff --git a/Prebuild/src/Core/Targets/XcodeTarget.cs b/Prebuild/src/Core/Targets/XcodeTarget.cs
index d2c86a0..5393cec 100644
--- a/Prebuild/src/Core/Targets/XcodeTarget.cs
+++ b/Prebuild/src/Core/Targets/XcodeTarget.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (da
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -36,7 +36,7 @@ using Prebuild.Core.Utilities;
36namespace Prebuild.Core.Targets 36namespace Prebuild.Core.Targets
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// 39 ///
40 /// </summary> 40 /// </summary>
41 [Target("xcode")] 41 [Target("xcode")]
42 public class XcodeTarget : ITarget 42 public class XcodeTarget : ITarget
@@ -282,7 +282,7 @@ namespace Prebuild.Core.Targets
282 } 282 }
283 //if (project.Files.GetSubType(file).ToString() != "Code") 283 //if (project.Files.GetSubType(file).ToString() != "Code")
284 //{ 284 //{
285 // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx"); 285 // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
286 286
287 ss.WriteLine(" </resources>"); 287 ss.WriteLine(" </resources>");
288 ss.WriteLine(" <sources failonempty=\"true\">"); 288 ss.WriteLine(" <sources failonempty=\"true\">");
diff --git a/Prebuild/src/Core/UnknownLanguageException.cs b/Prebuild/src/Core/UnknownLanguageException.cs
index 71fc885..607b66c 100644
--- a/Prebuild/src/Core/UnknownLanguageException.cs
+++ b/Prebuild/src/Core/UnknownLanguageException.cs
@@ -6,12 +6,12 @@
6 * modify it under the terms of the GNU Lesser General Public 6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version. 8 * version 2.1 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details. 13 * Lesser General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Lesser General Public 15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software 16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -20,44 +20,44 @@
20using System; 20using System;
21using System.Runtime.Serialization; 21using System.Runtime.Serialization;
22 22
23namespace Prebuild.Core 23namespace Prebuild.Core
24{ 24{
25 /// <summary> 25 /// <summary>
26 /// </summary> 26 /// </summary>
27 [Serializable()] 27 [Serializable()]
28 public class UnknownLanguageException : Exception 28 public class UnknownLanguageException : Exception
29 { 29 {
30 /// <summary> 30 /// <summary>
31 /// Basic exception. 31 /// Basic exception.
32 /// </summary> 32 /// </summary>
33 public UnknownLanguageException() 33 public UnknownLanguageException()
34 { 34 {
35 } 35 }
36 36
37 /// <summary> 37 /// <summary>
38 /// Exception with specified string 38 /// Exception with specified string
39 /// </summary> 39 /// </summary>
40 /// <param name="message">Exception message</param> 40 /// <param name="message">Exception message</param>
41 public UnknownLanguageException(string message): base(message) 41 public UnknownLanguageException(string message): base(message)
42 { 42 {
43 } 43 }
44 44
45 /// <summary> 45 /// <summary>
46 /// 46 ///
47 /// </summary> 47 /// </summary>
48 /// <param name="message"></param> 48 /// <param name="message"></param>
49 /// <param name="exception"></param> 49 /// <param name="exception"></param>
50 public UnknownLanguageException(string message, Exception exception) : base(message, exception) 50 public UnknownLanguageException(string message, Exception exception) : base(message, exception)
51 { 51 {
52 } 52 }
53 53
54 /// <summary> 54 /// <summary>
55 /// 55 ///
56 /// </summary> 56 /// </summary>
57 /// <param name="info"></param> 57 /// <param name="info"></param>
58 /// <param name="context"></param> 58 /// <param name="context"></param>
59 protected UnknownLanguageException(SerializationInfo info, StreamingContext context) : base( info, context ) 59 protected UnknownLanguageException(SerializationInfo info, StreamingContext context) : base( info, context )
60 { 60 {
61 } 61 }
62 } 62 }
63} 63}
diff --git a/Prebuild/src/Core/Utilities/CommandLineCollection.cs b/Prebuild/src/Core/Utilities/CommandLineCollection.cs
index 5e6face..786fa1e 100644
--- a/Prebuild/src/Core/Utilities/CommandLineCollection.cs
+++ b/Prebuild/src/Core/Utilities/CommandLineCollection.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -27,126 +27,126 @@ using System.Collections;
27using System.Collections.Generic; 27using System.Collections.Generic;
28 28
29namespace Prebuild.Core.Utilities 29namespace Prebuild.Core.Utilities
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// The CommandLine class parses and interprets the command-line arguments passed to 32 /// The CommandLine class parses and interprets the command-line arguments passed to
33 /// prebuild. 33 /// prebuild.
34 /// </summary> 34 /// </summary>
35 public class CommandLineCollection : IEnumerable<KeyValuePair<string, string>> 35 public class CommandLineCollection : IEnumerable<KeyValuePair<string, string>>
36 { 36 {
37 #region Fields 37 #region Fields
38 38
39 // The raw OS arguments 39 // The raw OS arguments
40 private readonly string[] m_RawArgs; 40 private readonly string[] m_RawArgs;
41 41
42 // Command-line argument storage 42 // Command-line argument storage
43 private readonly Dictionary<string, string> m_Arguments = new Dictionary<string, string>(); 43 private readonly Dictionary<string, string> m_Arguments = new Dictionary<string, string>();
44 44
45 #endregion 45 #endregion
46 46
47 #region Constructors 47 #region Constructors
48 48
49 /// <summary> 49 /// <summary>
50 /// Create a new CommandLine instance and set some internal variables. 50 /// Create a new CommandLine instance and set some internal variables.
51 /// </summary> 51 /// </summary>
52 public CommandLineCollection(string[] args) 52 public CommandLineCollection(string[] args)
53 { 53 {
54 m_RawArgs = args; 54 m_RawArgs = args;
55 55
56 Parse(); 56 Parse();
57 } 57 }
58 58
59 #endregion 59 #endregion
60 60
61 #region Private Methods 61 #region Private Methods
62 62
63 private void Parse() 63 private void Parse()
64 { 64 {
65 if(m_RawArgs.Length < 1) 65 if(m_RawArgs.Length < 1)
66 return; 66 return;
67 67
68 int idx = 0; 68 int idx = 0;
69 string lastArg = null; 69 string lastArg = null;
70 70
71 while(idx <m_RawArgs.Length) 71 while(idx <m_RawArgs.Length)
72 { 72 {
73 string arg = m_RawArgs[idx]; 73 string arg = m_RawArgs[idx];
74 74
75 if(arg.Length > 2 && arg[0] == '/') 75 if(arg.Length > 2 && arg[0] == '/')
76 { 76 {
77 arg = arg.Substring(1); 77 arg = arg.Substring(1);
78 lastArg = arg; 78 lastArg = arg;
79 m_Arguments[arg] = ""; 79 m_Arguments[arg] = "";
80 } 80 }
81 else 81 else
82 { 82 {
83 if(lastArg != null) 83 if(lastArg != null)
84 { 84 {
85 m_Arguments[lastArg] = arg; 85 m_Arguments[lastArg] = arg;
86 lastArg = null; 86 lastArg = null;
87 } 87 }
88 } 88 }
89 89
90 idx++; 90 idx++;
91 } 91 }
92 } 92 }
93 93
94 #endregion 94 #endregion
95 95
96 #region Public Methods 96 #region Public Methods
97 97
98 /// <summary> 98 /// <summary>
99 /// Wases the passed. 99 /// Wases the passed.
100 /// </summary> 100 /// </summary>
101 /// <param name="arg">The arg.</param> 101 /// <param name="arg">The arg.</param>
102 /// <returns></returns> 102 /// <returns></returns>
103 public bool WasPassed(string arg) 103 public bool WasPassed(string arg)
104 { 104 {
105 return (m_Arguments.ContainsKey(arg)); 105 return (m_Arguments.ContainsKey(arg));
106 } 106 }
107 107
108 #endregion 108 #endregion
109 109
110 #region Properties 110 #region Properties
111 111
112 /// <summary> 112 /// <summary>
113 /// Gets the parameter associated with the command line option 113 /// Gets the parameter associated with the command line option
114 /// </summary> 114 /// </summary>
115 /// <remarks>Returns null if option was not specified, 115 /// <remarks>Returns null if option was not specified,
116 /// null string if no parameter was specified, and the value if a parameter was specified</remarks> 116 /// null string if no parameter was specified, and the value if a parameter was specified</remarks>
117 public string this[string index] 117 public string this[string index]
118 { 118 {
119 get 119 get
120 { 120 {
121 if(m_Arguments.ContainsKey(index)) 121 if(m_Arguments.ContainsKey(index))
122 { 122 {
123 return (m_Arguments[index]); 123 return (m_Arguments[index]);
124 } 124 }
125 return null; 125 return null;
126 } 126 }
127 } 127 }
128 128
129 #endregion 129 #endregion
130 130
131 #region IEnumerable Members 131 #region IEnumerable Members
132 132
133 /// <summary> 133 /// <summary>
134 /// Returns an enumerator that can iterate through a collection. 134 /// Returns an enumerator that can iterate through a collection.
135 /// </summary> 135 /// </summary>
136 /// <returns> 136 /// <returns>
137 /// An <see cref="T:System.Collections.IDictionaryEnumerator"/> 137 /// An <see cref="T:System.Collections.IDictionaryEnumerator"/>
138 /// that can be used to iterate through the collection. 138 /// that can be used to iterate through the collection.
139 /// </returns> 139 /// </returns>
140 public IEnumerator<KeyValuePair<string, string>> GetEnumerator() 140 public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
141 { 141 {
142 return m_Arguments.GetEnumerator(); 142 return m_Arguments.GetEnumerator();
143 } 143 }
144 144
145 IEnumerator IEnumerable.GetEnumerator() 145 IEnumerator IEnumerable.GetEnumerator()
146 { 146 {
147 return GetEnumerator(); 147 return GetEnumerator();
148 } 148 }
149 149
150 #endregion 150 #endregion
151 } 151 }
152} 152}
diff --git a/Prebuild/src/Core/Utilities/CurrentDirectory.cs b/Prebuild/src/Core/Utilities/CurrentDirectory.cs
index d743d83..9624c35 100644
--- a/Prebuild/src/Core/Utilities/CurrentDirectory.cs
+++ b/Prebuild/src/Core/Utilities/CurrentDirectory.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -28,41 +28,41 @@ using System.Collections.Generic;
28 28
29namespace Prebuild.Core.Utilities 29namespace Prebuild.Core.Utilities
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 public class CurrentDirectory 34 public class CurrentDirectory
35 { 35 {
36 #region Fields 36 #region Fields
37 37
38 private readonly Stack<string> m_Stack = new Stack<string>(); 38 private readonly Stack<string> m_Stack = new Stack<string>();
39 39
40 #endregion 40 #endregion
41 41
42 #region Public Methods 42 #region Public Methods
43 43
44 /// <summary> 44 /// <summary>
45 /// Pushes this instance. 45 /// Pushes this instance.
46 /// </summary> 46 /// </summary>
47 public void Push() 47 public void Push()
48 { 48 {
49 m_Stack.Push(Environment.CurrentDirectory); 49 m_Stack.Push(Environment.CurrentDirectory);
50 } 50 }
51 51
52 /// <summary> 52 /// <summary>
53 /// Pops this instance. 53 /// Pops this instance.
54 /// </summary> 54 /// </summary>
55 public void Pop() 55 public void Pop()
56 { 56 {
57 if(m_Stack.Count < 1) 57 if(m_Stack.Count < 1)
58 { 58 {
59 return; 59 return;
60 } 60 }
61
62 string cwd = m_Stack.Pop();
63 Helper.SetCurrentDir(cwd);
64 }
61 65
62 string cwd = m_Stack.Pop(); 66 #endregion
63 Helper.SetCurrentDir(cwd); 67 }
64 }
65
66 #endregion
67 }
68} 68}
diff --git a/Prebuild/src/Core/Utilities/Helper.cs b/Prebuild/src/Core/Utilities/Helper.cs
index a440e58..8533340 100644
--- a/Prebuild/src/Core/Utilities/Helper.cs
+++ b/Prebuild/src/Core/Utilities/Helper.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -35,541 +35,541 @@ using Prebuild.Core.Nodes;
35 35
36namespace Prebuild.Core.Utilities 36namespace Prebuild.Core.Utilities
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// 39 ///
40 /// </summary> 40 /// </summary>
41 public class Helper 41 public class Helper
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 static bool checkForOSVariables; 45 static bool checkForOSVariables;
46 46
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 public static bool CheckForOSVariables 50 public static bool CheckForOSVariables
51 { 51 {
52 get 52 get
53 { 53 {
54 return checkForOSVariables; 54 return checkForOSVariables;
55 } 55 }
56 set 56 set
57 { 57 {
58 checkForOSVariables = value; 58 checkForOSVariables = value;
59 } 59 }
60 } 60 }
61 61
62 #endregion 62 #endregion
63 63
64 #region Public Methods 64 #region Public Methods
65 65
66 #region String Parsing 66 #region String Parsing
67 67
68 public delegate string StringLookup(string key); 68 public delegate string StringLookup(string key);
69 69
70 /// <summary> 70 /// <summary>
71 /// Gets a collection of StringLocationPair objects that represent the matches 71 /// Gets a collection of StringLocationPair objects that represent the matches
72 /// </summary> 72 /// </summary>
73 /// <param name="target">The target.</param> 73 /// <param name="target">The target.</param>
74 /// <param name="beforeGroup">The before group.</param> 74 /// <param name="beforeGroup">The before group.</param>
75 /// <param name="afterGroup">The after group.</param> 75 /// <param name="afterGroup">The after group.</param>
76 /// <param name="includeDelimitersInSubstrings">if set to <c>true</c> [include delimiters in substrings].</param> 76 /// <param name="includeDelimitersInSubstrings">if set to <c>true</c> [include delimiters in substrings].</param>
77 /// <returns></returns> 77 /// <returns></returns>
78 public static StringCollection FindGroups(string target, string beforeGroup, string afterGroup, bool includeDelimitersInSubstrings) 78 public static StringCollection FindGroups(string target, string beforeGroup, string afterGroup, bool includeDelimitersInSubstrings)
79 { 79 {
80 if( beforeGroup == null ) 80 if( beforeGroup == null )
81 { 81 {
82 throw new ArgumentNullException("beforeGroup"); 82 throw new ArgumentNullException("beforeGroup");
83 } 83 }
84 if( afterGroup == null ) 84 if( afterGroup == null )
85 { 85 {
86 throw new ArgumentNullException("afterGroup"); 86 throw new ArgumentNullException("afterGroup");
87 } 87 }
88 StringCollection results = new StringCollection(); 88 StringCollection results = new StringCollection();
89 if(target == null || target.Length == 0) 89 if(target == null || target.Length == 0)
90 { 90 {
91 return results; 91 return results;
92 } 92 }
93 93
94 int beforeMod = 0; 94 int beforeMod = 0;
95 int afterMod = 0; 95 int afterMod = 0;
96 if(includeDelimitersInSubstrings) 96 if(includeDelimitersInSubstrings)
97 { 97 {
98 //be sure to not exlude the delims 98 //be sure to not exlude the delims
99 beforeMod = beforeGroup.Length; 99 beforeMod = beforeGroup.Length;
100 afterMod = afterGroup.Length; 100 afterMod = afterGroup.Length;
101 } 101 }
102 int startIndex = 0; 102 int startIndex = 0;
103 while((startIndex = target.IndexOf(beforeGroup,startIndex)) != -1) { 103 while((startIndex = target.IndexOf(beforeGroup,startIndex)) != -1) {
104 int endIndex = target.IndexOf(afterGroup,startIndex);//the index of the char after it 104 int endIndex = target.IndexOf(afterGroup,startIndex);//the index of the char after it
105 if(endIndex == -1) 105 if(endIndex == -1)
106 { 106 {
107 break; 107 break;
108 } 108 }
109 int length = endIndex - startIndex - beforeGroup.Length;//move to the first char in the string 109 int length = endIndex - startIndex - beforeGroup.Length;//move to the first char in the string
110 string substring = substring = target.Substring(startIndex + beforeGroup.Length - beforeMod, 110 string substring = target.Substring(startIndex + beforeGroup.Length - beforeMod,
111 length - afterMod); 111 length - afterMod);
112 112
113 results.Add(substring); 113 results.Add(substring);
114 //results.Add(new StringLocationPair(substring,startIndex)); 114 //results.Add(new StringLocationPair(substring,startIndex));
115 startIndex = endIndex + 1; 115 startIndex = endIndex + 1;
116 //the Interpolate*() methods will not work if expressions are expandded inside expression due to an optimization 116 //the Interpolate*() methods will not work if expressions are expandded inside expression due to an optimization
117 //so start after endIndex 117 //so start after endIndex
118 118
119 } 119 }
120 return results; 120 return results;
121 } 121 }
122 122
123 /// <summary> 123 /// <summary>
124 /// Replaces the groups. 124 /// Replaces the groups.
125 /// </summary> 125 /// </summary>
126 /// <param name="target">The target.</param> 126 /// <param name="target">The target.</param>
127 /// <param name="beforeGroup">The before group.</param> 127 /// <param name="beforeGroup">The before group.</param>
128 /// <param name="afterGroup">The after group.</param> 128 /// <param name="afterGroup">The after group.</param>
129 /// <param name="lookup">The lookup.</param> 129 /// <param name="lookup">The lookup.</param>
130 /// <returns></returns> 130 /// <returns></returns>
131 public static string ReplaceGroups(string target, string beforeGroup, string afterGroup, StringLookup lookup) { 131 public static string ReplaceGroups(string target, string beforeGroup, string afterGroup, StringLookup lookup) {
132 if( target == null ) 132 if( target == null )
133 { 133 {
134 throw new ArgumentNullException("target"); 134 throw new ArgumentNullException("target");
135 } 135 }
136 //int targetLength = target.Length; 136 //int targetLength = target.Length;
137 StringCollection strings = FindGroups(target,beforeGroup,afterGroup,false); 137 StringCollection strings = FindGroups(target,beforeGroup,afterGroup,false);
138 if( lookup == null ) 138 if( lookup == null )
139 { 139 {
140 throw new ArgumentNullException("lookup"); 140 throw new ArgumentNullException("lookup");
141 } 141 }
142 foreach(string substring in strings) 142 foreach(string substring in strings)
143 { 143 {
144 target = target.Replace(beforeGroup + substring + afterGroup, lookup(substring) ); 144 target = target.Replace(beforeGroup + substring + afterGroup, lookup(substring) );
145 } 145 }
146 return target; 146 return target;
147 } 147 }
148 148
149 /// <summary> 149 /// <summary>
150 /// Replaces ${var} statements in a string with the corresonding values as detirmined by the lookup delegate 150 /// Replaces ${var} statements in a string with the corresonding values as detirmined by the lookup delegate
151 /// </summary> 151 /// </summary>
152 /// <param name="target">The target.</param> 152 /// <param name="target">The target.</param>
153 /// <param name="lookup">The lookup.</param> 153 /// <param name="lookup">The lookup.</param>
154 /// <returns></returns> 154 /// <returns></returns>
155 public static string InterpolateForVariables(string target, StringLookup lookup) 155 public static string InterpolateForVariables(string target, StringLookup lookup)
156 { 156 {
157 return ReplaceGroups(target, "${" , "}" , lookup); 157 return ReplaceGroups(target, "${" , "}" , lookup);
158 } 158 }
159 159
160 /// <summary> 160 /// <summary>
161 /// Replaces ${var} statements in a string with the corresonding environment variable with name var 161 /// Replaces ${var} statements in a string with the corresonding environment variable with name var
162 /// </summary> 162 /// </summary>
163 /// <param name="target"></param> 163 /// <param name="target"></param>
164 /// <returns></returns> 164 /// <returns></returns>
165 public static string InterpolateForEnvironmentVariables(string target) 165 public static string InterpolateForEnvironmentVariables(string target)
166 { 166 {
167 return InterpolateForVariables(target, new StringLookup(Environment.GetEnvironmentVariable)); 167 return InterpolateForVariables(target, new StringLookup(Environment.GetEnvironmentVariable));
168 } 168 }
169 169
170 #endregion 170 #endregion
171 171
172 /// <summary> 172 /// <summary>
173 /// Translates the value. 173 /// Translates the value.
174 /// </summary> 174 /// </summary>
175 /// <param name="translateType">Type of the translate.</param> 175 /// <param name="translateType">Type of the translate.</param>
176 /// <param name="translationItem">The translation item.</param> 176 /// <param name="translationItem">The translation item.</param>
177 /// <returns></returns> 177 /// <returns></returns>
178 public static object TranslateValue(Type translateType, string translationItem) 178 public static object TranslateValue(Type translateType, string translationItem)
179 { 179 {
180 if(translationItem == null) 180 if(translationItem == null)
181 { 181 {
182 return null; 182 return null;
183 } 183 }
184 184
185 try 185 try
186 { 186 {
187 string lowerVal = translationItem.ToLower(); 187 string lowerVal = translationItem.ToLower();
188 if(translateType == typeof(bool)) 188 if(translateType == typeof(bool))
189 { 189 {
190 return (lowerVal == "true" || lowerVal == "1" || lowerVal == "y" || lowerVal == "yes" || lowerVal == "on"); 190 return (lowerVal == "true" || lowerVal == "1" || lowerVal == "y" || lowerVal == "yes" || lowerVal == "on");
191 } 191 }
192 else if(translateType == typeof(int)) 192 else if(translateType == typeof(int))
193 { 193 {
194 return (Int32.Parse(translationItem)); 194 return (Int32.Parse(translationItem));
195 } 195 }
196 else 196 else
197 { 197 {
198 return translationItem; 198 return translationItem;
199 } 199 }
200 } 200 }
201 catch(FormatException) 201 catch(FormatException)
202 { 202 {
203 return null; 203 return null;
204 } 204 }
205 } 205 }
206 206
207 /// <summary> 207 /// <summary>
208 /// Deletes if exists. 208 /// Deletes if exists.
209 /// </summary> 209 /// </summary>
210 /// <param name="file">The file.</param> 210 /// <param name="file">The file.</param>
211 /// <returns></returns> 211 /// <returns></returns>
212 public static bool DeleteIfExists(string file) 212 public static bool DeleteIfExists(string file)
213 { 213 {
214 string resFile = null; 214 string resFile = null;
215 try 215 try
216 { 216 {
217 resFile = ResolvePath(file); 217 resFile = ResolvePath(file);
218 } 218 }
219 catch(ArgumentException) 219 catch(ArgumentException)
220 { 220 {
221 return false; 221 return false;
222 } 222 }
223 223
224 if(!File.Exists(resFile)) 224 if(!File.Exists(resFile))
225 { 225 {
226 return false; 226 return false;
227 } 227 }
228 228
229 File.Delete(resFile); 229 File.Delete(resFile);
230 return true; 230 return true;
231 } 231 }
232 232
233 static readonly char seperator = Path.DirectorySeparatorChar; 233 static readonly char seperator = Path.DirectorySeparatorChar;
234 234
235 // This little gem was taken from the NeL source, thanks guys! 235 // This little gem was taken from the NeL source, thanks guys!
236 /// <summary> 236 /// <summary>
237 /// Makes a relative path 237 /// Makes a relative path
238 /// </summary> 238 /// </summary>
239 /// <param name="startPath">Path to start from</param> 239 /// <param name="startPath">Path to start from</param>
240 /// <param name="endPath">Path to end at</param> 240 /// <param name="endPath">Path to end at</param>
241 /// <returns>Path that will get from startPath to endPath</returns> 241 /// <returns>Path that will get from startPath to endPath</returns>
242 public static string MakePathRelativeTo(string startPath, string endPath) 242 public static string MakePathRelativeTo(string startPath, string endPath)
243 { 243 {
244 string tmp = NormalizePath(startPath, seperator); 244 string tmp = NormalizePath(startPath, seperator);
245 string src = NormalizePath(endPath, seperator); 245 string src = NormalizePath(endPath, seperator);
246 string prefix = ""; 246 string prefix = "";
247 247
248 while(true) 248 while(true)
249 { 249 {
250 if((String.Compare(tmp, 0, src, 0, tmp.Length) == 0)) 250 if((String.Compare(tmp, 0, src, 0, tmp.Length) == 0))
251 { 251 {
252 string ret; 252 string ret;
253 int size = tmp.Length; 253 int size = tmp.Length;
254 if(size == src.Length) 254 if(size == src.Length)
255 { 255 {
256 return "./"; 256 return "./";
257 } 257 }
258 if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator) 258 if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator)
259 { 259 {
260 } 260 }
261 else 261 else
262 { 262 {
263 ret = prefix + endPath.Substring(size, endPath.Length - size); 263 ret = prefix + endPath.Substring(size, endPath.Length - size);
264 ret = ret.Trim(); 264 ret = ret.Trim();
265 if(ret[0] == seperator) 265 if(ret[0] == seperator)
266 { 266 {
267 ret = "." + ret; 267 ret = "." + ret;
268 } 268 }
269 269
270 return NormalizePath(ret); 270 return NormalizePath(ret);
271 } 271 }
272
273 }
272 274
273 } 275 if(tmp.Length < 2)
274 276 {
275 if(tmp.Length < 2) 277 break;
276 { 278 }
277 break;
278 }
279 279
280 int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2); 280 int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2);
281 int prevPos = tmp.IndexOf(seperator); 281 int prevPos = tmp.IndexOf(seperator);
282 282
283 if((lastPos == prevPos) || (lastPos == -1)) 283 if((lastPos == prevPos) || (lastPos == -1))
284 { 284 {
285 break; 285 break;
286 } 286 }
287 287
288 tmp = tmp.Substring(0, lastPos + 1); 288 tmp = tmp.Substring(0, lastPos + 1);
289 prefix += ".." + seperator.ToString(); 289 prefix += ".." + seperator.ToString();
290 } 290 }
291 291
292 return endPath; 292 return endPath;
293 } 293 }
294 294
295 /// <summary> 295 /// <summary>
296 /// Resolves the path. 296 /// Resolves the path.
297 /// </summary> 297 /// </summary>
298 /// <param name="path">The path.</param> 298 /// <param name="path">The path.</param>
299 /// <returns></returns> 299 /// <returns></returns>
300 public static string ResolvePath(string path) 300 public static string ResolvePath(string path)
301 { 301 {
302 string tmpPath = NormalizePath(path); 302 string tmpPath = NormalizePath(path);
303 if(tmpPath.Length < 1) 303 if(tmpPath.Length < 1)
304 { 304 {
305 tmpPath = "."; 305 tmpPath = ".";
306 } 306 }
307 307
308 tmpPath = Path.GetFullPath(tmpPath); 308 tmpPath = Path.GetFullPath(tmpPath);
309 if(!File.Exists(tmpPath) && !Directory.Exists(tmpPath)) 309 if(!File.Exists(tmpPath) && !Directory.Exists(tmpPath))
310 { 310 {
311 throw new ArgumentException("Path could not be resolved: " + tmpPath); 311 throw new ArgumentException("Path could not be resolved: " + tmpPath);
312 } 312 }
313 313
314 return tmpPath; 314 return tmpPath;
315 } 315 }
316 316
317 /// <summary> 317 /// <summary>
318 /// Normalizes the path. 318 /// Normalizes the path.
319 /// </summary> 319 /// </summary>
320 /// <param name="path">The path.</param> 320 /// <param name="path">The path.</param>
321 /// <param name="separatorCharacter">The separator character.</param> 321 /// <param name="separatorCharacter">The separator character.</param>
322 /// <returns></returns> 322 /// <returns></returns>
323 public static string NormalizePath(string path, char separatorCharacter) 323 public static string NormalizePath(string path, char separatorCharacter)
324 { 324 {
325 if(path == null || path == "" || path.Length < 1) 325 if(path == null || path == "" || path.Length < 1)
326 { 326 {
327 return ""; 327 return "";
328 } 328 }
329 329
330 string tmpPath = path.Replace('\\', '/'); 330 string tmpPath = path.Replace('\\', '/');
331 tmpPath = tmpPath.Replace('/', separatorCharacter); 331 tmpPath = tmpPath.Replace('/', separatorCharacter);
332 return tmpPath; 332 return tmpPath;
333 } 333 }
334 334
335 /// <summary> 335 /// <summary>
336 /// Normalizes the path. 336 /// Normalizes the path.
337 /// </summary> 337 /// </summary>
338 /// <param name="path">The path.</param> 338 /// <param name="path">The path.</param>
339 /// <returns></returns> 339 /// <returns></returns>
340 public static string NormalizePath(string path) 340 public static string NormalizePath(string path)
341 { 341 {
342 return NormalizePath(path, Path.DirectorySeparatorChar); 342 return NormalizePath(path, Path.DirectorySeparatorChar);
343 } 343 }
344 344
345 /// <summary> 345 /// <summary>
346 /// Ends the path. 346 /// Ends the path.
347 /// </summary> 347 /// </summary>
348 /// <param name="path">The path.</param> 348 /// <param name="path">The path.</param>
349 /// <param name="separatorCharacter">The separator character.</param> 349 /// <param name="separatorCharacter">The separator character.</param>
350 /// <returns></returns> 350 /// <returns></returns>
351 public static string EndPath(string path, char separatorCharacter) 351 public static string EndPath(string path, char separatorCharacter)
352 { 352 {
353 if(path == null || path == "" || path.Length < 1) 353 if(path == null || path == "" || path.Length < 1)
354 { 354 {
355 return ""; 355 return "";
356 } 356 }
357 357
358 if(!path.EndsWith(separatorCharacter.ToString())) 358 if(!path.EndsWith(separatorCharacter.ToString()))
359 { 359 {
360 return (path + separatorCharacter); 360 return (path + separatorCharacter);
361 } 361 }
362 362
363 return path; 363 return path;
364 } 364 }
365 365
366 /// <summary> 366 /// <summary>
367 /// Ends the path. 367 /// Ends the path.
368 /// </summary> 368 /// </summary>
369 /// <param name="path">The path.</param> 369 /// <param name="path">The path.</param>
370 /// <returns></returns> 370 /// <returns></returns>
371 public static string EndPath(string path) 371 public static string EndPath(string path)
372 { 372 {
373 return EndPath(path, Path.DirectorySeparatorChar); 373 return EndPath(path, Path.DirectorySeparatorChar);
374 } 374 }
375 375
376 /// <summary> 376 /// <summary>
377 /// Makes the file path. 377 /// Makes the file path.
378 /// </summary> 378 /// </summary>
379 /// <param name="path">The path.</param> 379 /// <param name="path">The path.</param>
380 /// <param name="name">The name.</param> 380 /// <param name="name">The name.</param>
381 /// <param name="ext">The ext.</param> 381 /// <param name="ext">The ext.</param>
382 /// <returns></returns> 382 /// <returns></returns>
383 public static string MakeFilePath(string path, string name, string ext) 383 public static string MakeFilePath(string path, string name, string ext)
384 { 384 {
385 string ret = EndPath(NormalizePath(path)); 385 string ret = EndPath(NormalizePath(path));
386 386
387 if( name == null ) 387 if( name == null )
388 { 388 {
389 throw new ArgumentNullException("name"); 389 throw new ArgumentNullException("name");
390 } 390 }
391 391
392 ret += name; 392 ret += name;
393 if(!name.EndsWith("." + ext)) 393 if(!name.EndsWith("." + ext))
394 { 394 {
395 ret += "." + ext; 395 ret += "." + ext;
396 } 396 }
397 397
398 //foreach(char c in Path.GetInvalidPathChars()) 398 //foreach(char c in Path.GetInvalidPathChars())
399 //{ 399 //{
400 // ret = ret.Replace(c, '_'); 400 // ret = ret.Replace(c, '_');
401 //} 401 //}
402 402
403 return ret; 403 return ret;
404 } 404 }
405 405
406 /// <summary> 406 /// <summary>
407 /// Makes the file path. 407 /// Makes the file path.
408 /// </summary> 408 /// </summary>
409 /// <param name="path">The path.</param> 409 /// <param name="path">The path.</param>
410 /// <param name="name">The name.</param> 410 /// <param name="name">The name.</param>
411 /// <returns></returns> 411 /// <returns></returns>
412 public static string MakeFilePath(string path, string name) 412 public static string MakeFilePath(string path, string name)
413 { 413 {
414 string ret = EndPath(NormalizePath(path)); 414 string ret = EndPath(NormalizePath(path));
415 415
416 if( name == null ) 416 if( name == null )
417 { 417 {
418 throw new ArgumentNullException("name"); 418 throw new ArgumentNullException("name");
419 } 419 }
420 420
421 ret += name; 421 ret += name;
422 422
423 //foreach (char c in Path.GetInvalidPathChars()) 423 //foreach (char c in Path.GetInvalidPathChars())
424 //{ 424 //{
425 // ret = ret.Replace(c, '_'); 425 // ret = ret.Replace(c, '_');
426 //} 426 //}
427 427
428 return ret; 428 return ret;
429 } 429 }
430 430
431 /// <summary> 431 /// <summary>
432 /// 432 ///
433 /// </summary> 433 /// </summary>
434 /// <param name="path"></param> 434 /// <param name="path"></param>
435 /// <returns></returns> 435 /// <returns></returns>
436 public static string MakeReferencePath(string path) 436 public static string MakeReferencePath(string path)
437 { 437 {
438 string ret = EndPath(NormalizePath(path)); 438 string ret = EndPath(NormalizePath(path));
439 439
440 //foreach (char c in Path.GetInvalidPathChars()) 440 //foreach (char c in Path.GetInvalidPathChars())
441 //{ 441 //{
442 // ret = ret.Replace(c, '_'); 442 // ret = ret.Replace(c, '_');
443 //} 443 //}
444 444
445 return ret; 445 return ret;
446 } 446 }
447 447
448 /// <summary> 448 /// <summary>
449 /// Sets the current dir. 449 /// Sets the current dir.
450 /// </summary> 450 /// </summary>
451 /// <param name="path">The path.</param> 451 /// <param name="path">The path.</param>
452 public static void SetCurrentDir(string path) 452 public static void SetCurrentDir(string path)
453 { 453 {
454 if( path == null ) 454 if( path == null )
455 { 455 {
456 throw new ArgumentNullException("path"); 456 throw new ArgumentNullException("path");
457 } 457 }
458 if(path.Length < 1) 458 if(path.Length < 1)
459 { 459 {
460 return; 460 return;
461 } 461 }
462 462
463 Environment.CurrentDirectory = path; 463 Environment.CurrentDirectory = path;
464 } 464 }
465 465
466 /// <summary> 466 /// <summary>
467 /// Checks the type. 467 /// Checks the type.
468 /// </summary> 468 /// </summary>
469 /// <param name="typeToCheck">The type to check.</param> 469 /// <param name="typeToCheck">The type to check.</param>
470 /// <param name="attr">The attr.</param> 470 /// <param name="attr">The attr.</param>
471 /// <param name="inter">The inter.</param> 471 /// <param name="inter">The inter.</param>
472 /// <returns></returns> 472 /// <returns></returns>
473 public static object CheckType(Type typeToCheck, Type attr, Type inter) 473 public static object CheckType(Type typeToCheck, Type attr, Type inter)
474 { 474 {
475 if(typeToCheck == null || attr == null) 475 if(typeToCheck == null || attr == null)
476 { 476 {
477 return null; 477 return null;
478 } 478 }
479 479
480 object[] attrs = typeToCheck.GetCustomAttributes(attr, false); 480 object[] attrs = typeToCheck.GetCustomAttributes(attr, false);
481 if(attrs == null || attrs.Length < 1) 481 if(attrs == null || attrs.Length < 1)
482 { 482 {
483 return null; 483 return null;
484 } 484 }
485 if( inter == null ) 485 if( inter == null )
486 { 486 {
487 throw new ArgumentNullException("inter"); 487 throw new ArgumentNullException("inter");
488 } 488 }
489 489
490 if(typeToCheck.GetInterface(inter.FullName) == null) 490 if(typeToCheck.GetInterface(inter.FullName) == null)
491 { 491 {
492 return null; 492 return null;
493 } 493 }
494 494
495 return attrs[0]; 495 return attrs[0];
496 } 496 }
497 497
498 /// <summary> 498 /// <summary>
499 /// Attributes the value. 499 /// Attributes the value.
500 /// </summary> 500 /// </summary>
501 /// <param name="node">The node.</param> 501 /// <param name="node">The node.</param>
502 /// <param name="attr">The attr.</param> 502 /// <param name="attr">The attr.</param>
503 /// <param name="def">The def.</param> 503 /// <param name="def">The def.</param>
504 /// <returns></returns> 504 /// <returns></returns>
505 public static string AttributeValue(XmlNode node, string attr, string def) 505 public static string AttributeValue(XmlNode node, string attr, string def)
506 { 506 {
507 if( node == null ) 507 if( node == null )
508 { 508 {
509 throw new ArgumentNullException("node"); 509 throw new ArgumentNullException("node");
510 } 510 }
511 if(node.Attributes[attr] == null) 511 if(node.Attributes[attr] == null)
512 { 512 {
513 return def; 513 return def;
514 } 514 }
515 string val = node.Attributes[attr].Value; 515 string val = node.Attributes[attr].Value;
516 if(!CheckForOSVariables) 516 if(!CheckForOSVariables)
517 { 517 {
518 return val; 518 return val;
519 } 519 }
520 520
521 return InterpolateForEnvironmentVariables(val); 521 return InterpolateForEnvironmentVariables(val);
522 } 522 }
523 523
524 /// <summary> 524 /// <summary>
525 /// Parses the boolean. 525 /// Parses the boolean.
526 /// </summary> 526 /// </summary>
527 /// <param name="node">The node.</param> 527 /// <param name="node">The node.</param>
528 /// <param name="attr">The attr.</param> 528 /// <param name="attr">The attr.</param>
529 /// <param name="defaultValue">if set to <c>true</c> [default value].</param> 529 /// <param name="defaultValue">if set to <c>true</c> [default value].</param>
530 /// <returns></returns> 530 /// <returns></returns>
531 public static bool ParseBoolean(XmlNode node, string attr, bool defaultValue) 531 public static bool ParseBoolean(XmlNode node, string attr, bool defaultValue)
532 { 532 {
533 if( node == null ) 533 if( node == null )
534 { 534 {
535 throw new ArgumentNullException("node"); 535 throw new ArgumentNullException("node");
536 } 536 }
537 if(node.Attributes[attr] == null) 537 if(node.Attributes[attr] == null)
538 { 538 {
539 return defaultValue; 539 return defaultValue;
540 } 540 }
541 return bool.Parse(node.Attributes[attr].Value); 541 return bool.Parse(node.Attributes[attr].Value);
542 } 542 }
543 543
544 /// <summary> 544 /// <summary>
545 /// Enums the attribute value. 545 /// Enums the attribute value.
546 /// </summary> 546 /// </summary>
547 /// <param name="node">The node.</param> 547 /// <param name="node">The node.</param>
548 /// <param name="attr">The attr.</param> 548 /// <param name="attr">The attr.</param>
549 /// <param name="enumType">Type of the enum.</param> 549 /// <param name="enumType">Type of the enum.</param>
550 /// <param name="def">The def.</param> 550 /// <param name="def">The def.</param>
551 /// <returns></returns> 551 /// <returns></returns>
552 public static object EnumAttributeValue(XmlNode node, string attr, Type enumType, object def) 552 public static object EnumAttributeValue(XmlNode node, string attr, Type enumType, object def)
553 { 553 {
554 if( def == null ) 554 if( def == null )
555 { 555 {
556 throw new ArgumentNullException("def"); 556 throw new ArgumentNullException("def");
557 } 557 }
558 string val = AttributeValue(node, attr, def.ToString()); 558 string val = AttributeValue(node, attr, def.ToString());
559 return Enum.Parse(enumType, val, true); 559 return Enum.Parse(enumType, val, true);
560 } 560 }
561 561
562 /// <summary> 562 /// <summary>
563 /// 563 ///
564 /// </summary> 564 /// </summary>
565 /// <param name="assemblyName"></param> 565 /// <param name="assemblyName"></param>
566 /// <param name="projectType"></param> 566 /// <param name="projectType"></param>
567 /// <returns></returns> 567 /// <returns></returns>
568 public static string AssemblyFullName(string assemblyName, ProjectType projectType) 568 public static string AssemblyFullName(string assemblyName, ProjectType projectType)
569 { 569 {
570 return assemblyName + (projectType == ProjectType.Library ? ".dll" : ".exe"); 570 return assemblyName + (projectType == ProjectType.Library ? ".dll" : ".exe");
571 } 571 }
572 572
573 #endregion 573 #endregion
574 } 574 }
575} 575}
diff --git a/Prebuild/src/Core/Utilities/Log.cs b/Prebuild/src/Core/Utilities/Log.cs
index cd95633..4df3def 100644
--- a/Prebuild/src/Core/Utilities/Log.cs
+++ b/Prebuild/src/Core/Utilities/Log.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -28,74 +28,74 @@ using System.IO;
28 28
29namespace Prebuild.Core.Utilities 29namespace Prebuild.Core.Utilities
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 public enum LogType 34 public enum LogType
35 { 35 {
36 /// <summary> 36 /// <summary>
37 /// 37 ///
38 /// </summary> 38 /// </summary>
39 None, 39 None,
40 /// <summary> 40 /// <summary>
41 /// 41 ///
42 /// </summary> 42 /// </summary>
43 Info, 43 Info,
44 /// <summary> 44 /// <summary>
45 /// 45 ///
46 /// </summary> 46 /// </summary>
47 Warning, 47 Warning,
48 /// <summary> 48 /// <summary>
49 /// 49 ///
50 /// </summary> 50 /// </summary>
51 Error 51 Error
52 } 52 }
53 53
54 /// <summary> 54 /// <summary>
55 /// 55 ///
56 /// </summary> 56 /// </summary>
57 [Flags] 57 [Flags]
58 public enum LogTargets 58 public enum LogTargets
59 { 59 {
60 /// <summary> 60 /// <summary>
61 /// 61 ///
62 /// </summary> 62 /// </summary>
63 None = 0, 63 None = 0,
64 /// <summary> 64 /// <summary>
65 /// 65 ///
66 /// </summary> 66 /// </summary>
67 Null = 1, 67 Null = 1,
68 /// <summary> 68 /// <summary>
69 /// 69 ///
70 /// </summary> 70 /// </summary>
71 File = 2, 71 File = 2,
72 /// <summary> 72 /// <summary>
73 /// 73 ///
74 /// </summary> 74 /// </summary>
75 Console = 4 75 Console = 4
76 } 76 }
77 77
78 /// <summary> 78 /// <summary>
79 /// Summary description for Log. 79 /// Summary description for Log.
80 /// </summary> 80 /// </summary>
81 public class Log : IDisposable 81 public class Log : IDisposable
82 { 82 {
83 #region Fields 83 #region Fields
84 84
85 private TextWriter m_Writer; 85 private TextWriter m_Writer;
86 private LogTargets m_Target = LogTargets.Null; 86 private LogTargets m_Target = LogTargets.Null;
87 bool disposed; 87 bool disposed;
88 88
89 #endregion 89 #endregion
90 90
91 #region Constructors 91 #region Constructors
92 92
93 /// <summary> 93 /// <summary>
94 /// Initializes a new instance of the <see cref="Log"/> class. 94 /// Initializes a new instance of the <see cref="Log"/> class.
95 /// </summary> 95 /// </summary>
96 /// <param name="target">The target.</param> 96 /// <param name="target">The target.</param>
97 /// <param name="fileName">Name of the file.</param> 97 /// <param name="fileName">Name of the file.</param>
98 public Log(LogTargets target, string fileName) 98 public Log(LogTargets target, string fileName)
99 { 99 {
100 m_Target = target; 100 m_Target = target;
101 101
@@ -111,166 +111,166 @@ namespace Prebuild.Core.Utilities
111 } 111 }
112 } 112 }
113 113
114 #endregion 114 #endregion
115 115
116 #region Public Methods 116 #region Public Methods
117 117
118 /// <summary> 118 /// <summary>
119 /// Writes this instance. 119 /// Writes this instance.
120 /// </summary> 120 /// </summary>
121 public void Write() 121 public void Write()
122 { 122 {
123 Write(string.Empty); 123 Write(string.Empty);
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// Writes the specified MSG. 127 /// Writes the specified MSG.
128 /// </summary> 128 /// </summary>
129 /// <param name="msg">The MSG.</param> 129 /// <param name="msg">The MSG.</param>
130 public void Write(string msg) 130 public void Write(string msg)
131 { 131 {
132 if((m_Target & LogTargets.Null) != 0) 132 if((m_Target & LogTargets.Null) != 0)
133 { 133 {
134 return; 134 return;
135 } 135 }
136 136
137 if((m_Target & LogTargets.Console) != 0) 137 if((m_Target & LogTargets.Console) != 0)
138 { 138 {
139 Console.WriteLine(msg); 139 Console.WriteLine(msg);
140 } 140 }
141 if((m_Target & LogTargets.File) != 0 && m_Writer != null) 141 if((m_Target & LogTargets.File) != 0 && m_Writer != null)
142 { 142 {
143 m_Writer.WriteLine(msg); 143 m_Writer.WriteLine(msg);
144 } 144 }
145 } 145 }
146 146
147 /// <summary> 147 /// <summary>
148 /// Writes the specified format. 148 /// Writes the specified format.
149 /// </summary> 149 /// </summary>
150 /// <param name="format">The format.</param> 150 /// <param name="format">The format.</param>
151 /// <param name="args">The args.</param> 151 /// <param name="args">The args.</param>
152 public void Write(string format, params object[] args) 152 public void Write(string format, params object[] args)
153 { 153 {
154 Write(string.Format(format,args)); 154 Write(string.Format(format,args));
155 } 155 }
156 156
157 /// <summary> 157 /// <summary>
158 /// Writes the specified type. 158 /// Writes the specified type.
159 /// </summary> 159 /// </summary>
160 /// <param name="type">The type.</param> 160 /// <param name="type">The type.</param>
161 /// <param name="format">The format.</param> 161 /// <param name="format">The format.</param>
162 /// <param name="args">The args.</param> 162 /// <param name="args">The args.</param>
163 public void Write(LogType type, string format, params object[] args) 163 public void Write(LogType type, string format, params object[] args)
164 { 164 {
165 if((m_Target & LogTargets.Null) != 0) 165 if((m_Target & LogTargets.Null) != 0)
166 { 166 {
167 return; 167 return;
168 } 168 }
169 169
170 string str = ""; 170 string str = "";
171 switch(type) 171 switch(type)
172 { 172 {
173 case LogType.Info: 173 case LogType.Info:
174 str = "[I] "; 174 str = "[I] ";
175 break; 175 break;
176 case LogType.Warning: 176 case LogType.Warning:
177 str = "[!] "; 177 str = "[!] ";
178 break; 178 break;
179 case LogType.Error: 179 case LogType.Error:
180 str = "[X] "; 180 str = "[X] ";
181 break; 181 break;
182 } 182 }
183 183
184 Write(str + format,args); 184 Write(str + format,args);
185 } 185 }
186 186
187 /// <summary> 187 /// <summary>
188 /// Writes the exception. 188 /// Writes the exception.
189 /// </summary> 189 /// </summary>
190 /// <param name="type">The type.</param> 190 /// <param name="type">The type.</param>
191 /// <param name="ex">The ex.</param> 191 /// <param name="ex">The ex.</param>
192 public void WriteException(LogType type, Exception ex) 192 public void WriteException(LogType type, Exception ex)
193 { 193 {
194 if(ex != null) 194 if(ex != null)
195 { 195 {
196 Write(type, ex.Message); 196 Write(type, ex.Message);
197 //#if DEBUG 197 //#if DEBUG
198 m_Writer.WriteLine("Exception @{0} stack trace [[", ex.TargetSite.Name); 198 m_Writer.WriteLine("Exception @{0} stack trace [[", ex.TargetSite.Name);
199 m_Writer.WriteLine(ex.StackTrace); 199 m_Writer.WriteLine(ex.StackTrace);
200 m_Writer.WriteLine("]]"); 200 m_Writer.WriteLine("]]");
201 //#endif 201 //#endif
202 } 202 }
203 } 203 }
204 204
205 /// <summary> 205 /// <summary>
206 /// Flushes this instance. 206 /// Flushes this instance.
207 /// </summary> 207 /// </summary>
208 public void Flush() 208 public void Flush()
209 { 209 {
210 if(m_Writer != null) 210 if(m_Writer != null)
211 { 211 {
212 m_Writer.Flush(); 212 m_Writer.Flush();
213 } 213 }
214 } 214 }
215 215
216 #endregion 216 #endregion
217 217
218 #region IDisposable Members 218 #region IDisposable Members
219
220 /// <summary>
221 /// Performs application-defined tasks associated with freeing, releasing, or
222 /// resetting unmanaged resources.
223 /// </summary>
224 public void Dispose()
225 {
226 Dispose(true);
227 GC.SuppressFinalize(this);
228 }
229 219
230 /// <summary> 220 /// <summary>
231 /// Dispose objects 221 /// Performs application-defined tasks associated with freeing, releasing, or
232 /// </summary> 222 /// resetting unmanaged resources.
233 /// <param name="disposing"> 223 /// </summary>
234 /// If true, it will dispose close the handle 224 public void Dispose()
235 /// </param> 225 {
236 /// <remarks> 226 Dispose(true);
237 /// Will dispose managed and unmanaged resources. 227 GC.SuppressFinalize(this);
238 /// </remarks> 228 }
239 protected virtual void Dispose(bool disposing)
240 {
241 if (!this.disposed)
242 {
243 if (disposing)
244 {
245 if (m_Writer != null)
246 {
247 m_Writer.Close();
248 m_Writer = null;
249 }
250 }
251 }
252 this.disposed = true;
253 }
254 229
255 /// <summary> 230 /// <summary>
256 /// 231 /// Dispose objects
257 /// </summary> 232 /// </summary>
258 ~Log() 233 /// <param name="disposing">
259 { 234 /// If true, it will dispose close the handle
260 this.Dispose(false); 235 /// </param>
261 } 236 /// <remarks>
237 /// Will dispose managed and unmanaged resources.
238 /// </remarks>
239 protected virtual void Dispose(bool disposing)
240 {
241 if (!this.disposed)
242 {
243 if (disposing)
244 {
245 if (m_Writer != null)
246 {
247 m_Writer.Close();
248 m_Writer = null;
249 }
250 }
251 }
252 this.disposed = true;
253 }
262 254
263 /// <summary> 255 /// <summary>
264 /// Closes and destroys this object 256 ///
265 /// </summary> 257 /// </summary>
266 /// <remarks> 258 ~Log()
267 /// Same as Dispose(true) 259 {
268 /// </remarks> 260 this.Dispose(false);
269 public void Close() 261 }
270 { 262
271 Dispose(); 263 /// <summary>
272 } 264 /// Closes and destroys this object
265 /// </summary>
266 /// <remarks>
267 /// Same as Dispose(true)
268 /// </remarks>
269 public void Close()
270 {
271 Dispose();
272 }
273 273
274 #endregion 274 #endregion
275 } 275 }
276} 276}
diff --git a/Prebuild/src/Core/WarningException.cs b/Prebuild/src/Core/WarningException.cs
index 721f43d..b7c3668 100644
--- a/Prebuild/src/Core/WarningException.cs
+++ b/Prebuild/src/Core/WarningException.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -28,57 +28,57 @@ using System.Runtime.Serialization;
28 28
29namespace Prebuild.Core 29namespace Prebuild.Core
30{ 30{
31 /// <summary> 31 /// <summary>
32 /// 32 ///
33 /// </summary> 33 /// </summary>
34 [Serializable] 34 [Serializable]
35 public class WarningException : Exception 35 public class WarningException : Exception
36 { 36 {
37 #region Constructors 37 #region Constructors
38 38
39 /// <summary> 39 /// <summary>
40 /// 40 ///
41 /// </summary> 41 /// </summary>
42 public WarningException() 42 public WarningException()
43 { 43 {
44 } 44 }
45 45
46 /// <summary> 46 /// <summary>
47 /// 47 ///
48 /// </summary> 48 /// </summary>
49 /// <param name="format"></param> 49 /// <param name="format"></param>
50 /// <param name="args"></param> 50 /// <param name="args"></param>
51 public WarningException(string format, params object[] args) 51 public WarningException(string format, params object[] args)
52 : base(String.Format(format, args)) 52 : base(String.Format(format, args))
53 { 53 {
54 } 54 }
55 55
56 /// <summary> 56 /// <summary>
57 /// Exception with specified string 57 /// Exception with specified string
58 /// </summary> 58 /// </summary>
59 /// <param name="message">Exception message</param> 59 /// <param name="message">Exception message</param>
60 public WarningException(string message): base(message) 60 public WarningException(string message): base(message)
61 { 61 {
62 } 62 }
63 63
64 /// <summary> 64 /// <summary>
65 /// 65 ///
66 /// </summary> 66 /// </summary>
67 /// <param name="message"></param> 67 /// <param name="message"></param>
68 /// <param name="exception"></param> 68 /// <param name="exception"></param>
69 public WarningException(string message, Exception exception) : base(message, exception) 69 public WarningException(string message, Exception exception) : base(message, exception)
70 { 70 {
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// 74 ///
75 /// </summary> 75 /// </summary>
76 /// <param name="info"></param> 76 /// <param name="info"></param>
77 /// <param name="context"></param> 77 /// <param name="context"></param>
78 protected WarningException(SerializationInfo info, StreamingContext context) : base( info, context ) 78 protected WarningException(SerializationInfo info, StreamingContext context) : base( info, context )
79 { 79 {
80 } 80 }
81 81
82 #endregion 82 #endregion
83 } 83 }
84} 84}
diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs
index 996dea0..35a5dfa 100644
--- a/Prebuild/src/Prebuild.cs
+++ b/Prebuild/src/Prebuild.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -42,50 +42,50 @@ using System.EnterpriseServices.Internal;
42using Prebuild.Core; 42using Prebuild.Core;
43using Prebuild.Core.Utilities; 43using Prebuild.Core.Utilities;
44 44
45namespace Prebuild 45namespace Prebuild
46{ 46{
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 class Prebuild 50 class Prebuild
51 { 51 {
52 #region Main 52 #region Main
53 53
54 [STAThread] 54 [STAThread]
55 static void Main(string[] args) 55 static void Main(string[] args)
56 { 56 {
57 Kernel kernel = null; 57 Kernel kernel = null;
58 try 58 try
59 { 59 {
60 kernel = Kernel.Instance; 60 kernel = Kernel.Instance;
61 kernel.Initialize(LogTargets.File | LogTargets.Console, args); 61 kernel.Initialize(LogTargets.File | LogTargets.Console, args);
62 bool exit = false; 62 bool exit = false;
63 63
64 if(kernel.CommandLine.WasPassed("usage")) 64 if(kernel.CommandLine.WasPassed("usage"))
65 { 65 {
66 exit = true; 66 exit = true;
67 OutputUsage(); 67 OutputUsage();
68 } 68 }
69 if(kernel.CommandLine.WasPassed("showtargets")) 69 if(kernel.CommandLine.WasPassed("showtargets"))
70 { 70 {
71 exit = true; 71 exit = true;
72 OutputTargets(kernel); 72 OutputTargets(kernel);
73 } 73 }
74 if(kernel.CommandLine.WasPassed("install")) 74 if(kernel.CommandLine.WasPassed("install"))
75 { 75 {
76 exit = true; 76 exit = true;
77 InstallAssembly(kernel); 77 InstallAssembly(kernel);
78 } 78 }
79 if(kernel.CommandLine.WasPassed("remove")) 79 if(kernel.CommandLine.WasPassed("remove"))
80 { 80 {
81 exit = true; 81 exit = true;
82 RemoveAssembly(kernel); 82 RemoveAssembly(kernel);
83 } 83 }
84 84
85 if(!exit) 85 if(!exit)
86 { 86 {
87 kernel.Process(); 87 kernel.Process();
88 } 88 }
89 } 89 }
90#if !DEBUG 90#if !DEBUG
91 catch (Exception ex) 91 catch (Exception ex)
@@ -96,70 +96,70 @@ namespace Prebuild
96#endif 96#endif
97 finally 97 finally
98 { 98 {
99 if(kernel != null && kernel.PauseAfterFinish) 99 if(kernel != null && kernel.PauseAfterFinish)
100 { 100 {
101 Console.WriteLine("\nPress enter to continue..."); 101 Console.WriteLine("\nPress enter to continue...");
102 Console.ReadLine(); 102 Console.ReadLine();
103 } 103 }
104 } 104 }
105 } 105 }
106 106
107 #endregion 107 #endregion
108 108
109 #region Private Methods 109 #region Private Methods
110 110
111 private static void InstallAssembly(Kernel kernel) 111 private static void InstallAssembly(Kernel kernel)
112 { 112 {
113 Publish publish = new Publish(); 113 Publish publish = new Publish();
114 string file = kernel.CommandLine["install"]; 114 string file = kernel.CommandLine["install"];
115 //Console.WriteLine(".."+file+".."); 115 //Console.WriteLine(".."+file+"..");
116 publish.GacInstall(file); 116 publish.GacInstall(file);
117 } 117 }
118 118
119 private static void RemoveAssembly(Kernel kernel) 119 private static void RemoveAssembly(Kernel kernel)
120 { 120 {
121 Publish publish = new Publish(); 121 Publish publish = new Publish();
122 string file = kernel.CommandLine["remove"]; 122 string file = kernel.CommandLine["remove"];
123 publish.GacRemove(file); 123 publish.GacRemove(file);
124 } 124 }
125 125
126 private static void OutputUsage() 126 private static void OutputUsage()
127 { 127 {
128 Console.WriteLine("Usage: prebuild /target <target> [options]"); 128 Console.WriteLine("Usage: prebuild /target <target> [options]");
129 Console.WriteLine("Available command-line switches:"); 129 Console.WriteLine("Available command-line switches:");
130 Console.WriteLine(); 130 Console.WriteLine();
131 Console.WriteLine("/target Target for Prebuild"); 131 Console.WriteLine("/target Target for Prebuild");
132 Console.WriteLine("/clean Clean the build files for the given target"); 132 Console.WriteLine("/clean Clean the build files for the given target");
133 Console.WriteLine("/file XML file to process"); 133 Console.WriteLine("/file XML file to process");
134 Console.WriteLine("/log Log file to write to"); 134 Console.WriteLine("/log Log file to write to");
135 Console.WriteLine("/ppo Pre-process the file, but perform no other processing"); 135 Console.WriteLine("/ppo Pre-process the file, but perform no other processing");
136 Console.WriteLine("/pause Pauses the application after execution to view the output"); 136 Console.WriteLine("/pause Pauses the application after execution to view the output");
137 Console.WriteLine("/yes Default to yes to any questions asked"); 137 Console.WriteLine("/yes Default to yes to any questions asked");
138 Console.WriteLine("/install Install assembly into the GAC"); 138 Console.WriteLine("/install Install assembly into the GAC");
139 Console.WriteLine("/remove Remove assembly from the GAC"); 139 Console.WriteLine("/remove Remove assembly from the GAC");
140 Console.WriteLine(); 140 Console.WriteLine();
141 Console.WriteLine("See 'prebuild /showtargets for a list of available targets"); 141 Console.WriteLine("See 'prebuild /showtargets for a list of available targets");
142 Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information"); 142 Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information");
143 Console.WriteLine(); 143 Console.WriteLine();
144 } 144 }
145 145
146 private static void OutputTargets(Kernel kern) 146 private static void OutputTargets(Kernel kern)
147 { 147 {
148 Console.WriteLine("Targets available in Prebuild:"); 148 Console.WriteLine("Targets available in Prebuild:");
149 Console.WriteLine(""); 149 Console.WriteLine("");
150 if(kern.Targets.Keys.Count > 0) 150 if(kern.Targets.Keys.Count > 0)
151 { 151 {
152 string[] targs = new string[kern.Targets.Keys.Count]; 152 string[] targs = new string[kern.Targets.Keys.Count];
153 kern.Targets.Keys.CopyTo(targs, 0); 153 kern.Targets.Keys.CopyTo(targs, 0);
154 Array.Sort(targs); 154 Array.Sort(targs);
155 foreach(string target in targs) 155 foreach(string target in targs)
156 { 156 {
157 Console.WriteLine(target); 157 Console.WriteLine(target);
158 } 158 }
159 } 159 }
160 Console.WriteLine(""); 160 Console.WriteLine("");
161 } 161 }
162 162
163 #endregion 163 #endregion
164 } 164 }
165} 165}
diff --git a/Prebuild/src/Properties/AssemblyInfo.cs b/Prebuild/src/Properties/AssemblyInfo.cs
index f9d90bb..079d6a5 100644
--- a/Prebuild/src/Properties/AssemblyInfo.cs
+++ b/Prebuild/src/Properties/AssemblyInfo.cs
@@ -52,7 +52,7 @@ using System.Resources;
52[assembly: CLSCompliant(true)] 52[assembly: CLSCompliant(true)]
53 53
54// 54//
55// General Information about an assembly is controlled through the following 55// General Information about an assembly is controlled through the following
56// set of attributes. Change these attribute values to modify the information 56// set of attributes. Change these attribute values to modify the information
57// associated with an assembly. 57// associated with an assembly.
58// 58//
@@ -61,50 +61,52 @@ using System.Resources;
61[assembly: AssemblyConfiguration(".NET CLR")] 61[assembly: AssemblyConfiguration(".NET CLR")]
62[assembly: AssemblyCompany("The Prebuild Project")] 62[assembly: AssemblyCompany("The Prebuild Project")]
63[assembly: AssemblyProduct("")] 63[assembly: AssemblyProduct("")]
64[assembly: AssemblyCopyright("Copyright 2004-2013 " + 64[assembly: AssemblyCopyright("Copyright 2004-2015 " +
65 "Matthew Holmes, " + 65 "Matthew Holmes, " +
66 "Dan Moorehead, " + 66 "Dan Moorehead, " +
67 "C.J. Adams-Collier, " + 67 "C.J. Adams-Collier, " +
68 "Rob Loach, " + 68 "Rob Loach, " +
69 "David Hudson," + 69 "David Hudson," +
70 "John Hurliman")] 70 "John Hurliman" +
71 "WhiteCore Development" +
72 "OpenSimulator developers")]
71[assembly: AssemblyTrademark("")] 73[assembly: AssemblyTrademark("")]
72[assembly: AssemblyCulture("")] 74[assembly: AssemblyCulture("")]
73[assembly: NeutralResourcesLanguageAttribute("en-US")] 75[assembly: NeutralResourcesLanguageAttribute("en-US")]
74[assembly: AssemblyVersion("2.0.6.*")] 76[assembly: AssemblyVersion("2.0.7.*")]
75 77
76// 78//
77// Version information for an assembly consists of the following four values: 79// Version information for an assembly consists of the following four values:
78// 80//
79// Major Version 81// Major Version
80// Minor Version 82// Minor Version
81// Build Number 83// Build Number
82// Revision 84// Revision
83// 85//
84// You can specify all the values or you can default the Revision and Build Numbers 86// You can specify all the values or you can default the Revision and Build Numbers
85// by using the '*' as shown below: 87// by using the '*' as shown below:
86 88
87// 89//
88// In order to sign your assembly you must specify a key to use. Refer to the 90// In order to sign your assembly you must specify a key to use. Refer to the
89// Microsoft .NET Framework documentation for more information on assembly signing. 91// Microsoft .NET Framework documentation for more information on assembly signing.
90// 92//
91// Use the attributes below to control which key is used for signing. 93// Use the attributes below to control which key is used for signing.
92// 94//
93// Notes: 95// Notes:
94// (*) If no key is specified, the assembly is not signed. 96// (*) If no key is specified, the assembly is not signed.
95// (*) KeyName refers to a key that has been installed in the Crypto Service 97// (*) KeyName refers to a key that has been installed in the Crypto Service
96// Provider (CSP) on your machine. KeyFile refers to a file which contains 98// Provider (CSP) on your machine. KeyFile refers to a file which contains
97// a key. 99// a key.
98// (*) If the KeyFile and the KeyName values are both specified, the 100// (*) If the KeyFile and the KeyName values are both specified, the
99// following processing occurs: 101// following processing occurs:
100// (1) If the KeyName can be found in the CSP, that key is used. 102// (1) If the KeyName can be found in the CSP, that key is used.
101// (2) If the KeyName does not exist and the KeyFile does exist, the key 103// (2) If the KeyName does not exist and the KeyFile does exist, the key
102// in the KeyFile is installed into the CSP and used. 104// in the KeyFile is installed into the CSP and used.
103// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. 105// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
104// When specifying the KeyFile, the location of the KeyFile should be 106// When specifying the KeyFile, the location of the KeyFile should be
105// relative to the project output directory which is 107// relative to the project output directory which is
106// %Project Directory%\obj\<configuration>. For example, if your KeyFile is 108// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
107// located in the project directory, you would specify the AssemblyKeyFile 109// located in the project directory, you would specify the AssemblyKeyFile
108// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] 110// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
109// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework 111// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
110// documentation for more information on this. 112// documentation for more information on this.
diff --git a/Prebuild/src/data/prebuild-1.10.xsd b/Prebuild/src/data/prebuild-1.10.xsd
index eee07a8..ddfa2c5 100644
--- a/Prebuild/src/data/prebuild-1.10.xsd
+++ b/Prebuild/src/data/prebuild-1.10.xsd
@@ -186,8 +186,9 @@
186 <xs:complexType> 186 <xs:complexType>
187 <xs:all> 187 <xs:all>
188 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" /> 188 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
189 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" /> 189 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
190 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" /> 190 <xs:element name="Prefer32Bit" type="xs:boolean" minOccurs="0" />
191 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
191 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" /> 192 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
192 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" /> 193 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
193 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" /> 194 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />