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

            Values["jsildirectory"] = Program.GetJSILDirectory;
        }
Ejemplo 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))
     );
 }
Ejemplo 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))
                ));
 }
Ejemplo n.º 4
0
        private VariableSet(VariableSet other)
        {
            foreach (var kvp in other.Values)
            {
                Values.Add(kvp.Key, kvp.Value);
            }

            Values["jsildirectory"] = Program.GetJSILDirectory;
        }
Ejemplo 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;
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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;
        }
Ejemplo n.º 9
0
 public VariableExpansionException(string text, VariableSet vs, string missingKey)
     : base(MakeExceptionMessage(text, vs, missingKey))
 {
 }
Ejemplo n.º 10
0
 public VariableExpansionException(string text, VariableSet vs, string missingKey)
     : base(
         MakeExceptionMessage(text, vs, missingKey)
         )
 {
 }