Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Commit 04e634e

Browse files
Merge branch '1.5.x'
2 parents 229bf8f + 93071d8 commit 04e634e

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@
176176
<goals>
177177
<goal>jar</goal>
178178
</goals>
179+
<configuration>
180+
<excludes>
181+
<exclude>clojure/version.properties</exclude>
182+
</excludes>
183+
</configuration>
179184
</execution>
180185
</executions>
181186
</plugin>

src/jvm/clojure/lang/Compile.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public static void main(String[] args) throws IOException{
8787
try
8888
{
8989
out.flush();
90-
out.close();
9190
}
9291
catch(IOException e)
9392
{

test/clojure/test_clojure/compilation.clj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,30 @@
172172

173173
(should-print-err-message #"(?s).*k is not matching primitive.*"
174174
#(loop [k (clojure.test-clojure.compilation/primfn)] (recur :foo))))
175+
176+
#_(deftest CLJ-1154-use-out-after-compile
177+
;; This test creates a dummy file to compile, sets up a dummy
178+
;; compiled output directory, and a dummy output stream, and
179+
;; verifies the stream is still usable after compiling.
180+
(spit "test/dummy.clj" "(ns dummy)")
181+
(try
182+
(let [compile-path (System/getProperty "clojure.compile.path")
183+
tmp (java.io.File. "tmp")
184+
new-out (java.io.OutputStreamWriter. (java.io.ByteArrayOutputStream.))]
185+
(binding [clojure.core/*out* new-out]
186+
(try
187+
(.mkdir tmp)
188+
(System/setProperty "clojure.compile.path" "tmp")
189+
(clojure.lang.Compile/main (into-array ["dummy"]))
190+
(println "this should still work without throwing an exception" )
191+
(finally
192+
(if compile-path
193+
(System/setProperty "clojure.compile.path" compile-path)
194+
(System/clearProperty "clojure.compile.path"))
195+
(doseq [f (.listFiles tmp)]
196+
(.delete f))
197+
(.delete tmp)))))
198+
(finally
199+
(doseq [f (.listFiles (java.io.File. "test"))
200+
:when (re-find #"dummy.clj" (str f))]
201+
(.delete f)))))

0 commit comments

Comments
 (0)