 
 (defn do-compile-modules
   "compiles source based on :build-modules (created by prepare-modules)"
-  [{:keys [build-modules] :as state}]
-  (let [source-names
-        (into [] (mapcat :sources build-modules))]
-    (compile-sources state source-names)))
+  [{:keys [build-sources] :as state}]
+  (compile-sources state build-sources))
 
 (defn prepare-compile
   "prepares for compilation (eg. create source lookup index, runtime-setup)"

        (fn [state source-name]
          (let [src (get-in state [:sources source-name])
                compiled-src (generate-output-for-source state src)]
            (-> state
                (assoc-in [:sources source-name] compiled-src)
                (cond->
                  (not= (:compiled-at src)
                        (:compiled-at compiled-src))
                  (update :compiled conj source-name)
                  ))))
        (assoc state :compiled [])
        source-names))))

(defn par-compile-one
  [state ready-ref compiled-ref errors-ref source-name]
  (let [{:keys [requires] :as src}
        (get-in state [:sources source-name])]


            (let [{:keys [provides] :as compiled-src}
                  (generate-output-for-source state src)]

              (swap! ready-ref set/union provides)
              compiled-src)
            (catch Exception e
