Skip to content
This repository
Browse code

Remove commented-out shell wrapper remainders.

  • Loading branch information...
commit e7dadcd7b92134d6e5877ebe44b98554d17716ac 1 parent c2565d2
Phil Hagelberg authored August 01, 2012
5  sample.project.clj
@@ -109,9 +109,8 @@
109 109
   ;;   [& args]
110 110
   ;;   (comment Do app initialization here))
111 111
   ;;
112  
-  ;; Set :skip-aot metadata on this symbol to use
113  
-  ;; it for other things like the run task or shell wrappers without
114  
-  ;; bringing in AOT if you don't need an executable uberjar.
  112
+  ;; Set :skip-aot metadata on this symbol to use it for other things like the
  113
+  ;; run task without triggering AOT if you don't need an executable uberjar.
115 114
   :main my.service.runner
116 115
   ;; Options to change the way the REPL behaves
117 116
   :repl-options {;; Specify the string to print when prompting for input.
70  src/leiningen/jar.clj
@@ -13,73 +13,9 @@
13 13
            (java.io BufferedOutputStream FileOutputStream
14 14
                     ByteArrayInputStream)))
15 15
 
16  
-
17  
-;; (declare make-local-repo)
18  
-
19  
-;; (defn- read-resource [resource-name]
20  
-;;   (-> (.getContextClassLoader (Thread/currentThread))
21  
-;;       (.getResourceAsStream resource-name)
22  
-;;       (slurp)))
23  
-
24  
-;; (defn- read-bin-template [system]
25  
-;;   (case system
26  
-;;     :unix (read-resource "script-template")
27  
-;;     :windows (read-resource "script-template.bat")))
28  
-
29 16
 (defn- unix-path [path]
30 17
   (.replace path "\\" "/"))
31 18
 
32  
-;; (defn windows-path [path]
33  
-;;   (.replace path "/" "\\"))
34  
-
35  
-;; (defn local-repo-path
36  
-;;   ([group name version]
37  
-;;      (local-repo-path {:group group :name name :version version}))
38  
-;;   ([{:keys [group name version]}]
39  
-;;      (unix-path (format
40  
-;;                  "%s/%s/%s/%s/%s-%s.jar"
41  
-;;                  (.getBasedir (make-local-repo)) (.replace group "." "/")
42  
-;;                  name version name version))))
43  
-
44  
-;; (defn- script-classpath-for [project deps system]
45  
-;;   (let [unix-paths (conj (for [dep deps]
46  
-;;                            (unix-path (format "$HOME/.m2/repository/%s" dep)))
47  
-;;                          (local-repo-path project))]
48  
-;;     (case system
49  
-;;       :unix (string/join ":" unix-paths)
50  
-;;       :windows (string/join ";" (for [path unix-paths]
51  
-;;                                   (windows-path
52  
-;;                                    (.replace path "$HOME"
53  
-;;                                              "%USERPROFILE%")))))))
54  
-
55  
-;; (defn- shell-wrapper-name [project]
56  
-;;   (get-in project [:shell-wrapper :bin]
57  
-;;           (format "bin/%s" (:name project))))
58  
-
59  
-;; (defn- shell-wrapper-contents [project bin-name main deps-fileset system]
60  
-;;   (let [file-name (case system
61  
-;;                     :unix bin-name
62  
-;;                     :windows (format "%s.bat" bin-name))
63  
-;;         bin-file (file file-name)]
64  
-;;     (format (if (.exists bin-file)
65  
-;;               (slurp bin-file)
66  
-;;               (read-bin-template system))
67  
-;;             (script-classpath-for project deps-fileset system)
68  
-;;             main (:version project))))
69  
-
70  
-;; (defn- shell-wrapper-filespecs [project deps-fileset]
71  
-;;   (when (:shell-wrapper project)
72  
-;;     (let [main (or (:main (:shell-wrapper project)) (:main project))
73  
-;;           bin-name (shell-wrapper-name project)
74  
-;;           read-bin #(shell-wrapper-contents
75  
-;;                      project bin-name main deps-fileset %)]
76  
-;;       [{:type :bytes
77  
-;;         :path bin-name
78  
-;;         :bytes (.getBytes (read-bin :unix))}
79  
-;;        {:type :bytes
80  
-;;         :path (format "%s.bat" bin-name)
81  
-;;         :bytes (.getBytes (read-bin :windows))}])))
82  
-
83 19
 (def ^:private default-manifest
84 20
   {"Created-By" (str "Leiningen " (main/leiningen-version))
85 21
    "Built-By" (System/getProperty "user.name")
@@ -97,8 +33,6 @@
97 33
      (reduce (partial manifest-entry project)
98 34
              "Manifest-Version: 1.0"
99 35
              (merge default-manifest (:manifest project)
100  
-                    ;; (when (:shell-wrapper project)
101  
-                    ;;   {"Leiningen-shell-wrapper" (shell-wrapper-name project)})
102 36
                     (when-let [main (:main project)]
103 37
                       {"Main-Class" (.replaceAll (str main) "-" "_")})))))))
104 38
 
@@ -175,9 +109,7 @@
175 109
           (if-not (:omit-source project)
176 110
             [{:type :paths :paths (:source-paths project)}
177 111
              {:type :paths :paths (:java-source-paths project)}])
178  
-          (:filespecs project)
179  
-          ;; (shell-wrapper-filespecs project deps-fileset)
180  
-          ))
  112
+          (:filespecs project)))
181 113
 
182 114
 (defn get-jar-filename
183 115
   ([project uberjar?]
40  test/leiningen/test/jar.clj
@@ -19,35 +19,6 @@
19 19
              manifest-map
20 20
              (select-keys ["hello" "Main-Class"])))))
