diff --git a/ci/src/main/scala/org/typelevel/sbt/CrossRootProject.scala b/ci/src/main/scala/org/typelevel/sbt/CrossRootProject.scala index d9362bcf..2e8bfa05 100644 --- a/ci/src/main/scala/org/typelevel/sbt/CrossRootProject.scala +++ b/ci/src/main/scala/org/typelevel/sbt/CrossRootProject.scala @@ -24,44 +24,44 @@ import org.typelevel.sbt.gha.GenerativePlugin.autoImport._ * automatically enables the `NoPublishPlugin`. */ final class CrossRootProject private ( - val root: Project, - val rootJVM: Project, - val rootJS: Project, - val rootNative: Project + val all: Project, + val jvm: Project, + val js: Project, + val native: Project ) extends CompositeProject { - override def componentProjects: Seq[Project] = Seq(root, rootJVM, rootJS, rootNative) + override def componentProjects: Seq[Project] = Seq(all, jvm, js, native) def settings(ss: Def.SettingsDefinition*): CrossRootProject = new CrossRootProject( - root.settings(ss: _*), - rootJVM.settings(ss: _*), - rootJS.settings(ss: _*), - rootNative.settings(ss: _*) + all.settings(ss: _*), + jvm.settings(ss: _*), + js.settings(ss: _*), + native.settings(ss: _*) ) def configure(transforms: (Project => Project)*): CrossRootProject = new CrossRootProject( - root.configure(transforms: _*), - rootJVM.configure(transforms: _*), - rootJS.configure(transforms: _*), - rootNative.configure(transforms: _*) + all.configure(transforms: _*), + jvm.configure(transforms: _*), + js.configure(transforms: _*), + native.configure(transforms: _*) ) def enablePlugins(ns: Plugins*): CrossRootProject = new CrossRootProject( - root.enablePlugins(ns: _*), - rootJVM.enablePlugins(ns: _*), - rootJS.enablePlugins(ns: _*), - rootNative.enablePlugins(ns: _*) + all.enablePlugins(ns: _*), + jvm.enablePlugins(ns: _*), + js.enablePlugins(ns: _*), + native.enablePlugins(ns: _*) ) def disablePlugins(ps: AutoPlugin*): CrossRootProject = new CrossRootProject( - root.disablePlugins(ps: _*), - rootJVM.disablePlugins(ps: _*), - rootJS.disablePlugins(ps: _*), - rootNative.disablePlugins(ps: _*) + all.disablePlugins(ps: _*), + jvm.disablePlugins(ps: _*), + js.disablePlugins(ps: _*), + native.disablePlugins(ps: _*) ) def aggregate(projects: CompositeProject*): CrossRootProject = @@ -78,24 +78,27 @@ final class CrossRootProject private ( val jvmProjects = projects.diff(jsProjects).diff(nativeProjects) new CrossRootProject( - root.aggregate(projects.map(_.project): _*), + all.aggregate(projects.map(_.project): _*), if (jvmProjects.nonEmpty) - rootJVM.aggregate(jvmProjects.map(_.project): _*).enablePlugins(TypelevelCiJVMPlugin) - else rootJVM, + jvm.aggregate(jvmProjects.map(_.project): _*).enablePlugins(TypelevelCiJVMPlugin) + else jvm, if (jsProjects.nonEmpty) - rootJS.aggregate(jsProjects.map(_.project): _*).enablePlugins(TypelevelCiJSPlugin) - else rootJS, + js.aggregate(jsProjects.map(_.project): _*).enablePlugins(TypelevelCiJSPlugin) + else js, if (nativeProjects.nonEmpty) - rootNative + native .aggregate(nativeProjects.map(_.project): _*) .enablePlugins(TypelevelCiNativePlugin) - else rootNative + else native ) } } object CrossRootProject { + def unapply(root: CrossRootProject): Some[(Project, Project, Project, Project)] = + Some((root.all, root.jvm, root.js, root.native)) + private[sbt] def apply(): CrossRootProject = new CrossRootProject( Project("root", file(".")), Project("rootJVM", file(".jvm")), diff --git a/github/src/main/scala/org/typelevel/sbt/TypelevelGitHubPlugin.scala b/github/src/main/scala/org/typelevel/sbt/TypelevelGitHubPlugin.scala index bba2d5e4..d8826694 100644 --- a/github/src/main/scala/org/typelevel/sbt/TypelevelGitHubPlugin.scala +++ b/github/src/main/scala/org/typelevel/sbt/TypelevelGitHubPlugin.scala @@ -40,7 +40,7 @@ object TypelevelGitHubPlugin extends AutoPlugin { homepage := homepage.value.orElse(scmInfo.value.map(_.browseUrl)) ) - def getScmInfo(): Option[ScmInfo] = { + private def getScmInfo(): Option[ScmInfo] = { import scala.sys.process._ def gitHubScmInfo(user: String, repo: String) = diff --git a/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala b/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala index 7a19a0a0..139090b2 100644 --- a/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala +++ b/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala @@ -44,6 +44,6 @@ object TypelevelKernelPlugin extends AutoPlugin { override def buildSettings = addCommandAlias("tlReleaseLocal", mkCommand(List("reload", "project /", "+publishLocal"))) - def mkCommand(commands: List[String]): String = commands.mkString("; ", "; ", "") + private[sbt] def mkCommand(commands: List[String]): String = commands.mkString("; ", "; ", "") } diff --git a/kernel/src/main/scala/org/typelevel/sbt/kernel/GitHelper.scala b/kernel/src/main/scala/org/typelevel/sbt/kernel/GitHelper.scala index f48c421b..5cd2db02 100644 --- a/kernel/src/main/scala/org/typelevel/sbt/kernel/GitHelper.scala +++ b/kernel/src/main/scala/org/typelevel/sbt/kernel/GitHelper.scala @@ -20,7 +20,7 @@ import scala.util.Try import scala.sys.process._ -object GitHelper { +private[sbt] object GitHelper { /** * Returns a list of strictly previous releases (i.e. ignores tags on HEAD). diff --git a/kernel/src/main/scala/org/typelevel/sbt/kernel/V.scala b/kernel/src/main/scala/org/typelevel/sbt/kernel/V.scala index 4ca772b1..48ebc6f8 100644 --- a/kernel/src/main/scala/org/typelevel/sbt/kernel/V.scala +++ b/kernel/src/main/scala/org/typelevel/sbt/kernel/V.scala @@ -18,7 +18,7 @@ package org.typelevel.sbt.kernel import scala.util.Try -final case class V( +private[sbt] final case class V( major: Int, minor: Int, patch: Option[Int], @@ -61,7 +61,7 @@ final case class V( } -object V { +private[sbt] object V { val version = """^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:-(.+))?$""".r def apply(v: String): Option[V] = V.unapply(v) diff --git a/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala b/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala index d4a7a9dc..ecfe1d0d 100644 --- a/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala +++ b/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala @@ -44,7 +44,7 @@ object TypelevelSonatypePlugin extends AutoPlugin { "project /", "+mimaReportBinaryIssues", "+publish", - "sonatypeBundleReleaseIfRelevant")) + "tlSonatypeBundleReleaseIfRelevant")) ) override def projectSettings = Seq( @@ -61,7 +61,7 @@ object TypelevelSonatypePlugin extends AutoPlugin { ) private def sonatypeBundleReleaseIfRelevant: Command = - Command.command("sonatypeBundleReleaseIfRelevant") { state => + Command.command("tlSonatypeBundleReleaseIfRelevant") { state => if (state.getSetting(isSnapshot).getOrElse(false)) state // a snapshot is good-to-go else // a non-snapshot releases as a bundle diff --git a/versioning/src/main/scala/org/typelevel/sbt/TypelevelVersioningPlugin.scala b/versioning/src/main/scala/org/typelevel/sbt/TypelevelVersioningPlugin.scala index d734aae3..66443229 100644 --- a/versioning/src/main/scala/org/typelevel/sbt/TypelevelVersioningPlugin.scala +++ b/versioning/src/main/scala/org/typelevel/sbt/TypelevelVersioningPlugin.scala @@ -110,9 +110,9 @@ object TypelevelVersioningPlugin extends AutoPlugin { } ) - val Description = """^.*-(\d+)-[a-zA-Z0-9]+$""".r + private val Description = """^.*-(\d+)-[a-zA-Z0-9]+$""".r - def getTaggedVersion(tags: Seq[String]): Option[V] = + private def getTaggedVersion(tags: Seq[String]): Option[V] = tags.collect { case V.Tag(v) => v }.headOption }