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

Release 2.0.224 #55

Merged
merged 4 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ A Clojure [tools.build](https://github.com/clojure/tools.build) task library for

It also provides the ability to check your (Apache-2.0 licensed) project against the [Apache Software Foundation's 3rd Party License Policy](https://www.apache.org/legal/resolved.html).

`tools-licenses` is little more than a pretty output wrapper around the build-tool-agnostic [`lice-comb` library](https://github.com/pmonks/lice-comb).
Note: `tools-licenses` assumes a "flat" project organisational structure, where each project is defined by a directory containing a `deps.edn` file, and all of it's sub-directories. This may or may not work well with monolithic development models (such as [Polylith](https://polylith.gitbook.io/polylith)), where all source code is managed out of a single, large, deeply-nested directory structure. That said, `tools-licenses` will do _something_, but whether that thing is what you're expecting and/or useful is quite another matter.

## Disclaimer

**The author and contributors to `tools-licenses` are not lawyers, and neither they nor `tools-licenses` itself provide legal advice. This is simply a tool that might help you and your legal counsel perform licensing due diligence on your projects.**
**The author and contributors to `tools-licenses` are not lawyers, and neither they nor `tools-licenses` itself provide legal advice. This is simply a tool that might help you and your legal counsel perform licensing due diligence on your projects.** If you need a primer on the legal aspects of open source software, the author has found the [Blue Oak Council](https://blueoakcouncil.org/) to be a useful resource.

## System Requirements

Expand Down
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
{:deps
{jansi-clj/jansi-clj {:mvn/version "1.0.3"}
com.github.pmonks/clj-wcwidth {:mvn/version "1.0.85"}
com.github.pmonks/lice-comb {:mvn/version "2.0.284"}
com.github.pmonks/asf-cat {:mvn/version "2.0.133"}
com.github.pmonks/lice-comb {:mvn/version "2.0.292"}
com.github.pmonks/asf-cat {:mvn/version "2.0.135"}
com.github.pmonks/tools-convenience {:mvn/version "1.0.151"}}
:aliases
{:build {:deps {com.github.pmonks/pbr {:mvn/version "RELEASE"}
Expand Down
18 changes: 9 additions & 9 deletions src/tools_licenses/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
(ansi/install!)

(defn- prep-project
"Prepares the project and returns the lib-map for it."
"Prepares the project and returns a tuple of [basis lib-map] for it."
[]
(let [basis (b/create-basis {})
lib-map (d/resolve-deps basis {})
_ (d/prep-libs! lib-map {:action :prep :log :info} {})] ; Make sure everything is "prepped" (downloaded locally) before we start looking for licenses
lib-map))
[basis lib-map]))

(defn- human-readable-expression-internal
"Recursive portion of the implementation of human-readable-expression."
Expand Down Expand Up @@ -229,12 +229,12 @@
Note: has the side effect of 'prepping' your project with its transitive
dependencies (i.e. downloading them if they haven't already been downloaded)."
[opts]
(let [lib-map (prep-project)
output-type (get opts :output :summary)
local-repo (:mvn/local-repo lib-map)
_ (when-not (s/blank? local-repo) (lcmvn/set-local-maven-repo! local-repo))
remote-repos (:mvn/repos lib-map)
_ (when-not (empty? remote-repos) (lcmvn/set-remote-maven-repos! (merge lcmvn/default-remote-maven-repos (lcim/mapfonv :url remote-repos))))]
(let [[basis lib-map] (prep-project)
output-type (get opts :output :summary)
local-repo (:mvn/local-repo basis)
_ (when-not (s/blank? local-repo) (lcmvn/set-local-maven-repo! local-repo))
remote-repos (:mvn/repos basis)
_ (when-not (empty? remote-repos) (lcmvn/set-remote-maven-repos! (merge lcmvn/default-remote-maven-repos (lcim/mapfonv :url remote-repos))))]
(if (= :explain output-type)
; Handle :output :explain separately, as it only needs license info for a single dependency, not all of them
(let [dep-ga (get opts :dep)
Expand Down Expand Up @@ -275,7 +275,7 @@
Note: has the side effect of 'prepping' your project with its transitive
dependencies (i.e. downloading them if they haven't already been downloaded)."
[opts]
(let [lib-map (prep-project)
(let [[_ lib-map] (prep-project)
proj-licenses (distinct (mapcat #(sexp/extract-ids (sexp/parse %)) (lcf/dir->expressions ".")))
lib-map-with-license-info (lcd/deps-expressions lib-map)
dep-licenses-by-category (group-by #(let [expressions (seq (keys (:lice-comb/license-info (val %))))]
Expand Down