     (filter #(.. % getName (endsWith ending))
             (mapcat file-seq parent-dirs))))
 
-(defn missing-vcproj []
+(defn missing-vcxproj []
   (let [device-adapter-dirs (device-adapter-dirs)
-        directories-without-vcproj
+        directories-without-vcxproj
         (filter identity
                 (for [device-adapter-dir device-adapter-dirs]
-                  (when (empty? (filter #(.. % getName (endsWith ".vcproj"))
+                  (when (empty? (filter #(.. % getName (endsWith ".vcxproj"))
                                         (file-seq device-adapter-dir)))
                     device-adapter-dir)))]
         (sort
           (clojure.set/difference
-            (set (map #(.getName %) directories-without-vcproj))
+            (set (map #(.getName %) directories-without-vcxproj))
             (do-not-build)
             non-windows-device-adapters))))
-
-(defn device-vcproj-files []
-    (filter #(.. % getName (endsWith ".vcproj"))
-            (mapcat file-seq device-adapter-parent-dirs)))
 
 (defn device-vcxproj-files []
     (filter #(.. % getName (endsWith ".vcxproj"))

  (let [installer32-ok (exe-on-server? 32 today-token)
        installer64-ok (exe-on-server? 64 today-token)
        mac-ok (mac-build-on-server? today-token)
        missing-vcproj-files (missing-vcproj)
        missing-links (missing-device-links)]
    (when-not (and (not testmode)
                   installer32-ok
                   installer64-ok
                   mac-ok
                   (empty? missing-vcproj-files)
                   (empty? missing-links))
      (str
        "MICROMANAGER BUILD STATUS REPORT\n"

  (dorun (map #(replace-in-file! % pat new-val) files)))

(defn fix-output-file-tags!
  "Fix the dll output path specified in all vcxproj files."
  []
  (replace-in-files! (device-vcxproj-files)
                    #"\$\(OutDir\)/.+?\.dll" "\\$(OutDir)/mmgr_dal_\\$(ProjectName).dll"))
    
(defn find-copy-step [vcxproj]
  (re-find #"\"copy .+?\"" (slurp vcxproj)))

(defn bad-copy-step [vcxproj]
  (not (.contains (or (find-copy-step vcxproj) "PlatformName") "PlatformName")))

(defn all-bad-copy-steps
  "Find all vcxproj files with a bad post-build copy step"
  []
  (filter bad-copy-step (device-vcxproj-files)))

(defn find-pdb [vcxproj]
  (re-find #"\".*?\.pdb\"" (slurp vcxproj)))

(defn fix-pdb-file-tags!
  "Fix the pdb file path specified in all vcxproj files."
  []
  (replace-in-files! (device-vcxproj-files)
                    #"\".*?\.pdb\"" "\"\\$(OutDir)/\\$(ProjectName).pdb\""))


