Ejemplo n.º 1
0
        private static void DoIt(string[] args)
        {
            InitializeBuild(args[2]);

            string rev = "";

            switch (args[0].ToLower())
            {
            case "-svn":
                InitializeWorkspace(args[1]);
                //GetBuildTools();
                FileInfo fi = new FileInfo(PathConverter.ConvertUrlToPath(args[1], baseUrl, workspace));
                Environment.CurrentDirectory = fi.DirectoryName;
                BuildWorkspace();
                Compile(fi.Name);
                rev = Commit(args[2]);
                break;

            case "-b":

                break;

            default:
                break;
            }

            Success(rev);
        }
Ejemplo n.º 2
0
        private static void UpdateSource(string parent, string source)
        {
            string url      = PathConverter.ConvertPathToUrl(source, baseUrl, workspace);
            string nodeType = GetNodeType(url);

            if (nodeType == "file")
            {
                UpdateToReference(url);
                string r = PathConverter.ConvertUrlToPath(url, baseUrl, workspace);
                AddToGatheredRefsList(parent, r);
                FileInfo fi = new FileInfo(r);
                if (fi.Extension.EndsWith("proj"))
                {
                    List <string> refList = ProjFileOps.GetReferences(fi, fi.DirectoryName);
                    foreach (string f in refList)
                    {
                        UpdateSource(fi.FullName, f);
                    }
                }
            }
            else
            {
                string r = PathConverter.ConvertUrlToPath(url, baseUrl, workspace);
                gatheredRefs.Add(r, parent);
                UpdateToReference(url);
            }
        }
Ejemplo n.º 3
0
        private static void AddReferencesToDatabase()
        {
            //bool inDb = false;
            //try
            //{
            //    using (BT_SemiAutoEntities de = new BT_SemiAutoEntities())
            //    {
            //        de.Builds.Add(currentBuild);
            //        de.SaveChanges();
            //        inDb = true;
            //    }
            //}
            //catch
            //{
            //    inDb = false;
            //}

            //if (inDb == true)
            //{
            Console.ForegroundColor = infoColor;
            Echo("Adding references for this build to the database...");
            Echo();
            //}

            foreach (string r in gatheredRefs.Keys)
            {
                string rev = GetRevision(r);
                string url = PathConverter.ConvertPathToUrl(r, baseUrl, workspace);
                //BuildSource bs = new BuildSource();
                //bs.BuildId = currentBuild.Id;
                //bs.RepositoryType = "svn";
                //bs.Revision = rev;
                //bs.Url = url;
                //bs.ReferencedBy = gatheredRefs[r];

                using (BuildWellWCF.BuildWellWCFClient client = new BuildWellWCF.BuildWellWCFClient())
                {
                    client.AddBuildReference((int)buildId, gatheredRefs[r], "svn", rev, url);
                }

                //bi.SourceCodeRevision += bs.Revision + " " + bs.Url + " Reference By: " + bs.ReferencedBy + "\n\r";

                //if (inDb == true)
                //{
                //    using (BT_SemiAutoEntities de = new BT_SemiAutoEntities())
                //    {
                //        de.BuildSources.Add(bs);
                //        de.SaveChanges();
                //    }
                //}
            }

            Echo();
            Console.ForegroundColor = oColor;
        }
Ejemplo n.º 4
0
        private static void UpdateToReference(string path, string rev = "")
        {
            Console.ForegroundColor = infoColor;
            Echo("Gathering source at " + path + "...");

            string nodeType = GetNodeType(path);

            if (path.Contains("http://"))
            {
                path = PathConverter.ConvertUrlToPath(path, baseUrl, workspace);
            }

            string dir = "";

            if (!File.Exists(path) && !Directory.Exists(path))
            {
                if (!string.IsNullOrEmpty(nodeType))
                {
                    if (nodeType == "file")
                    {
                        FileInfo fi = new FileInfo(path);
                        dir = fi.DirectoryName;
                    }
                    else
                    {
                        DirectoryInfo di = new DirectoryInfo(path);
                        dir = di.FullName;
                    }

                    while (!Directory.Exists(dir))
                    {
                        RecursiveUpdate(dir);
                    }

                    if (Directory.Exists(dir))
                    {
                        FullUpdate(dir);
                    }
                }
            }
        }