Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix library jar #13

Merged
merged 2 commits into from
Jan 19, 2021
Merged

Fix library jar #13

merged 2 commits into from
Jan 19, 2021

Conversation

totakke
Copy link
Member

@totakke totakke commented Jan 18, 2021

I have fixed a mistake that a uberjar was deployed to Clojars.

before:

$ clj -Adepstar
$ jar -tf cruler.jar
dynapath/
dynapath/util$add_classpath_url.class
dynapath/util$fn__1536.class
dynapath/dynamic_classpath__init.class
dynapath/dynamic_classpath$fn__1514.class
dynapath/dynamic_classpath$fn__1501$G__1474__1508.class
dynapath/util$addable_classpath_QMARK_.class
dynapath/dynamic_classpath$fn__1476.class
  ...
org/apache/commons/lang3/builder/EqualsBuilder.class
org/apache/commons/lang3/builder/DiffBuilder$16.class
META-INF/MANIFEST.MF
META-INF/maven/xcoo/
META-INF/maven/xcoo/cruler/
META-INF/maven/xcoo/cruler/pom.properties
META-INF/maven/xcoo/cruler/pom.xml

after:

$ clojure -X:depstar jar :jar cruler.jar
$ jar -tf cruler.jar
cruler/
cruler/validators.clj
cruler/log.clj
cruler/classpath.clj
cruler/spec_parser.clj
cruler/report.clj
cruler/core.clj
cruler/parser.clj
cruler/main.clj
cruler/config.clj
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/xcoo/
META-INF/maven/xcoo/cruler/
META-INF/maven/xcoo/cruler/pom.properties
META-INF/maven/xcoo/cruler/pom.xml

This PR will fix the dependency problem in #12.

Copy link
Member

@blue0513 blue0513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. LGTM

@@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
run: clj -Adepstar
run: clojure -X:depstar jar :jar cruler.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a (library) jar by invoking depstar with the desired jar name:
clojure -X:depstar jar :jar MyLib.jar
https://github.com/seancorfield/depstar#basic-usage 👍

@@ -1,7 +1,7 @@
FROM clojure:openjdk-11-tools-deps as builder
WORKDIR /cruler
COPY . /cruler
RUN clojure -Adepstar
RUN clojure -X:depstar uberjar :jar cruler.jar :aot true :main-class cruler.main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build the uberjar with AOT compilation
clojure -X:depstar uberjar :jar MyProject.jar :aot true :main-class project.core
https://github.com/seancorfield/depstar#aot-compilation 👍

"-S" "-C" "-m" "cruler.main"]}
:depstar {:extra-deps {seancorfield/depstar {:mvn/version "2.0.165"}}
:ns-default hf.depstar
:exec-args {}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blue0513 blue0513 merged commit e41f3da into main Jan 19, 2021
@totakke totakke deleted the fix/libjar branch January 20, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants