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

Add cabal multi cradle #76

Merged
merged 1 commit into from
Oct 27, 2019
Merged

Add cabal multi cradle #76

merged 1 commit into from
Oct 27, 2019

Conversation

mpickering
Copy link
Collaborator

This new cradle type allows you to easily specify all the different parts of a cabal project without
lots of boilerplate.

cradle:
  cabal:
    - path: "./src"
      component: "lib:hie-bios"
    - path: "./test"
      component: "test"

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

In the readme, you describe an even more complex hie.yaml specification. Should we add an additional test for it? Especially whether the reduction works?
Also,what happens on overlap? E. g. Paths in multicradle overlap with paths from cabal multi cradle?
Maybe this is a more general question, in nested multi cradles, is the behavior: global best match or greedy local best matches?

@mpickering
Copy link
Collaborator Author

I will add a test as I didn't even try the cradle after writing it.

If there are nested multi-cradles then at each nesting level the most specific path is chosen. They are not flattened together.

@fendor
Copy link
Collaborator

fendor commented Oct 18, 2019

If there are nested multi-cradles then at each nesting level the most specific path is chosen. They are not flattened together.

Ok, that is the better behaviour imo as well, but we should document it somewhere.
Other than that, it looks good to me, but I have yet to test the pr myself.

The cabal multi-cradle is a shorthand for specifying a multi-cradle
where all the components are managed by cabal.
@mpickering
Copy link
Collaborator Author

I added the test and some more documentation as you suggested.

@fendor fendor self-requested a review October 25, 2019 12:48
@fendor
Copy link
Collaborator

fendor commented Oct 25, 2019

We need more tests. Simple tests that could be nice for multi-cradles:
Given a hie.yaml specification and a filepath to some project, what cradle would be used for the file.

@fendor fendor merged commit cb43d12 into master Oct 27, 2019
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