Skip to content

Commit

Permalink
Adding version support and fixing ssl following oracle/graal#1336
Browse files Browse the repository at this point in the history
  • Loading branch information
ronen committed Sep 29, 2019
1 parent 05cda8e commit 166affe
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(:require
[clojure.repl :refer :all]
[clojure.tools.namespace.repl :refer (refresh refresh-all)]
[tmuxificator.core :refer :all]))
tmx.core))

2 changes: 2 additions & 0 deletions java.security.overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# security.provider.3=org.bouncycaste.jce.provider.BouncyCastleProvider
security.provider.3=bcprov
19 changes: 13 additions & 6 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
[org.clojure/tools.reader "1.3.2"]

[com.taoensso/timbre "4.10.0"]

[org.martinklepsch/clj-http-lite "0.4.1"]
[org.clojure/data.json "0.2.6"]

[org.bouncycastle/bcprov-jdk15on "1.61"]
[org.bouncycastle/bctls-jdk15on "1.61"]
]

:plugins [
Expand Down Expand Up @@ -55,12 +61,13 @@
:native-image {
:name "tmx"
:graal-bin "/opt/graalvm-ce-19.2.0.1/bin/native-image"
:opts ["-H:EnableURLProtocols=http"
"--report-unsupported-elements-at-runtime"
"--enable-https"
"--initialize-at-build-time"
"--verbose"
"--no-fallback"]
:opts [
"--no-server"
"--report-unsupported-elements-at-runtime"
"--initialize-at-build-time"
"-J-Djava.security.properties=java.security.overrides"
"-H:EnableURLProtocols=https"
"--verbose"]
}

:main ^:skip-aot tmx.core
Expand Down
13 changes: 13 additions & 0 deletions src/tmx/core.clj
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
(ns tmx.core
(:gen-class)
(:require
[clojure.data.json :as json]
[clj-http.lite.client :as client]
[clojure.java.io :as io]
[clojure.edn :as edn]
[clojure.core.strint :refer (<<)]
[clojure.java.shell :refer (sh)]))

(defn tags [user repo]
(json/read-str
(:body (client/get (<< "https://api.github.com/repos/~{user}/~{repo}/tags"))) :key-fn keyword))

(defn version []
(let [current "0.1.0" last-version (:name (last (sort-by :name (tags "narkisr" "tmx"))))]
(if-not (= current last-version)
(println (<< "tmx version is ~{current} the latest version is ~{last-version} please upgrade"))
(println "tmx" current))))

(defn stderr [e]
(binding [*out* *err*]
(println e)))
Expand Down Expand Up @@ -47,6 +59,7 @@ Usage:
(try
(case (first args)
"start" (launch (second args))
"version" (version)
"help" (help)
nil (help))
(catch Exception e
Expand Down

0 comments on commit 166affe

Please sign in to comment.