From 702d3cb1c8774b4292482843010c5a9e7b45b557 Mon Sep 17 00:00:00 2001 From: Crispin Wellington Date: Wed, 4 Dec 2019 21:03:28 +0800 Subject: [PATCH] keep reflection and use reflection config instead. --- graal-configs/reflect-config.json | 5 +++++ src/bootleg/core.clj | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/graal-configs/reflect-config.json b/graal-configs/reflect-config.json index 3beef05..f0f8faa 100644 --- a/graal-configs/reflect-config.json +++ b/graal-configs/reflect-config.json @@ -36,6 +36,11 @@ "allDeclaredMethods": true, "allPublicMethods": true }, + { + "name":"java.io.BufferedWriter", + "allDeclaredMethods": true, + "allPublicMethods": true + }, { "name":"java.io.OutputStreamWriter", "allDeclaredMethods": true, diff --git a/src/bootleg/core.clj b/src/bootleg/core.clj index f58a5a8..b385edd 100644 --- a/src/bootleg/core.clj +++ b/src/bootleg/core.clj @@ -7,7 +7,6 @@ [clojure.tools.cli :refer [parse-opts]] [clojure.string :as string] [clojure.java.io :as io]) - (:import [java.io BufferedWriter]) (:gen-class)) (def version (utils/embed ".meta/VERSION")) @@ -44,11 +43,11 @@ (try (if (:data options) (-> result (utils/pprint {:writer out})) - (->> result utils/as-html (.write ^BufferedWriter out))) + (->> result utils/as-html (.write out))) (finally (if (:output options) - (.close ^BufferedWriter out) - (.flush ^BufferedWriter out)))))) + (.close out) + (.flush out)))))) (defn -main "main entry point for site generation"