Esempio n. 1
0
        private VariableSet(VariableSet other)
        {
            foreach (var kvp in other.Values)
                Values.Add(kvp.Key, kvp.Value);

            Values["jsildirectory"] = Program.GetJSILDirectory;
        }
Esempio n. 2
0
 private static string MakeExceptionMessage(string text, VariableSet vs, string missingKey)
 {
     return String.Format(
         "Failed to expand '{0}' because the variable '{1}' does not exist.\r\nValid variables at this location:\r\n{2}",
         text, missingKey,
         String.Join("\r\n", vs.DefinedVariables.OrderBy((v) => v))
     );
 }
Esempio n. 3
0
 private static string MakeExceptionMessage(string text, VariableSet vs, string missingKey)
 {
     return(String.Format(
                "Failed to expand '{0}' because the variable '{1}' does not exist.\r\nValid variables at this location:\r\n{2}",
                text, missingKey,
                String.Join("\r\n", vs.DefinedVariables.OrderBy((v) => v))
                ));
 }
Esempio n. 4
0
        private VariableSet(VariableSet other)
        {
            foreach (var kvp in other.Values)
            {
                Values.Add(kvp.Key, kvp.Value);
            }

            Values["jsildirectory"] = Program.GetJSILDirectory;
        }
Esempio n. 5
0
        public VariableSet ApplyTo(VariableSet variables)
        {
            var result = variables.Clone();

            foreach (var kvp in CustomVariables)
                result[kvp.Key] = BindCustomVariable(kvp.Key);

            result["ConfigDirectory"] = () => Path;
            result["OutputDirectory"] = () => OutputDirectory;
            result["Profile"] = () => Profile;

            result["Configuration"] = () => SolutionBuilder.Configuration;
            result["Platform"] = () => SolutionBuilder.Platform;
            result["Target"] = () => SolutionBuilder.Target;

            return result;
        }
Esempio n. 6
0
        static string MapPath(string path, VariableSet variables, bool ensureExists, bool reportErrors = false)
        {
            var result = variables.ExpandPath(path, false);

            if (ensureExists)
            {
                if (!Directory.Exists(result) && !File.Exists(result))
                {
                    if (reportErrors)
                    {
                        Console.Error.WriteLine("// Could not find file '{0}' -> '{1}'!", path, result);
                    }

                    return(null);
                }
            }

            return(result);
        }
Esempio n. 7
0
        public VariableSet ApplyTo(VariableSet variables)
        {
            var result = variables.Clone();

            foreach (var kvp in CustomVariables)
            {
                result[kvp.Key] = BindCustomVariable(kvp.Key);
            }

            result["ConfigDirectory"] = () => Path;
            result["OutputDirectory"] = () => OutputDirectory;
            result["Profile"]         = () => Profile;

            result["Configuration"] = () => SolutionBuilder.Configuration;
            result["Platform"]      = () => SolutionBuilder.Platform;
            result["Target"]        = () => SolutionBuilder.Target;

            return(result);
        }
Esempio n. 8
0
        static string MapPath(string path, VariableSet variables, bool ensureExists, bool reportErrors = false)
        {
            var result = variables.ExpandPath(path, false);

            if (ensureExists) {
                if (!Directory.Exists(result) && !File.Exists(result)) {
                    if (reportErrors)
                        Console.Error.WriteLine("// Could not find file '{0}' -> '{1}'!", path, result);

                    return null;
                }
            }

            return result;
        }
Esempio n. 9
0
 public VariableExpansionException(string text, VariableSet vs, string missingKey)
     : base(MakeExceptionMessage(text, vs, missingKey))
 {
 }
Esempio n. 10
0
 public VariableExpansionException(string text, VariableSet vs, string missingKey)
     : base(
         MakeExceptionMessage(text, vs, missingKey)
         )
 {
 }