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

Allow customizing defaultConfMapping in InlineConfiguration #30

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dansanduleac
Copy link
Contributor

The defaultConfMapping in ivy is currently hard-coded to *->default(compile). This works well for most purposes, but I have a use case where it falls short.

Say I want to have a flag that, when enabled, requires users to list all their compile dependencies explicitly. Everything they depend on + their transitive dependencies will end up in the runtime scope, but compile will only contain packages explicitly listed as dependencies.
This is what some call the include-what-you-use principle, and it's useful to prevent you from using code from a transitive dependency B, in case your dependency A that depended on B stops depending on B later on, and subsequently causes your code to not compile anymore, even though you haven't made any changes to it.

Let's say I build all my packages to export an only-me configuration, that contains only the artifacts published, but no dependencies. Now, when I activate this flag, it would be a pain to have to change all the dependencies in that project from

  • no dependency mapping at all, or
  • compile

to compile->only-me(default).

But if we can modify the defaultConfMapping, we'd just set that to *->only-me(default), and this would do what you want without having to parse the configuration mapping of each dependency and mangle it programmatically.

@dansanduleac
Copy link
Contributor Author

The test failure is unrelated, other 3 test suites completed fine:

:::: WARNINGS
        [FAILED     ] org.scala-lang#scala-compiler;2.10.5!scala-compiler.jar: Downloaded file size doesn't match expected Content Length for https://jcenter.bintray.com/org/scala-lang/scala-compiler/2.10.5/scala-compiler-2.10.5.jar. Please retry. (17889ms)

@dansanduleac
Copy link
Contributor Author

Could someone look at this please? :)

@eed3si9n
Copy link
Member

eed3si9n commented Jun 4, 2016

I think this feature would make the documentation of librarymanagement module more difficult. Isn't this something that could be implemented at the plugin layer? I might be open to more general ModuleID => ModuleID transformer, but this feels too specific to Ivy.

@jvican
Copy link
Member

jvican commented Apr 26, 2017

Were you ever able to use the include what you use principle without this fix @dansanduleac ?

@dwijnand dwijnand changed the base branch from 1.0 to 1.x July 17, 2017 15:12
@dwijnand
Copy link
Member

dwijnand commented Jun 1, 2018

Where do we stand on this PR?

@eed3si9n if this can't be implemented with a plugin, do you still feel like you'd rather this were implemented with a ModuleID => Module function?

@dansanduleac are you still interested in landing this PR? Looks like there are conflicts with the target branch, are those hard to resolve? What do you think about Eugene's plugin idea? Or implementing this with a transforming function?

@eed3si9n eed3si9n changed the base branch from 1.x to develop August 30, 2018 15:21
@eed3si9n eed3si9n added the uncategorized Used for Waffle integration label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
uncategorized Used for Waffle integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants