7 public enum BasePlatform
15 public string source_path;
16 public string pkg_path;
17 public string builder_path;
18 public string build_options;
19 public builder.BasePlatform Platform;
23 if ((int)System.Environment.OSVersion.Platform == 128)
25 Platform = BasePlatform.Platform_Linux;
29 Platform = BasePlatform.Platform_Windows;
33 public static string PathFormat(string format, params string [] args)
35 string temp = string.Format(format, args);
36 return temp.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
39 public bool ReadFromFile(string file)
42 StreamReader sr = null;
45 sr = new StreamReader(file);
48 string delim = "\t \n\r\v";
51 while ( (line = sr.ReadLine()) != null )
53 line = line.Trim(delim.ToCharArray());
54 if (line.Length < 1 || line[0] == ';')
58 string [] s = line.Split(split.ToCharArray());
60 if (s.GetLength(0) >= 1)
63 if (s.GetLength(0) >= 2)
65 for (int i=1; i<s.GetLength(0); i++)
70 key = key.Trim(delim.ToCharArray());
71 val = val.Trim(delim.ToCharArray());
72 if (key.CompareTo("SourceBase") == 0)
76 else if (key.CompareTo("OutputBase") == 0)
80 else if (key.CompareTo("BuilderPath") == 0)
84 else if (key.CompareTo("BuildOptions") == 0)
91 catch (System.Exception e)
93 Console.WriteLine("Unable to read {0:s}: {1:s}", file, e.Message);