21 21
 
22  
-(deftest ^:post-preview test-shell-wrapper
23  
-  (let [jar-file (JarFile. (jar sample-project))
24  
-        manifest (manifest-map (.getManifest jar-file))
25  
-        bin (slurp (.getInputStream jar-file (.getEntry jar-file "bin/nom")))
26  
-        bin (slurp (.getInputStream jar-file (.getEntry jar-file "bytes.clj")))
27  
-        bat (slurp (.getInputStream jar-file (.getEntry jar-file
28  
-                                                        "bin/nom.bat")))]
29  
-    (is (= "bin/nom" (manifest "Leiningen-shell-wrapper")))
30  
-    (is (= [:bytes "are" 'nomnomnom] (read-string bytes)))
31  
-    (is (re-find #"org/clojure/clojure/1\.1\.0/" bin))
32  
-    (is (re-find #"org\\clojure\\clojure\\1\.1\.0" bat))
33  
-    (is (re-find #"MAIN=\"nom\.nom\.nom\"" bin))
34  
-    (is (re-find #"set MAIN=\"nom\.nom\.nom\"" bat))
35  
-    (is (re-find #"use '\$MAIN\)\(apply -main .command-line-args." bin))
36  
-    (is (re-find #"use '%MAIN%\)\(apply -main .command-line-args." bat))
37  
-    (is (re-find #"\$HOME/\.m2/repository/rome/rome/0\.9/rome-0\.9\.jar" bin))
38  
-    (is (re-find
39  
-         #"%USERPROFILE%\\\.m2\\repository\\rome\\rome\\0\.9\\rome-0\.9\.jar"
40  
-         bat))))
41  
-
42  
-(deftest test-no-bin-jar
43  
-  (let [jar-file (JarFile. (jar (dissoc sample-project :shell-wrapper)))
44  
-        manifest (manifest-map (.getManifest jar-file))]
45  
-    (is (nil? (.getEntry jar-file
46  
-                         "META-INF/maven/nomnomnom/nomnomnom/pom.properties")))
47  
-    (is (nil? (.getEntry jar-file "bin/nom")))
48  
-    (is (nil? (.getEntry jar-file "bin/nom.bat")))
49  
-    (is (nil? (manifest "Leiningen-shell-wrapper")))))
50  
-
51 22
 (deftest test-jar-fails
52 23
   (binding [*err* (java.io.PrintWriter. (platform-nullsink))]
53 24
     (is (thrown? Exception (jar sample-failing-project)))))
@@ -56,17 +27,6 @@
56 27
   (with-out-str
57 28
     (is (jar sample-no-aot-project))))
58 29
 
59  
-(deftest ^:post-preview test-tricky-name
60  
-  (let [jar-file (JarFile. (jar tricky-name-project))
61  
-        manifest (manifest-map (.getManifest jar-file))
62  
-        bin (slurp (.getInputStream
63  
-                    jar-file (.getEntry jar-file "bin/tricky-name")))
64  
-        bat (slurp (.getInputStream
65  
-                    jar-file (.getEntry jar-file "bin/tricky-name.bat")))]
66  
-    (is (= "bin/tricky-name" (manifest "Leiningen-shell-wrapper")))
67  
-    (is (re-find #"org/domain/tricky-name/1\.0/tricky-name-1\.0\.jar" bin))
68  
-    (is (re-find #"\\domain\\tricky-name\\1\.0\\tricky-name-1\.0\.jar" bat))))
69  
-
70 30
 (deftest test-no-deps-jar
71 31
   (let [jar-file (jar (dissoc sample-project :dependencies :main))]
72 32
     (and (is (not (number? jar-file)))
2  test_projects/sample/project.clj
@@ -15,8 +15,6 @@
15 15
                  [ring "1.0.0"]]
16 16
   :main nom.nom.nom
17 17
   :warn-on-reflection true
18  
-  :shell-wrapper {:main nom.nom.nom
19  
-                  :bin "bin/nom"}
20 18
   :jar-exclusions [#"^META-INF"]
21 19
   :filespecs [{:type :fn :fn (fn [p] {:type :bytes :path "bytes.clj"
22 20
                                      :bytes (str "[:bytes \"are\" "
1  test_projects/tricky-name/project.clj
... ...
@@ -1,5 +1,4 @@
1 1
 (defproject org.domain/tricky-name "1.0"
2 2
   :description "One with a tricky group and project name"
3 3
   :dependencies [[org.clojure/clojure "1.3.0"]]
4  
-  :shell-wrapper true
5 4
   :main ^{:skip-aot true} org.domain.tricky-name.core)
5  todo.org
Source Rendered
@@ -5,8 +5,13 @@ See also https://github.com/technomancy/leiningen/issues
5 5
 * For 2.0.0
6 6
 ** 2.0.0-final
7 7
    - [X] Allow trampoline to work with chaining in do task (#665)
  8
+   - [ ] Honor :local-repo in trampoline (#695)
  9
+   - [ ] OOM in repl with lots of output (#691)
  10
+   - [ ] Search indices on Central have moved (#683)
  11
+   - [ ] Store repl port on filesystem (#682)
8 12
    - [ ] Improve speed of trampoline restarts (#573)
9 13
    - [ ] Reduce Aether verbosity (#610)
  14
+   - [ ] Honor hooks/metadata in from plugins (#401)
10 15
    - [ ] Isolate target dir per profile (#468)
11 16
    - [ ] Honor mirror for search indices (#281)
12 17
    - [ ] Drop clojars snapshots from default repos (#241)

0 notes on commit e7dadcd

Please sign in to comment.
Something went wrong with that request. Please try again.