-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a convenient method to compute the highest level of compatibility…
… of all the sub-projects aggregated by a project
- Loading branch information
Showing
13 changed files
with
220 additions
and
0 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
114 changes: 114 additions & 0 deletions
114
...version-policy/src/sbt-test/sbt-version-policy/aggregate-assessed-compatibility/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,114 @@ | ||
// A project with two modules (“a” and “b”) and a root module that aggregates them | ||
|
||
val v1_a = | ||
project | ||
.settings( | ||
name := "aggregated-test-a", | ||
version := "1.0.0", | ||
) | ||
|
||
val v1_b = | ||
project | ||
.settings( | ||
name := "aggregated-test-b", | ||
version := "1.0.0", | ||
) | ||
|
||
val v1_root = | ||
project | ||
.settings( | ||
name := "aggregated-test-root", | ||
publish / skip := true, | ||
) | ||
.aggregate(v1_a, v1_b) | ||
|
||
|
||
// First round of evolutions | ||
// No changes in v2_a | ||
val v2_a = | ||
project | ||
.settings( | ||
name := "aggregated-test-a", | ||
version := "1.0.0+n", | ||
) | ||
|
||
// Small changes that don’t break the binary and source compatibility | ||
val v2_b = | ||
project | ||
.settings( | ||
name := "aggregated-test-b", | ||
version := "1.0.0+n", | ||
) | ||
|
||
val v2_root = | ||
project | ||
.settings( | ||
name := "aggregated-test-root", | ||
publish / skip := true, | ||
TaskKey[Unit]("check") := { | ||
val compatibility = SbtVersionPolicyPlugin.aggregatedAssessedCompatibilityWithLatestRelease.value | ||
assert(compatibility == Compatibility.BinaryAndSourceCompatible) | ||
} | ||
) | ||
.aggregate(v2_a, v2_b) | ||
|
||
|
||
// Second round of evolutions | ||
// Introduction of a public member | ||
val v3_a = | ||
project | ||
.settings( | ||
name := "aggregated-test-a", | ||
version := "1.0.0+n", | ||
) | ||
|
||
// No changes | ||
val v3_b = | ||
project | ||
.settings( | ||
name := "aggregated-test-b", | ||
version := "1.0.0+n", | ||
) | ||
|
||
val v3_root = | ||
project | ||
.settings( | ||
name := "aggregated-test-root", | ||
publish / skip := true, | ||
TaskKey[Unit]("check") := { | ||
val compatibility = SbtVersionPolicyPlugin.aggregatedAssessedCompatibilityWithLatestRelease.value | ||
assert(compatibility == Compatibility.BinaryCompatible) | ||
} | ||
) | ||
.aggregate(v3_a, v3_b) | ||
|
||
// Third round of evolutions | ||
// Introduction of a public member | ||
val v4_a = | ||
project | ||
.settings( | ||
name := "aggregated-test-a", | ||
version := "1.0.0+n", | ||
) | ||
|
||
// Removal of a public member | ||
val v4_b = | ||
project | ||
.settings( | ||
name := "aggregated-test-b", | ||
version := "1.0.0+n", | ||
) | ||
|
||
val v4_root = | ||
project | ||
.settings( | ||
name := "aggregated-test-root", | ||
publish / skip := true, | ||
TaskKey[Unit]("check") := { | ||
val compatibility = SbtVersionPolicyPlugin.aggregatedAssessedCompatibilityWithLatestRelease.value | ||
assert(compatibility == Compatibility.None) | ||
} | ||
) | ||
.aggregate(v4_a, v4_b) | ||
|
||
|
1 change: 1 addition & 0 deletions
1
...licy/src/sbt-test/sbt-version-policy/aggregate-assessed-compatibility/project/plugins.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 @@ | ||
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % sys.props("plugin.version")) |
7 changes: 7 additions & 0 deletions
7
sbt-version-policy/src/sbt-test/sbt-version-policy/aggregate-assessed-compatibility/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,7 @@ | ||
> v1_root/publishLocal | ||
|
||
> v2_root/check | ||
|
||
> v3_root/check | ||
|
||
> v4_root/check |
7 changes: 7 additions & 0 deletions
7
...-test/sbt-version-policy/aggregate-assessed-compatibility/v1_a/src/main/scala/pkg/A.scala
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 @@ | ||
package pkg | ||
|
||
object A { | ||
|
||
val x: Int = 42 | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...-test/sbt-version-policy/aggregate-assessed-compatibility/v1_b/src/main/scala/pkg/B.scala
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,5 @@ | ||
package pkg | ||
|
||
object B { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...-test/sbt-version-policy/aggregate-assessed-compatibility/v2_a/src/main/scala/pkg/A.scala
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 @@ | ||
package pkg | ||
|
||
object A { | ||
|
||
val x: Int = 42 | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...-test/sbt-version-policy/aggregate-assessed-compatibility/v2_b/src/main/scala/pkg/B.scala
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 @@ | ||
package pkg | ||
|
||
object B { | ||
|
||
private val b: String = "b" | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...-test/sbt-version-policy/aggregate-assessed-compatibility/v3_a/src/main/scala/pkg/A.scala
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,9 @@ | ||
package pkg | ||
|
||
object A { | ||
|
||
val x: Int = 42 | ||
|
||
val y: Int = 0 | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...-test/sbt-version-policy/aggregate-assessed-compatibility/v3_b/src/main/scala/pkg/B.scala
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 @@ | ||
package pkg | ||
|
||
object B { | ||
|
||
private val b: String = "b" | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...-test/sbt-version-policy/aggregate-assessed-compatibility/v4_a/src/main/scala/pkg/A.scala
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,9 @@ | ||
package pkg | ||
|
||
object A { | ||
|
||
val x: Int = 42 | ||
|
||
val y: Int = 0 | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...-test/sbt-version-policy/aggregate-assessed-compatibility/v4_b/src/main/scala/pkg/B.scala
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,3 @@ | ||
package pkg | ||
|
||
object C |