From 5e7fe0b158675cb7ee0410a85f52573f84d08e02 Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:00:51 -0700 Subject: [PATCH 1/3] Use more generic early output file name --- main/src/main/scala/sbt/Defaults.scala | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 0b0e761b8..11490ab77 100644 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -647,7 +647,8 @@ object Defaults extends BuildCommon { val dir = classDirectory.value converter.toVirtualFile(dir.toPath) }, - earlyOutput / artifactPath := configArtifactPathSetting(artifact, "early").value, + earlyOutput / artifactPath := crossTarget.value / + (prefix(configuration.value.name) + "early") / "early.jar", earlyOutput := { val converter = fileConverter.value val jar = (earlyOutput / artifactPath).value @@ -1813,23 +1814,6 @@ object Defaults extends BuildCommon { excludes: ScopedTaskable[FileFilter] ): Initialize[Task[Seq[File]]] = collectFiles(dirs: Taskable[Seq[File]], filter, excludes) - private[sbt] def configArtifactPathSetting( - art: SettingKey[Artifact], - extraPrefix: String - ): Initialize[File] = - Def.setting { - val f = artifactName.value - crossTarget.value / - (prefix(configuration.value.name) + extraPrefix) / f( - ScalaVersion( - (artifactName / scalaVersion).value, - (artifactName / scalaBinaryVersion).value - ), - projectID.value, - art.value - ) - } - private[sbt] def prefixArtifactPathSetting( art: SettingKey[Artifact], extraPrefix: String From 824395f6be7d6a0b9f462c66ed0dc18475bf241b Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:25:44 -0700 Subject: [PATCH 2/3] Fix CI --- build.sbt | 3 ++- sbt-app/src/sbt-test/source-dependencies/pipelining/build.sbt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 56a908f4f..b04f99637 100644 --- a/build.sbt +++ b/build.sbt @@ -178,7 +178,8 @@ def mimaSettingsSince(versions: Seq[String]): Seq[Def.Setting[_]] = Def settings exclude[DirectMissingMethodProblem]("sbt.PluginData.this"), exclude[IncompatibleResultTypeProblem]("sbt.EvaluateTask.executeProgress"), exclude[DirectMissingMethodProblem]("sbt.Keys.currentTaskProgress"), - exclude[IncompatibleResultTypeProblem]("sbt.PluginData.copy$default$10") + exclude[IncompatibleResultTypeProblem]("sbt.PluginData.copy$default$10"), + exclude[DirectMissingMethodProblem]("sbt.Defaults.configArtifactPathSetting"), ), ) diff --git a/sbt-app/src/sbt-test/source-dependencies/pipelining/build.sbt b/sbt-app/src/sbt-test/source-dependencies/pipelining/build.sbt index 96b5b5a17..25dfae396 100644 --- a/sbt-app/src/sbt-test/source-dependencies/pipelining/build.sbt +++ b/sbt-app/src/sbt-test/source-dependencies/pipelining/build.sbt @@ -17,6 +17,6 @@ lazy val use = project val x = (dep / Compile / compile).value val picklePath = (Compile / internalDependencyPicklePath).value assert(picklePath.size == 1 && - picklePath.head.data.name == "dep_2.13-0.1.0-SNAPSHOT.jar", s"picklePath = ${picklePath}") + picklePath.head.data.name == "early.jar", s"picklePath = ${picklePath}") }, ) From 4beb78b2607b3f4ce2af97788702ad5878a5a98a Mon Sep 17 00:00:00 2001 From: Friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:15:24 -0700 Subject: [PATCH 3/3] Adopt PR feedbacks --- build.sbt | 3 +-- main/src/main/scala/sbt/Defaults.scala | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index b04f99637..56a908f4f 100644 --- a/build.sbt +++ b/build.sbt @@ -178,8 +178,7 @@ def mimaSettingsSince(versions: Seq[String]): Seq[Def.Setting[_]] = Def settings exclude[DirectMissingMethodProblem]("sbt.PluginData.this"), exclude[IncompatibleResultTypeProblem]("sbt.EvaluateTask.executeProgress"), exclude[DirectMissingMethodProblem]("sbt.Keys.currentTaskProgress"), - exclude[IncompatibleResultTypeProblem]("sbt.PluginData.copy$default$10"), - exclude[DirectMissingMethodProblem]("sbt.Defaults.configArtifactPathSetting"), + exclude[IncompatibleResultTypeProblem]("sbt.PluginData.copy$default$10") ), ) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 11490ab77..1a8f61463 100644 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -647,8 +647,7 @@ object Defaults extends BuildCommon { val dir = classDirectory.value converter.toVirtualFile(dir.toPath) }, - earlyOutput / artifactPath := crossTarget.value / - (prefix(configuration.value.name) + "early") / "early.jar", + earlyOutput / artifactPath := configArtifactPathSetting(artifact, "early").value, earlyOutput := { val converter = fileConverter.value val jar = (earlyOutput / artifactPath).value @@ -1814,6 +1813,15 @@ object Defaults extends BuildCommon { excludes: ScopedTaskable[FileFilter] ): Initialize[Task[Seq[File]]] = collectFiles(dirs: Taskable[Seq[File]], filter, excludes) + private[sbt] def configArtifactPathSetting( + art: SettingKey[Artifact], + extraPrefix: String + ): Initialize[File] = + Def.setting { + crossTarget.value / + (prefix(configuration.value.name) + "early") / "early.jar" + } + private[sbt] def prefixArtifactPathSetting( art: SettingKey[Artifact], extraPrefix: String