diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /Prebuild/src/Prebuild.cs | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'Prebuild/src/Prebuild.cs')
-rw-r--r-- | Prebuild/src/Prebuild.cs | 330 |
1 files changed, 165 insertions, 165 deletions
diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs index 597db68..2d12b53 100644 --- a/Prebuild/src/Prebuild.cs +++ b/Prebuild/src/Prebuild.cs | |||
@@ -1,165 +1,165 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) | 3 | Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) |
4 | 4 | ||
5 | Redistribution and use in source and binary forms, with or without modification, are permitted | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted |
6 | provided that the following conditions are met: | 6 | provided 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 | ||
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, |
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 21 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | 26 | #region CVS Information |
27 | /* | 27 | /* |
28 | * $Source$ | 28 | * $Source$ |
29 | * $Author: jendave $ | 29 | * $Author: jendave $ |
30 | * $Date: 2006-09-26 23:43:35 +0200 (ti, 26 sep 2006) $ | 30 | * $Date: 2006-09-26 23:43:35 +0200 (ti, 26 sep 2006) $ |
31 | * $Revision: 168 $ | 31 | * $Revision: 168 $ |
32 | */ | 32 | */ |
33 | #endregion | 33 | #endregion |
34 | 34 | ||
35 | using System; | 35 | using System; |
36 | using System.Collections.Specialized; | 36 | using System.Collections.Specialized; |
37 | using System.IO; | 37 | using System.IO; |
38 | using System.Reflection; | 38 | using System.Reflection; |
39 | using System.Runtime.InteropServices; | 39 | using System.Runtime.InteropServices; |
40 | using System.EnterpriseServices.Internal; | 40 | using System.EnterpriseServices.Internal; |
41 | 41 | ||
42 | using Prebuild.Core; | 42 | using Prebuild.Core; |
43 | using Prebuild.Core.Utilities; | 43 | using Prebuild.Core.Utilities; |
44 | 44 | ||
45 | namespace Prebuild | 45 | namespace 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 | catch(Exception ex) | 90 | catch(Exception ex) |
91 | { | 91 | { |
92 | Console.WriteLine("Unhandled error: {0}", ex.Message); | 92 | Console.WriteLine("Unhandled error: {0}", ex.Message); |
93 | //#if DEBUG | 93 | //#if DEBUG |
94 | Console.WriteLine("{0}", ex.StackTrace); | 94 | Console.WriteLine("{0}", ex.StackTrace); |
95 | //#endif | 95 | //#endif |
96 | } | 96 | } |
97 | finally | 97 | finally |
98 | { | 98 | { |
99 | if(kernel.PauseAfterFinish) | 99 | if(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 | } |