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

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

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