Ejemplo n.º 1
0
        /// <summary>
        /// Start the Build with given filename, version, and build type.
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="version"></param>
        /// <param name="build"></param>
        public void Build(string filename, VersionTypes version, BuildTypes build)
        {
            // build the command to call vsvars32.bat
            string initvar;

            switch (version)
            {
            case VersionTypes.VisualStudio2003:
                initvar = config.Get("VSVARS32_2003");
                break;

            case VersionTypes.VisualStudio2005:
                initvar = config.Get("VSVARS32_2005");
                break;

            default:
                throw new ArgumentOutOfRangeException("version=" + version);
            }
            initvar = String.Format("call \"{0}\"", initvar);


            // build the command to build the solution/project
            string buildcmd = new ConfigManager().Get("buildCommand");

            buildcmd = buildcmd.Replace("{FILENAME}", StringUtil.Quote(filename));
            buildcmd = buildcmd.Replace("{BUILDTYPE}", StringUtil.Quote(build.ToString()));

            string command = initvar + Environment.NewLine + buildcmd;

            //// setting up the dos environment
            //Dictionary<string, string> dosEnv = new Dictionary<string, string>();
            //dosEnv.Add("PATH", StringUtil.Merge(MicrosoftDotNetPath, Environment.GetEnvironmentVariable("PATH"), ";"));

            // run the commands.
            ExeRunner r = new ExeRunner();

            try
            {
                r.Run(command);
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
                // WARNING: absorb error only!
            }
            finally
            {
                log.AddRange(r.Log);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a string combined with 3 subversions and type.
 /// </summary>
 /// <returns> x.x.x Type</returns>
 public static string GetVersion() => majorVersion.ToString() + "." + minorVersion.ToString() + "." + buildVersion.ToString() + " " + buildType.ToString();
Ejemplo n.º 3
0
 public static string GetVersion()
 {
     return(majorVersion.ToString() + "." + minorVersion.ToString() + "." + buildVersion.ToString() + " " + buildType.ToString());
 }