Formatting for leiningen-core files.
This commit is contained in:
parent
8f953e21cf
commit
568065d4d9
6 changed files with 23 additions and 26 deletions
|
@ -9,7 +9,7 @@
|
|||
[leiningen.core.main :as main]
|
||||
[leiningen.core.classpath :as classpath]
|
||||
[leiningen.core.utils :as utils])
|
||||
(:import [com.hypirion.io Pipe ClosingPipe]))
|
||||
(:import (com.hypirion.io Pipe ClosingPipe)))
|
||||
|
||||
;; # OS detection
|
||||
|
||||
|
|
|
@ -321,8 +321,6 @@
|
|||
:offline {:offline? true}
|
||||
:debug {:debug true}}))
|
||||
|
||||
|
||||
|
||||
(defn- meta-merge
|
||||
"Recursively merge values based on the information in their metadata."
|
||||
[left right]
|
||||
|
@ -477,8 +475,8 @@
|
|||
(doseq [hook-name (concat (plugin-hooks project) (:hooks project))]
|
||||
;; if hook-name is just a namespace assume hook fn is called activate
|
||||
(let [hook-name (if (namespace hook-name)
|
||||
hook-name
|
||||
(symbol (name hook-name) "activate"))]
|
||||
hook-name
|
||||
(symbol (name hook-name) "activate"))]
|
||||
(load-hook hook-name)))
|
||||
project)
|
||||
|
||||
|
@ -557,8 +555,8 @@
|
|||
[project profiles]
|
||||
(let [{:keys [included-profiles excluded-profiles]} (meta project)]
|
||||
(set-profiles project
|
||||
(concat included-profiles profiles)
|
||||
(remove (set profiles) excluded-profiles))))
|
||||
(concat included-profiles profiles)
|
||||
(remove (set profiles) excluded-profiles))))
|
||||
|
||||
(defn unmerge-profiles
|
||||
"Compute a fresh version of the project map with the given profiles unmerged
|
||||
|
@ -566,8 +564,8 @@
|
|||
[project profiles]
|
||||
(let [{:keys [included-profiles excluded-profiles]} (meta project)]
|
||||
(set-profiles project
|
||||
(remove (set profiles) included-profiles)
|
||||
(concat excluded-profiles profiles))))
|
||||
(remove (set profiles) included-profiles)
|
||||
(concat excluded-profiles profiles))))
|
||||
|
||||
(defn- init-lein-classpath
|
||||
"Adds dependencies to Leiningen's classpath if required."
|
||||
|
@ -579,8 +577,7 @@
|
|||
(defn init-project
|
||||
"Initializes a project. This is called at startup with the default profiles."
|
||||
[project]
|
||||
(-> project
|
||||
(doto
|
||||
(-> (doto project
|
||||
(load-certificates)
|
||||
(init-lein-classpath)
|
||||
(load-plugins))
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
(let [ks (make-keystore trusted-certs)
|
||||
kmf (key-manager-factory (key-manager-props))
|
||||
tmf (trust-manager-factory ks)]
|
||||
(doto (SSLContext/getInstance "TLS")
|
||||
(.init (.getKeyManagers kmf) (.getTrustManagers tmf) nil))))
|
||||
(doto (SSLContext/getInstance "TLS")
|
||||
(.init (.getKeyManagers kmf) (.getTrustManagers tmf) nil))))
|
||||
|
||||
(alter-var-root #'make-sslcontext memoize)
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
(defn gpg-available?
|
||||
"Verifies (gpg-program) exists"
|
||||
[]
|
||||
(= 0 (:exit (gpg "--version"))))
|
||||
(zero? (:exit (gpg "--version"))))
|
||||
|
||||
(defn credentials-fn
|
||||
"Decrypt map from credentials.clj.gpg in Leiningen home if present."
|
||||
|
@ -94,9 +94,8 @@
|
|||
(if (.exists cred-file)
|
||||
(credentials-fn cred-file))))
|
||||
([file]
|
||||
(let [{:keys [out err exit]} (gpg
|
||||
"--quiet" "--batch"
|
||||
"--decrypt" "--" (str file))]
|
||||
(let [{:keys [out err exit]} (gpg "--quiet" "--batch"
|
||||
"--decrypt" "--" (str file))]
|
||||
(if (pos? exit)
|
||||
(binding [*out* *err*]
|
||||
(println "Could not decrypt credentials from" (str file))
|
||||
|
@ -140,7 +139,7 @@
|
|||
"Applies credentials from the environment or ~/.lein/credentials.clj.gpg
|
||||
as they are specified and available."
|
||||
[settings]
|
||||
(let [gpg-creds (when (= :gpg (:creds settings))
|
||||
(let [gpg-creds (if (= :gpg (:creds settings))
|
||||
(match-credentials settings (credentials)))
|
||||
resolved (reduce (partial resolve-credential settings)
|
||||
(empty settings)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
(ns leiningen.core.utils
|
||||
(:require [clojure.java.io :as io])
|
||||
(:import [com.hypirion.io RevivableInputStream]
|
||||
[clojure.lang LineNumberingPushbackReader]
|
||||
[java.io File FileDescriptor FileInputStream InputStreamReader]
|
||||
[java.net URL]))
|
||||
(:import (com.hypirion.io RevivableInputStream)
|
||||
(clojure.lang LineNumberingPushbackReader)
|
||||
(java.io File FileDescriptor FileInputStream InputStreamReader)
|
||||
(java.net URL)))
|
||||
|
||||
(def rebound-io? (atom false))
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
|||
(defn build-url
|
||||
"Creates java.net.URL from string"
|
||||
[url]
|
||||
(try (URL. url)
|
||||
(catch java.net.MalformedURLException _
|
||||
(URL. (str "http://" url)))))
|
||||
(try (URL. url)
|
||||
(catch java.net.MalformedURLException _
|
||||
(URL. (str "http://" url)))))
|
||||
|
||||
(defn read-file
|
||||
"Read the contents of file if it exists."
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
(ns leiningen.bluuugh)
|
||||
(ns leiningen.bluuugh
|
||||
"Dummy task for tests.")
|
||||
|
||||
(defn ^:no-project-needed bluuugh
|
||||
[project]
|
||||
|
|
Loading…
Reference in a new issue