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

Support aliases in paths #230

Closed
tengstrand opened this issue May 31, 2022 · 3 comments
Closed

Support aliases in paths #230

tengstrand opened this issue May 31, 2022 · 3 comments
Assignees
Labels
improvement Not a bug but an improvement to overall user experience

Comments

@tengstrand
Copy link
Collaborator

See aliases.

@tengstrand tengstrand self-assigned this May 31, 2022
@tengstrand tengstrand added the improvement Not a bug but an improvement to overall user experience label May 31, 2022
@seancorfield
Copy link
Contributor

While this may not be a very necessary feature for Polylith since :paths and :extra-paths aren't likely to be anything unusual, this is something supported by core tools.deps.alpha code, and Polylith should not prevent it from being used/working.

Right now, if you try to use aliases in paths -- per Clojure CLI documentation -- Polylith throws an exception:

#error {
 :cause {:paths [["should be a string"]]}
 :via
 [{:type java.lang.Exception
   :message {:paths [["should be a string"]]}
   :at [polylith.clj.core.workspace_clj.config_from_disk$read_config_file invokeStatic config_from_disk.clj 24]}]
 :trace
 [[polylith.clj.core.workspace_clj.config_from_disk$read_config_file invokeStatic config_from_disk.clj 24]
  [polylith.clj.core.workspace_clj.config_from_disk$read_config_file invoke config_from_disk.clj 14]
  [polylith.clj.core.workspace_clj.components_from_disk$read_component invokeStatic components_from_disk.clj 20]
  [polylith.clj.core.workspace_clj.components_from_disk$read_component invoke components_from_disk.clj 11]
  [polylith.clj.core.workspace_clj.components_from_disk$read_components$fn__30240 invoke components_from_disk.clj 34]

Both calc-basis and make-classpath-map do the unrolling of aliases in paths automatically.

@tengstrand
Copy link
Collaborator Author

I didn't manage to solve the problem with calc-basis so I simple substituted the paths myself (it's not much code). Please have a look @seancorfield.

@seancorfield
Copy link
Contributor

I'm not sure what are all the possible combinations in tools.deps.alpha but that PR looks like it covers the basics so it'll be good enough for now. I didn't realize you weren't using t.d.a for handling everything in the deps.edn file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug but an improvement to overall user experience
Projects
None yet
Development

No branches or pull requests

2 participants