Skip to content

Commit 4da415e

Browse files
Add updateCommunityBuild command
1 parent 6bc5052 commit 4da415e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import java.io.{PrintWriter, File}
55
import java.nio.charset.StandardCharsets.UTF_8
66
import org.junit.{Ignore, Test}
77
import org.junit.Assert.{assertEquals, fail}
8+
import org.junit.experimental.categories.Category
89

10+
@Category(Array(classOf[TestCategory]))
911
class CommunityBuildTest {
1012
lazy val communitybuildDir: Path = Paths.get(sys.props("user.dir") + "/community-build/")
1113

@@ -147,3 +149,12 @@ class CommunityBuildTest {
147149
// command = "compile"
148150
// )
149151
}
152+
153+
class TestCategory
154+
class UpdateCategory
155+
156+
@Category(Array(classOf[UpdateCategory]))
157+
class CommunityBuildUpdate extends CommunityBuildTest {
158+
override def test(project: String, command: String): Unit =
159+
super.test(project, command.split("/").head + "/update")
160+
}

project/Build.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,8 @@ object Build {
903903

904904
val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{dotty-bootstrapped.version,sbt-dotty-sbt}.")
905905

906+
val updateCommunityBuild = taskKey[Unit]("Updates the community build.")
907+
906908
lazy val `community-build` = project.in(file("community-build")).
907909
settings(commonNonBootstrappedSettings).
908910
settings(
@@ -920,6 +922,12 @@ object Build {
920922
IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText)
921923
IO.write(baseDirectory.value / "dotty-bootstrapped.version", dottyVersion)
922924
},
925+
updateCommunityBuild := testOnly.in(Test).toTask(
926+
" dotty.communitybuild.CommunityBuildUpdate -- --include-categories=dotty.communitybuild.UpdateCategory").value,
927+
testOptions in Test += Tests.Argument(
928+
TestFrameworks.JUnit,
929+
"--include-categories=dotty.communitybuild.TestCategory",
930+
),
923931
(Test / testOnly) := ((Test / testOnly) dependsOn prepareCommunityBuild).evaluated,
924932
(Test / test ) := ((Test / test ) dependsOn prepareCommunityBuild).value
925933
)

0 commit comments

Comments
 (0)