Skip to content

Plugins in profiles broken #772

Closed
Closed
@cemerick

Description

@cemerick

Apologies for the useless title, but things are askew enough that I don't really know how to sum it up.

project.clj #1:

(defproject bad-init "0.0.1-SNAPSHOT"
  :min-lein-version "2.0.0"
  :profiles {:pprint {:plugins [[lein-pprint "1.1.1"]]}})

This should yield a pprinted representation of the project map:

la-mer:tmp chas$ lein with-profile pprint pprint
Performing task 'pprint' with profile(s): 'pprint'
'pprint' is not a task. See 'lein help'.

Did you mean this?
         run
         plugin
Error encountered performing task 'pprint' with profile(s): 'pprint'

project.clj #2:

(defproject bad-init "0.0.1-SNAPSHOT"

  :cljsbuild {:builds [{:source-path "cljs"
                        :compiler {:output-to "target/classes/cljs.js"
                                   :optimizations :whitespace
                                   :pretty-print true}}]}

  :plugins [[lein-pprint "1.1.1"]]

  :profiles {:dev {:plugins [[lein-cljsbuild "0.2.7"]]
                   :hooks [leiningen.cljsbuild]}
             :no-cljsbuild {}})

This should not include lein-cljsbuild in any way as far as I understand how profiles are supposed to work.

la-mer:tmp chas$ lein2 clean
Deleting files generated by lein-cljsbuild.
la-mer:tmp chas$ lein2 with-profile no-cljsbuild clean
Performing task 'clean' with profile(s): 'no-cljsbuild'
Deleting files generated by lein-cljsbuild.

The core issue with #2 AFAICT is that activate-middleware is being called twice: once with all of the defaults (including :dev) and once with the specified set of profiles, so the lein-cljsbuild hooks are applied long before with-profile ever enters the picture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions