2 // LoggerInfo.cs: Contains information about logger parameters.
5 // Marek Sieradzki (marek.sieradzki@gmail.com)
7 // (C) 2005 Marek Sieradzki
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Globalization;
32 using System.Reflection;
33 using Mono.XBuild.Framework;
35 namespace Mono.XBuild.CommandLine {
36 internal class LoggerInfo : AssemblyLoadInfo {
44 public LoggerInfo (string s)
46 string version = null;
47 string culture = null;
49 string filename = null;
50 string loggerClass = null;
52 string[] temp1 = s.Split (':');
53 string[] temp2 = temp1[1].Split (',');
55 // FIXME: replace all of this with readable code
56 loggerClass = temp2 [0];
57 if (temp2.Length == 4) {
59 version = temp2 [2].Split ('=') [1];
60 string[] temp3 = temp2 [3].Split (';');
61 if (temp3.Length == 1) {
62 culture = temp2 [3].Split ('=') [1];
64 if (temp3.Length > 1 ) {
65 culture = temp3 [0].Split ('=') [1];
66 parameters = temp3 [1];
69 if (temp2.Length == 2) {
70 string[] temp3 = temp2 [1].Split (';');
71 if (temp3 [0].EndsWith (".dll")) {
77 parameters = temp3 [1];
81 SetAssemblyName (LoadInfoType.AssemblyName, null, name, version, culture, null,loggerClass);
82 else if (filename != null)
83 SetAssemblyName (LoadInfoType.AssemblyFilename, filename, null, null, null, null, loggerClass);
86 public string Parameters {
87 get { return parameters; }