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

It should not be necessary to use -Sdeps to reference a third-party template #55

Closed
hlship opened this issue Jan 9, 2024 · 3 comments
Closed
Assignees
Labels
analysis needed Needs more design time enhancement New feature or request

Comments

@hlship
Copy link

hlship commented Jan 9, 2024

Currently, you must specify using -Sdeps a literal chunk of dependencies so that deps-new can find your template.edn (based on the :template from the command line).

As a user, I would expect deps-new to be able to work directly from the template, expecting the template to match a Maven artifact. deps-new should be able to build a basis directly from that (after somehow figuring out the correct :mvn/version) and build a classpath from that basis.

@seancorfield seancorfield added enhancement New feature or request analysis needed Needs more design time labels Jan 10, 2024
@seancorfield seancorfield self-assigned this Jan 10, 2024
@seancorfield seancorfield changed the title It should not be necessary to use -Sdeps to reference a third-party template that's available from a Maven repository It should not be necessary to use -Sdeps to reference a third-party template Jan 10, 2024
@seancorfield
Copy link
Owner

I've updated the summary to remove the Maven reference since deps-new doesn't support that -- only local- and git- templates -- but the current invocation syntax is "horrible" and we can do better.

tools.deps includes code to infer :git/url and tools.gitlibs includes code to resolve branch names and tags to actual SHAs, so between those two, deps-new should be able to get close to something like io.github.orgname/some-repo with a default name assumed for the template itself within that repo, which can be overridden.

Syntax for the "template name" needs to include ways to supply:

  • a way to infer the :git/url
  • a way to infer/override the path to template.edn in the repo
  • a way to specify :deps/root if needed
  • a way to specify particular versions/tags/SHAs if needed

seancorfield added a commit that referenced this issue Jan 10, 2024
Signed-off-by: Sean Corfield <sean@corfield.org>
@seancorfield
Copy link
Owner

The commit unconditionally requires Clojure 1.12 in order to do the dynamic addition of dependencies via clojure.repl.deps/add-lib. The code needs to be cleaned up to still work with Clojure 1.11 (without the dynamic addition), and documentation added to the README to explain how to force the tool to run with 1.12.

See also https://clojure.atlassian.net/jira/software/c/projects/TDEPS/issues/TDEPS-258 -- if that is fixed, then deps-new could depend directly on 1.12 and not need the workaround (or the changes to still work with 1.11) but it's not clear when that will get fixed.

@seancorfield
Copy link
Owner

I'm considering this addressed in v0.7.0 which I just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis needed Needs more design time enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants