コード例 #1
0
        void GetReferencedProjects(CombineEntryCollection referenced, Project project)
        {
            if (referenced.Contains (project)) return;

            if (NeedsBuilding)
                referenced.Add (project);

            foreach (ProjectReference pref in project.ProjectReferences) {
                if (pref.ReferenceType == ReferenceType.Project) {
                    Combine c = project.RootCombine;
                    if (c != null) {
                        Project rp = c.FindProject (pref.Reference);
                        if (rp != null)
                            GetReferencedProjects (referenced, rp);
                    }
                }
            }
        }
コード例 #2
0
 void GetAllProjects(CombineEntryCollection list)
 {
     foreach (CombineEntry entry in Entries) {
         if (entry is Project) {
             list.Add (entry);
         } else if (entry is Combine) {
             ((Combine)entry).GetAllProjects (list);
         }
     }
 }
コード例 #3
0
        public virtual ICompilerResult Build(IProgressMonitor monitor, bool buildReferences)
        {
            if (buildReferences)
            {
                CombineEntryCollection referenced = new CombineEntryCollection ();
                GetReferencedProjects (referenced, this);

                referenced = Combine.TopologicalSort (referenced);

                CompilerResults cres = new CompilerResults (null);

                int builds = 0;
                int failedBuilds = 0;

                monitor.BeginTask (null, referenced.Count);
                foreach (Project p in referenced) {
                    ICompilerResult res = p.Build (monitor, false);
                    cres.Errors.AddRange (res.CompilerResults.Errors);
                    monitor.Step (1);
                    builds++;
                    if (res.ErrorCount > 0) {
                        failedBuilds = 1;
                        break;
                    }
                }
                monitor.EndTask ();
                return new DefaultCompilerResult (cres, "", builds, failedBuilds);
            }

            if (!NeedsBuilding)
                return new DefaultCompilerResult (new CompilerResults (null), "");

            try {
                monitor.BeginTask (String.Format (GettextCatalog.GetString ("Building Project: {0} Configuration: {1}"), Name, ActiveConfiguration.Name), 3);

                Runtime.StringParserService.Properties["Project"] = Name;

                DoPreBuild (monitor);

                monitor.Step (1);
                monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Performing main compilation...")));

                ICompilerResult res = DoBuild (monitor);

                monitor.Step (1);

                DoPostBuild (monitor);

                isDirty = false;

                monitor.Step (1);
                monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Build complete -- {0} errors, {1} warnings"), res.ErrorCount, res.WarningCount));

                return res;
            } finally {
                monitor.EndTask ();
            }
        }
コード例 #4
0
        void GetAllBuildableEntries(CombineEntryCollection list, string configuration)
        {
            CombineConfiguration conf = (CombineConfiguration) GetConfiguration (configuration);
            if (conf == null)
                return;

            foreach (CombineConfigurationEntry entry in conf.Entries) {
                if (!entry.Build)
                    continue;
                if (entry.Entry is Combine)
                    ((Combine)entry.Entry).GetAllBuildableEntries (list, configuration);
                else if (entry.Entry is Project)
                    list.Add (entry.Entry);
            }
        }
コード例 #5
0
 static void Insert(int index, CombineEntryCollection allProjects, CombineEntryCollection sortedEntries, bool[] inserted, bool[] triedToInsert)
 {
     if (triedToInsert[index]) {
         throw new CyclicBuildOrderException();
     }
     triedToInsert[index] = true;
     foreach (ProjectReference reference in ((Project)allProjects[index]).ProjectReferences) {
         if (reference.ReferenceType == ReferenceType.Project) {
             int j = 0;
             for (; j < allProjects.Count; ++j) {
                 if (reference.Reference == ((Project)allProjects[j]).Name) {
                     if (!inserted[j]) {
                         Insert(j, allProjects, sortedEntries, inserted, triedToInsert);
                     }
                     break;
                 }
             }
         }
     }
     sortedEntries.Add(allProjects[index]);
     inserted[index] = true;
 }
コード例 #6
0
 internal static CombineEntryCollection TopologicalSort(CombineEntryCollection allProjects)
 {
     CombineEntryCollection sortedEntries = new CombineEntryCollection ();
     bool[]    inserted      = new bool[allProjects.Count];
     bool[]    triedToInsert = new bool[allProjects.Count];
     for (int i = 0; i < allProjects.Count; ++i) {
         inserted[i] = triedToInsert[i] = false;
     }
     for (int i = 0; i < allProjects.Count; ++i) {
         if (!inserted[i]) {
             Insert(i, allProjects, sortedEntries, inserted, triedToInsert);
         }
     }
     return sortedEntries;
 }
コード例 #7
0
 /// <remarks>
 /// Returns an ArrayList containing all ProjectEntries in this combine and 
 /// undercombines
 /// </remarks>
 public CombineEntryCollection GetAllProjects()
 {
     CombineEntryCollection list = new CombineEntryCollection();
     GetAllProjects (list);
     return list;
 }
コード例 #8
0
 public CombineEntryCollection GetAllBuildableEntries(string configuration)
 {
     CombineEntryCollection list = new CombineEntryCollection();
     GetAllBuildableEntries (list, configuration);
     return list;
 }