Skip to content

Commit

Permalink
Seperate dependencies, bump version number, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
djha-skin committed Jun 22, 2020
1 parent 039edba commit d97c190
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 53 deletions.
20 changes: 20 additions & 0 deletions build-native-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

# --initialize-at-run-time=org.postgresql.sspi.SSPIClient
# --initialize-at-run-time=java.lang.Math\$RandomNumberGeneratorHolder \
# -J-Dclojure.compiler.direct-linking=true \
# -J-Dclojure.spec.skip-macros=true \
# -J-Xmx4G \
# -H:+JNI
native-image \
--enable-url-protocols=file,https,http \
--report-unsupported-elements-at-runtime \
--no-fallback \
--no-server \
--enable-all-security-services \
--initialize-at-build-time \
--verbose \
--static \
-H:+ReportExceptionStackTraces \
-H:Name="onecli" \
-jar target/uberjar/onecli-0.6.0-SNAPSHOT-standalone.jar
18 changes: 18 additions & 0 deletions src/degasolv/cli.clj → cli-src/degasolv/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
[serovers.core :as vers])
(:gen-class))

(defmethod
print-method
degasolv.resolver.PackageInfo
[this w]
(tag/pr-tagged-record-on this w))

(defmethod
print-method
degasolv.resolver.VersionPredicate
[this w]
(tag/pr-tagged-record-on this w))

(defmethod
print-method
degasolv.resolver.Requirement
[this w]
(tag/pr-tagged-record-on this w))

(defn- exit [status msg]
(.println ^java.io.PrintWriter *err* msg)
(System/exit status))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ and this project adheres to `Semantic Versioning`_.
Added
+++++

* Separated CLI uberjar from library jar, both dependencies and source.
Now degasolv can be included as a dependency and its resolver used elsewhere.

* Added capability to build using graalvm, allowing for statically compiled
builds

Changed
+++++++

Expand Down
81 changes: 48 additions & 33 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
(defproject degasolv/degasolv "2.2.0"
(defproject degasolv/degasolv "2.3.0-SNAPSHOT"
:description "Democratize dependency management."
:url "http://github.com/djhaskin987/degasolv"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main degasolv.cli
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
:username :env/clojars_username
:password :env/clojars_password
:sign-releases false}]]

:dependencies [
;; ordered set for version suggestion
[org.flatland/ordered "1.5.7"]
;; optional dependencies to clj-http
[cheshire "5.9.0"]
;;[org.clojure/tools.reader "1.3.2"]
;;[crouton "0.1.2"]
;;[ring/ring-codec "1.1.2"]
;;[
[clj-http "3.10.0"]
[com.velisco/tagged "0.5.0"]
[org.clojure/clojure "1.10.1"]
[org.clojure/tools.cli "0.3.5"]
[serovers "1.6.2"]
[org.clojure/clojure "1.10.2-alpha1"]
[org.flatland/ordered "1.5.9"]
[org.martinklepsch/clj-http-lite "0.4.3"]
]
:plugins [[lein-licenses "0.2.2"]
[lein-print "0.1.0"]]

:java-source-paths ["src/java"
"test/java"]
:junit ["test/java"]
;;:source-paths ["src/degasolv"]
:source-paths ["src"]

:global-vars {*warn-on-reflection* true}

Expand All @@ -36,32 +30,53 @@
:profiles {
:dev {
:dependencies [
;; extra deps
[clj-wiremock "0.3.0"]
[pjstadig/humane-test-output "0.9.0"]
;; ordered set for version suggestion
[org.flatland/ordered "1.5.7"]
[org.clojure/core.match "0.3.0-alpha5"]
[org.clojure/clojure "1.10.1"]
[serovers "1.6.2"]
[org.clojure/tools.cli "0.3.5"]
[com.velisco/tagged "0.5.0"]
;; optional dependencies to clj-http
;; normal deps
[org.clojure/clojure "1.10.2-alpha1"]
[org.flatland/ordered "1.5.9"]
[org.martinklepsch/clj-http-lite "0.4.3"]
;; cli deps
[cheshire "5.9.0"]
[com.velisco/tagged "0.5.0"]
[org.clojure/tools.cli "0.3.5"]
[serovers "1.6.2"]
]
:plugins [[test2junit "1.3.3"]]
:plugins [[test2junit "1.4.2"]]
:test2junit-output-dir "target/test-results"
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
}
:uberjar {:aot [
degasolv.pkgsys.core
degasolv.pkgsys.apt
degasolv.pkgsys.subproc
degasolv.pkgsys.git
degasolv.util
degasolv.resolver
degasolv.cli
]}
:uberjar {:aot :all
;; old aot list
;; [
;; degasolv.pkgsys.core
;; degasolv.pkgsys.apt
;; degasolv.pkgsys.subproc
;; degasolv.pkgsys.git
;; degasolv.util
;; degasolv.resolver
;; degasolv.cli
;; ]
:main degasolv.cli
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:source-paths ["src" "cli-src"]
:dependencies [
;; normal deps
[org.clojure/clojure "1.10.2-alpha1"]
[org.flatland/ordered "1.5.9"]
[org.martinklepsch/clj-http-lite "0.4.3"]
;; cli deps
[cheshire "5.9.0"]
[com.velisco/tagged "0.5.0"]
[org.clojure/tools.cli "0.3.5"]
[serovers "1.6.2"]
;; uberjar deps
[borkdude/clj-reflector-graal-java11-fix "0.0.1-graalvm-20.1.0"]
]
}
}
:target-path "target/%s/"
)
1 change: 0 additions & 1 deletion src/degasolv/resolver.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.string :as clj-str]
[miner.tagged :as tag]
[flatland.ordered.set :as memset]))

(defmacro dbg [body]
Expand Down
18 changes: 0 additions & 18 deletions src/degasolv/resolver_core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,6 @@

(defrecord PackageInfo [id version location requirements])

(defmethod
print-method
degasolv.resolver.PackageInfo
[this w]
(tag/pr-tagged-record-on this w))

(defmethod
print-method
degasolv.resolver.VersionPredicate
[this w]
(tag/pr-tagged-record-on this w))

(defmethod
print-method
degasolv.resolver.Requirement
[this w]
(tag/pr-tagged-record-on this w))

(defn present
([id] (present id nil))
([id spec] (->Requirement :present id spec)))
Expand Down
2 changes: 1 addition & 1 deletion src/degasolv/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require [clojure.java.io :as io]
[clojure.java.io :as io]
[clojure.pprint :as pprint]
[clj-http.client :as client]))
[clj-http.lite.client :as client]))

; UTF-8 by default :)
(defn base-slurp [loc]
Expand Down

0 comments on commit d97c190

Please sign in to comment.