diff options
author | Justin Clark-Casey (justincc) | 2010-09-11 01:13:08 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-11 01:13:08 +0100 |
commit | 7e65590a55ba575d0086bdfc25addaf1051d799b (patch) | |
tree | 1dc11683170d45d80d7aab6eefdfcc836d3e773b /Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | |
parent | Make it clear that the "create region" command will reference ini files in th... (diff) | |
download | opensim-SC_OLD-7e65590a55ba575d0086bdfc25addaf1051d799b.zip opensim-SC_OLD-7e65590a55ba575d0086bdfc25addaf1051d799b.tar.gz opensim-SC_OLD-7e65590a55ba575d0086bdfc25addaf1051d799b.tar.bz2 opensim-SC_OLD-7e65590a55ba575d0086bdfc25addaf1051d799b.tar.xz |
Update Prebuild.exe with Prebuild r323 + an existing OpenSim specific nant hack to correctly clean up chosen OpenSim exes and dlls in bin/ on a "nant clean"
Source code is included for reference. This can go away again once Prebuild is updated with a more general mechanism for cleaning up files.
The Prebuild source code here can be built with nant, or regnerated for other tools using the prebuild at {root}/bin/Prebuild.exe
Diffstat (limited to '')
-rw-r--r-- | Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs new file mode 100644 index 0000000..20095c3 --- /dev/null +++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | |||
@@ -0,0 +1,93 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Xml; | ||
5 | |||
6 | using Prebuild.Core.Attributes; | ||
7 | using Prebuild.Core.Interfaces; | ||
8 | using Prebuild.Core.Utilities; | ||
9 | |||
10 | namespace Prebuild.Core.Nodes | ||
11 | { | ||
12 | [DataNode("DatabaseProject")] | ||
13 | public class DatabaseProjectNode : DataNode | ||
14 | { | ||
15 | string name; | ||
16 | string path; | ||
17 | string fullpath; | ||
18 | Guid guid = Guid.NewGuid(); | ||
19 | readonly List<AuthorNode> authors = new List<AuthorNode>(); | ||
20 | readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>(); | ||
21 | |||
22 | public Guid Guid | ||
23 | { | ||
24 | get { return guid; } | ||
25 | } | ||
26 | |||
27 | public string Name | ||
28 | { | ||
29 | get { return name; } | ||
30 | } | ||
31 | |||
32 | public string Path | ||
33 | { | ||
34 | get { return path; } | ||
35 | } | ||
36 | |||
37 | public string FullPath | ||
38 | { | ||
39 | get { return fullpath; } | ||
40 | } | ||
41 | |||
42 | public IEnumerable<DatabaseReferenceNode> References | ||
43 | { | ||
44 | get { return references; } | ||
45 | } | ||
46 | |||
47 | public override void Parse(XmlNode node) | ||
48 | { | ||
49 | name = Helper.AttributeValue(node, "name", name); | ||
50 | path = Helper.AttributeValue(node, "path", name); | ||
51 | |||
52 | try | ||
53 | { | ||
54 | fullpath = Helper.ResolvePath(path); | ||
55 | } | ||
56 | catch | ||
57 | { | ||
58 | throw new WarningException("Could not resolve Solution path: {0}", path); | ||
59 | } | ||
60 | |||
61 | Kernel.Instance.CurrentWorkingDirectory.Push(); | ||
62 | |||
63 | try | ||
64 | { | ||
65 | Helper.SetCurrentDir(fullpath); | ||
66 | |||
67 | if (node == null) | ||
68 | { | ||
69 | throw new ArgumentNullException("node"); | ||
70 | } | ||
71 | |||
72 | foreach (XmlNode child in node.ChildNodes) | ||
73 | { | ||
74 | IDataNode dataNode = Kernel.Instance.ParseNode(child, this); | ||
75 | |||
76 | if (dataNode == null) | ||
77 | continue; | ||
78 | |||
79 | if (dataNode is AuthorNode) | ||
80 | authors.Add((AuthorNode)dataNode); | ||
81 | else if (dataNode is DatabaseReferenceNode) | ||
82 | references.Add((DatabaseReferenceNode)dataNode); | ||
83 | } | ||
84 | } | ||
85 | finally | ||
86 | { | ||
87 | Kernel.Instance.CurrentWorkingDirectory.Pop(); | ||
88 | } | ||
89 | |||
90 | base.Parse(node); | ||
91 | } | ||
92 | } | ||
93 | } | ||