-
Notifications
You must be signed in to change notification settings - Fork 950
Use publishTo value when it is defined. #4931
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
Conversation
Ping @dwijnand |
I'll rebase to the correct branch |
713a8e1
to
ce118f8
Compare
Even with `publishArtifact := false` the user is still forced to define a (dummy) resolver that's never used, e.g. `publishTo := { Some("publishMeNot" at "https://publish/me/not") }` Otherwise the following error is thrown: ``` publish [error] java.lang.RuntimeException: Repository for publishing is not specified. [error] at scala.sys.package$.error(package.scala:27) [error] at sbt.Classpaths$.$anonfun$getPublishTo$1(Defaults.scala:2436) [error] at scala.Option.getOrElse(Option.scala:121) [error] at sbt.Classpaths$.getPublishTo(Defaults.scala:2436) [error] at sbt.Classpaths$.$anonfun$ivyBaseSettings$48(Defaults.scala:1917) ```
The travis failure is from MIMA:
|
Yeah, you need to create new method. |
ce118f8
to
51a41e1
Compare
done, needs new review and approval |
…g repository if publishArtifact is false
51a41e1
to
9160908
Compare
if (publishArtifact.value) getPublishTo(publishToOption).name else "local" | ||
}, | ||
checksums.in(publish).value.toVector, | ||
getPublishTo(publishTo.value, publishArtifact.value).name, // error if publishTo is None and publishArtifact is true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish / skip
might be better. See discussion here - #3136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... I don't mind the new solutoin, but in any case the current code on lines 2342-2344 is clearly a bug and should be replaced soon with some sane alternative.
How about just merging this PR and then working the publish / skip into it as #3136 gets implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish / skip was implemented here - #3380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you mean that instead of publishArtifact.value
we should have here (skip in publish).value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should be !(skip in publish).value
, since you could have published artifacts even if unscoped publishArtifact.value
returns false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if a better fix would be to just revert #3760
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responded on #3760 (comment) - sounds like reverting that one is the way to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3760 is what broke our build so if that is reverted, all is fine for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eed3si9n is it certain that if skip in publish
is true, then nobody depends on the publishConfiguration
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish, publishLocal, publishSigned, and sbt-bintray respect the skip in publish, so that should cover the relevant party.
Closing this in favor of #4934 |
Don't give error about missing repository if publishArtifact is false