-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from sbt/wip/repro211
Reproduce 211
- Loading branch information
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
lazy val check = taskKey[Unit]("checks this plugin") | ||
|
||
lazy val a1 = project.settings(scalaVersion := "2.13.15") | ||
|
||
lazy val a2 = project.settings(scalaVersion := "3.3.4") | ||
|
||
lazy val a3 = project | ||
.enablePlugins(BuildInfoPlugin) | ||
.settings( | ||
Compile / buildInfoKeys := List[BuildInfoKey]( | ||
BuildInfoKey.map((a1 / scalaVersion): SettingKey[String])("scalaVersion_a1" -> _._2), | ||
BuildInfoKey.map((a2 / scalaVersion): SettingKey[String])("scalaVersion_a2" -> _._2), | ||
), | ||
check := { | ||
val sv = scalaVersion.value | ||
val _ = (Compile / compile).value | ||
val f = (Compile / sourceManaged).value / "sbt-buildinfo" / ("BuildInfo.scala") | ||
val lines = scala.io.Source.fromFile(f).getLines.toList | ||
|
||
assert(lines.contains(" val scalaVersion_a2: String = \"3.3.4\""), lines.toString) | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % pluginVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> a3/check |