78
78
#region Protected Instance Methods
81
/// Gets the complete set of output files for the specified assembly.
81
/// Gets the complete set of output files for the specified assembly
82
/// and adds them to <paremref name="outputFiles"/> collection.
83
84
/// <param name="assemblyFile">The path of the assembly to get the output files for.</param>
85
/// The complete set of output files for the reference.
85
/// <param name="outputFiles">The set of output files to be updated.</param>
88
87
/// The key of the case-insensitive <see cref="Hashtable" /> is the
89
88
/// full path of the output file and the value is the path relative to
90
89
/// the output directory.
92
protected Hashtable GetAssemblyOutputFiles(string assemblyFile) {
93
Hashtable outputFiles = CollectionsUtil.CreateCaseInsensitiveHashtable();
91
protected void GetAssemblyOutputFiles(string assemblyFile, Hashtable outputFiles) {
95
92
if (!File.Exists(assemblyFile)) {
96
throw new BuildException(string.Format(CultureInfo.InvariantCulture,
97
"Couldn't find referenced assembly '{0}'.", assemblyFile),
98
Location.UnknownLocation);
93
// no need to output warning if set of output files cannot be
101
string[] referencedModules = GetAllReferencedModules(assemblyFile);
98
if (!outputFiles.ContainsKey(assemblyFile)) {
99
string[] referencedModules = GetAllReferencedModules(assemblyFile);
103
// get a list of the references in the output directory
104
foreach (string referenceFile in referencedModules) {
105
// skip module if module is not the assembly referenced by
106
// the project and is installed in GAC
107
if (string.Compare(referenceFile, assemblyFile, true, CultureInfo.InvariantCulture) != 0) {
108
// skip referenced module if the assembly referenced by
109
// the project is a system reference or the module itself
110
// is installed in the GAC
111
if (IsSystem || GacCache.IsAssemblyInGac(referenceFile)) {
101
// get a list of the references in the output directory
102
foreach (string referenceFile in referencedModules) {
103
// skip module if module is not the assembly referenced by
104
// the project and is installed in GAC
105
if (string.Compare(referenceFile, assemblyFile, true, CultureInfo.InvariantCulture) != 0) {
106
// skip referenced module if the assembly referenced by
107
// the project is a system reference or the module itself
108
// is installed in the GAC
109
if (IsSystem || GacCache.IsAssemblyInGac(referenceFile)) {
116
// get list of files related to referenceFile, this will include
117
// referenceFile itself
118
Hashtable relatedFiles = GetRelatedFiles(referenceFile);
119
foreach (DictionaryEntry de in relatedFiles) {
120
outputFiles[(string) de.Key] = (string) de.Value;
114
// get list of files related to referenceFile, this will include
115
// referenceFile itself
116
GetRelatedFiles(referenceFile, outputFiles);
127
121
#endregion Protected Instance Methods