Skip to content

Commit

Permalink
Added error for attempted ivy-style publication
Browse files Browse the repository at this point in the history
  • Loading branch information
djspiewak committed Mar 3, 2020
1 parent e64d8e9 commit 1cac930
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sbt-github-packages [![Build Status](https://travis-ci.com/djspiewak/sbt-github-packages.svg?branch=master)](https://travis-ci.com/djspiewak/sbt-github-packages)

Configures your project for publication to the [GitHub Package Registry](https://help.github.com/en/articles/about-github-package-registry) using its Apache Maven support. Note that you probably shouldn't use this with plugins, only libraries. Also provides some convenience functionality for *depending* upon artifacts which have been published to the Package Registry.
Configures your project for publication to the [GitHub Package Registry](https://help.github.com/en/articles/about-github-package-registry) using its Apache Maven support. Note that GitHub Packages *exclusively* supports maven-style publication; using Ivy style will result in a warning. Also provides some convenience functionality for *depending* upon artifacts which have been published to the Package Registry.

## Usage

Expand Down
7 changes: 7 additions & 0 deletions src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ object GitHubPackagesPlugin extends AutoPlugin {
val packagePublishSettings = Seq(
publishTo := {
val log = streams.value.log
val ms = publishMavenStyle.value
val back = for {
owner <- githubOwner.?.value
repo <- githubRepository.?.value
} yield "GitHub Package Registry" at s"https://maven.pkg.github.com/$owner/$repo"

back foreach { _ =>
if (!ms) {
sys.error("GitHub Packages does not support Ivy-style publication")
}
}

back orElse {
GitHubPackagesPlugin synchronized {
if (!alreadyWarned) {
Expand Down

0 comments on commit 1cac930

Please sign in to comment.