Skip to content

Commit

Permalink
Move skip-if-prepping out of the 'do' (Fixes #127).
Browse files Browse the repository at this point in the history
  • Loading branch information
emezeske committed Aug 28, 2012
1 parent 9ee4514 commit ccf9f9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions bin/test-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ pushd $project_root
rm -rf ~/.m2/repository/lein-cljsbuild ~/.m2/repository/cljsbuild/
for d in support plugin; do
pushd $d
lein install, midje
lein install #, midje
popd
done
for d in $projects; do
pushd example-projects/$d
if [ $d = advanced ]; then
extra_command=', cljsbuild test'
fi
lein clean
#lein clean
#rm -rf .lein-*
#lein cljsbuild clean, cljsbuild once$extra_command
lein2 clean
rm -rf .lein-*
lein cljsbuild clean, cljsbuild once$extra_command
lein clean
rm -rf .lein-*
lein2 do cljsbuild clean, cljsbuild once$extra_command
lein2 do cljsbuild clean, cljsbuild once #$extra_command
popd
done
20 changes: 10 additions & 10 deletions plugin/src/leiningen/cljsbuild.clj
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,19 @@
(lhelp/subtask-help-for *ns* #'cljsbuild))
(exit-failure))))))

; Lein2 "preps" the project when eval-in-project is called. This
; causes it to be compiled, which normally would trigger the compile
; hook below, which is bad because we can't compile unless we're in
; the dummy subproject. To solve this problem, we disable all of the
; hooks if we notice that lein2 is currently prepping.
(defmacro skip-if-prepping [task args & forms]
`(if (subproject/prepping?)
(apply ~task ~args)
(do ~@forms)))

; Supporting both lein1 and lein2 is starting to become VERY PAINFUL.
(if lein2?
(do
; Lein2 "preps" the project when eval-in-project is called. This
; causes it to be compiled, which normally would trigger the compile
; hook below, which is bad because we can't compile unless we're in
; the dummy subproject. To solve this problem, we disable all of the
; hooks if we notice that lein2 is currently prepping.
(defmacro skip-if-prepping [task args & forms]
`(if (subproject/prepping?)
(apply ~task ~args)
(do ~@forms)))

(defn compile-hook [task & args]
(skip-if-prepping task args
(apply task args)
Expand Down

0 comments on commit ccf9f9e

Please sign in to comment.