Skip to content

Commit

Permalink
Merge pull request #600 from j-mie6/597-dependency-submission-include…
Browse files Browse the repository at this point in the history
…s-spurious-dependencies

Added binary versions to `module-ignore` inputs matching the requirements of the flag.
  • Loading branch information
j-mie6 authored Jul 9, 2023
2 parents 4b8260c + 2a971e1 commit 6eeaf48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ jobs:
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: sbt-typelevelJVM docs sbt-typelevelNative sbt-typelevel sbt-typelevelJS
modules-ignore: sbt-typelevelJVM_2.12 docs_2.12 sbt-typelevelNative_2.12 sbt-typelevelJS_2.12
configs-ignore: test scala-tool scala-doc-tool

validate-steward:
Expand Down
4 changes: 2 additions & 2 deletions ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.sbt

import org.typelevel.sbt.NoPublishGlobalPlugin.autoImport._
import org.typelevel.sbt.NoPublishGlobalPlugin.noPublishModulesIgnore
import org.typelevel.sbt.gha.GenerativePlugin
import org.typelevel.sbt.gha.GenerativePlugin.autoImport._
import org.typelevel.sbt.gha.GitHubActionsPlugin
Expand Down Expand Up @@ -148,7 +148,7 @@ object TypelevelCiPlugin extends AutoPlugin {
steps = githubWorkflowJobSetup.value.toList :+
WorkflowStep.DependencySubmission(
None,
Some(noPublishProjectRefs.value.toList.map(_.project)),
Some(noPublishModulesIgnore.value.toList),
Some(List("test", "scala-tool", "scala-doc-tool")),
None
),
Expand Down
23 changes: 11 additions & 12 deletions no-publish/src/main/scala/org/typelevel/sbt/NoPublishPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.typelevel.sbt
import sbt._

import Keys._
import NoPublishGlobalPlugin.noPublishInternalAggregation
import NoPublishGlobalPlugin.noPublishModulesIgnore

object NoPublishPlugin extends AutoPlugin {

Expand All @@ -30,7 +30,13 @@ object NoPublishPlugin extends AutoPlugin {
publishLocal := {},
publishArtifact := false,
publish / skip := true,
Global / noPublishInternalAggregation += thisProjectRef.value
Global / noPublishModulesIgnore ++= crossScalaVersions.value.flatMap { v =>
// the binary versions are needed for the modules-ignore in Submit Dependencies
// it's best to pick them up here instead of guessing in the CI plugin
CrossVersion(crossVersion.value, v, CrossVersion.binaryScalaVersion(v)).map { cross =>
cross(thisProjectRef.value.project)
}
}
)
}

Expand All @@ -39,18 +45,11 @@ object NoPublishGlobalPlugin extends AutoPlugin {
// triggered even if NoPublishPlugin is not used in the build
override def trigger = allRequirements

object autoImport {
lazy val noPublishProjectRefs = settingKey[Seq[ProjectRef]]("List of no-publish projects")
}

import autoImport._

private[sbt] lazy val noPublishInternalAggregation =
settingKey[Seq[ProjectRef]]("Aggregates all the no-publish projects")
private[sbt] lazy val noPublishModulesIgnore =
settingKey[Seq[String]]("List of no-publish projects and their scala cross-versions")

override def globalSettings = Seq(
noPublishInternalAggregation := Seq(),
noPublishProjectRefs := noPublishInternalAggregation.value
noPublishModulesIgnore := Seq()
)

}

0 comments on commit 6eeaf48

Please sign in to comment.