//returns an icollection of public static IList <InfoCompile> getReferences_Abstract(int id_abstract) { IList <InfoCompile> referencesSet = new List <InfoCompile>(); IList <Interface> iList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.idao.list(id_abstract); foreach (Interface i in iList) { IList <string> referencesArrayAll_list = new List <string> (); foreach (string reference in i.References) { Console.WriteLine("REFERENCE: " + id_abstract + " - " + i.Class_name + " -- " + reference); referencesArrayAll_list.Add(reference); } IList <SourceCode> scList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.scdao.list('i', i.Id_abstract, i.Id_interface); InfoCompile info = new InfoCompile(); info.sourceContents = new Tuple <string, string> [scList.Count]; int source_counter = 0; foreach (SourceCode sc in scList) { IList <string> sourceRefs = sc.ExternalReferences; foreach (string sourceRef in sourceRefs) { referencesArrayAll_list.Add(sourceRef); } info.sourceContents [source_counter] = new Tuple <string, string> (sc.File_name.Split('.')[0], sc.Contents); source_counter++; } string[] referencesArrayAll = new string[referencesArrayAll_list.Count]; referencesArrayAll_list.CopyTo(referencesArrayAll, 0); AbstractComponentFunctor acf1 = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract); info.moduleName = i.Class_name; info.unitId = i.Id_interface; // info.partition_index = i.Unit_replica; info.cuid = acf1.Hash_component_UID; info.library_path = acf1.Library_path; info.id = acf1.Id_abstract; info.references = referencesArrayAll; referencesSet.Add(info); // libRefs.Add(buildDllName(acf1.Library_path, acf1.Library_path + "." + info.sourceName.Split('.')[0])); // DESNECESSÁRIO, pois agora tudo vai ser compilado junto info.output_type = /*sc.File_type.Equals("exe") ? Constants.EXE_OUT : */ Constants.DLL_OUT; }//foreach return(referencesSet); }
}//resolution //returns an icollection of public static IList <InfoCompile> getReferences_Concrete(int id_concrete) { Component component = br.ufc.pargo.hpe.backend.DGAC.BackEnd.cdao.retrieve(id_concrete); IList <InfoCompile> referencesSet = new List <InfoCompile>(); IList <Unit> unitList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.udao.list(id_concrete); foreach (br.ufc.pargo.hpe.backend.DGAC.database.Unit unit in unitList) { Interface interfaceUnit = br.ufc.pargo.hpe.backend.DGAC.BackEnd.idao.retrieve(unit.Id_abstract, unit.Id_interface); AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(interfaceUnit.Id_abstract); IList <string> referencesArrayAll_list = new List <string> (); IDictionary <string, AbstractComponentFunctorApplication> pars = component.Arguments; Console.WriteLine("BEGIN TAKING REFERENCES OF " + (unit.Id_abstract) + ", " + id_concrete); foreach (string reference in interfaceUnit.fetchReferences(pars)) { Console.WriteLine(reference); referencesArrayAll_list.Add(reference); } Console.WriteLine("END TAKING REFERENCES OF " + (unit.Id_abstract)); string file_name_Interface = buildDllName(acf.Library_path, interfaceUnit.Assembly_string); if (!referencesArrayAll_list.Contains(file_name_Interface)) { referencesArrayAll_list.Add(file_name_Interface); } // string file_name_Interface_base = buildDllNameBase(acf.Library_path, interfaceUnit.Assembly_string); // if (!referencesArrayAll_list.Contains(file_name_Interface_base)) // referencesArrayAll_list.Add(file_name_Interface_base); IList <SourceCode> scList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.scdao.list('u', unit.Id_concrete, unit.Id_unit); InfoCompile info = new InfoCompile(); IList <Tuple <string, string> > sourceContents_list = new List <Tuple <string, string> > (); foreach (SourceCode sc in scList) { if (sc.File_type.Equals("dll")) { IList <string> sourceRefs = sc.ExternalReferences; foreach (string sourceRef in sourceRefs) { referencesArrayAll_list.Add(sourceRef); } sourceContents_list.Add(new Tuple <string, string> (sc.File_name.Split('.') [0], sc.Contents)); } } info.sourceContents = new Tuple <string, string> [sourceContents_list.Count]; sourceContents_list.CopyTo(info.sourceContents, 0); string[] referencesArrayAll = new string[referencesArrayAll_list.Count]; referencesArrayAll_list.CopyTo(referencesArrayAll, 0); info.moduleName = unit.Class_name; info.unitId = unit.Id_unit; info.cuid = component.Hash_component_UID; info.library_path = component.Library_path; info.id = component.Id_concrete; info.output_type = Constants.DLL_OUT; info.references = referencesArrayAll; referencesSet.Add(info); }//foreach return(referencesSet); }