-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix common settings loading when root is synthetic
**Problem** The new common settings feature doesn't work when the root isn't created by the user. **Solution** This fixes common settings by calling `expandCommonSettingsPerBase(...)` on the synthetic root's base first.
- Loading branch information
Showing
13 changed files
with
275 additions
and
206 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
sbt-app/src/sbt-test/actions/cross-strict-aggregation-scala-3/build.sbt
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
scalaVersion := "2.12.19" | ||
name := "root" | ||
|
||
lazy val core = project | ||
.settings( | ||
|
6 changes: 2 additions & 4 deletions
6
sbt-app/src/sbt-test/dependency-management/parent-skip-publish/build.sbt
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
ThisBuild / organization := "com.example" | ||
ThisBuild / ivyPaths := IvyPaths((ThisBuild / baseDirectory).value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").toString)) | ||
organization := "com.example" | ||
ivyPaths := IvyPaths((ThisBuild / baseDirectory).value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").toString)) | ||
|
||
name := "root" | ||
|
||
lazy val core = project | ||
.settings( | ||
name := "core", | ||
// organization := "com.example", | ||
ivyPaths := IvyPaths((ThisBuild / baseDirectory).value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").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
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 was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
sbt-app/src/sbt-test/project/common-settings-synthetic-root/baz/build.sbt
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 @@ | ||
organization := "com.example.baz" |
28 changes: 28 additions & 0 deletions
28
sbt-app/src/sbt-test/project/common-settings-synthetic-root/build.sbt
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,28 @@ | ||
lazy val check = taskKey[Unit]("") | ||
|
||
def scala212 = "2.12.19" | ||
scalaVersion := scala212 | ||
val o = "com.example" | ||
organization := o | ||
|
||
lazy val foo = project | ||
lazy val bar = project | ||
.settings( | ||
name := "bar", | ||
organization := "com.example.bar", | ||
) | ||
|
||
lazy val baz = project | ||
|
||
check := { | ||
assert((foo / scalaVersion).value == scala212) | ||
assert((bar / scalaVersion).value == scala212) | ||
assert((baz / scalaVersion).value == scala212) | ||
|
||
assert((foo / organization).value == o) | ||
// Test that bar can override common setting in settings(...) | ||
assert((bar / organization).value == "com.example.bar", s"unexpected bar / organization = {(bar / organization).value}") | ||
// Test that baz/build.sbt bare settings get loaded | ||
assert((baz / organization).value == "com.example.baz", s"unexpected baz/organization") | ||
} | ||
check / aggregate := false |
1 change: 1 addition & 0 deletions
1
sbt-app/src/sbt-test/project/common-settings-synthetic-root/test
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 @@ | ||
> check |
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 @@ | ||
organization := "com.example.baz" |
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,33 @@ | ||
lazy val check = taskKey[Unit]("") | ||
|
||
def scala212 = "2.12.19" | ||
scalaVersion := scala212 | ||
val o = "com.example" | ||
organization := o | ||
|
||
lazy val root = (project in file(".")) | ||
.aggregate(foo, bar, baz) | ||
|
||
lazy val foo = project | ||
lazy val bar = project | ||
.settings( | ||
name := "bar", | ||
organization := "com.example.bar", | ||
) | ||
|
||
lazy val baz = project | ||
|
||
check := { | ||
assert((root / scalaVersion).value == scala212) | ||
assert((foo / scalaVersion).value == scala212) | ||
assert((bar / scalaVersion).value == scala212) | ||
assert((baz / scalaVersion).value == scala212) | ||
|
||
assert((root / organization).value == o) | ||
assert((foo / organization).value == o) | ||
// Test that bar can override common setting in settings(...) | ||
assert((bar / organization).value == "com.example.bar") | ||
// Test that baz/build.sbt bare settings get loaded | ||
assert((baz / organization).value == "com.example.baz") | ||
} | ||
check / aggregate := false |
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 @@ | ||
> check |
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