~ubuntu-branches/ubuntu/feisty/nant/feisty

« back to all changes in this revision

Viewing changes to src/NAnt.VSNet/FileReferenceBase.cs

  • Committer: Bazaar Package Importer
  • Author(s): Dave Beckett
  • Date: 2006-06-12 23:30:36 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060612233036-a1uwh0949z0218ep
Tags: 0.84+0.85-rc4-1
* New upstream release
* Acknowledge NMU (Closes: #372588)
* Standards-Version 3.7.2
* Update to latest CLI policy package split.  Build-Depends-Indep: on
  cli-common-dev, libmono-winforms1.0-cil, libmono-winforms2.0-cil and
  mono-gmcs to get 1.0 and 2.0 packages
* Removed patches no longer needed:
  - 01-AssemblyInfoTask.cs.patch
  - 02-ScriptTask.cs.patch
  - 03-XmlResultFormatter.cs.patch
  - 04-SourceControl.patch
  - 05-ExceptionTest.cs

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        #region Protected Instance Methods
79
79
 
80
80
        /// <summary>
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.
82
83
        /// </summary>
83
84
        /// <param name="assemblyFile">The path of the assembly to get the output files for.</param>
84
 
        /// <returns>
85
 
        /// The complete set of output files for the reference.
86
 
        /// </returns>
 
85
        /// <param name="outputFiles">The set of output files to be updated.</param>
87
86
        /// <remarks>
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.
91
90
        /// </remarks>
92
 
        protected Hashtable GetAssemblyOutputFiles(string assemblyFile) {
93
 
            Hashtable outputFiles = CollectionsUtil.CreateCaseInsensitiveHashtable();
94
 
 
 
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
 
94
                // generated
 
95
                return;
99
96
            }
100
97
 
101
 
            string[] referencedModules = GetAllReferencedModules(assemblyFile);
 
98
            if (!outputFiles.ContainsKey(assemblyFile)) {
 
99
                string[] referencedModules = GetAllReferencedModules(assemblyFile);
102
100
 
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)) {
112
 
                        continue;
 
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)) {
 
110
                            continue;
 
111
                        }
113
112
                    }
114
 
                }
115
113
 
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);
121
117
                }
122
118
            }
123
 
 
124
 
            return outputFiles;
125
119
        }
126
120
 
127
121
        #endregion Protected Instance Methods