-
Notifications
You must be signed in to change notification settings - Fork 931
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
Handle source, docs artifacts correctly for Ivy [1.0.x] #2475
Conversation
…ks in conjunction with ArtifactTypeFilter
…w conflicts with sbt.Keys.. Thanks Scala
Hi @dansanduleac, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Typesafe Contributors License Agreement: |
This PR is not from @dansanduleac, it's from @oxbowlakes. I believe that we've already signed the typesafe CLA |
Yea you guys should be fine. |
Looks like this needs to wait on sbt/zinc#70, and then subsequently on further changes that would get this project to compile cleanly against |
I think this is superseded by #2478. Thanks @oxbowlakes & @dansanduleac! |
This is a re-installment of #1016 for the 1.0.x branch, sitting on top of changes already merged in sbt/librarymanagement#25.
To reiterate, specifically in this PR we are addressing the following:
sourceArtifactTypes
anddocArtifactTypes
: Sets which contain the artifact types that would qualify them as either source or doc artifacts.ArtifactTypeFilter
introduced in Handle source, docs artifacts correctly for Ivy librarymanagement#25 in theupdate
task (specifically, I added it toUpdateConfiguration
) to allow "all artifact types except those found in eithersourceArtifactTypes
ordocArtifactTypes
"updateClassifiers
/updateSbtClassifiers
, invert the filter from theUpdateConfiguration
: it will therefore only let through sources and docssrcTypes
anddocTypes
now have to also be explicitly passed intoGetClassifiersConfiguration
because (since Handle source, docs artifacts correctly for Ivy librarymanagement#25) after finishing the update inupdateClassifiers
, it will map over all artifacts to set their classifier to eithersources
orjavadoc
, if it's not already set, according to a reverse mapping from the(src|doc)Types
to "source" and "javadoc" respectively (well,Artifact.SourceClassifier
andArtifact.DocClassifier
, to be precise). This is because the artifacts retrieved from Ivy publications might well not have this attribute set, and last time I checked, IDE plugins such as IntelliJ's depended exactly on this value to classify the artifacts.Hopefully, after this, plugins could just look at the artifact's type and see in which of the two sets contains it. That would also resolve a great deal of pain surrounding "e:classifier". For instance, I've discovered that it's impossible to use that attribute in an ivy repository if its value is not either "sources" or "javadoc" (e.g. if it's src), because plugins expect it to be one of those two values as mentioned before.