@@ -939,47 +939,6 @@ object Build {
939
939
},
940
940
mimaCheckDirection := " both" ,
941
941
mimaBinaryIssueFilters ++= MiMaFilters .LibraryBootstrappedForward ,
942
- run := {
943
- val args : Seq [String ] = spaceDelimited(" <arg>" ).parsed
944
- val reference = (Compile / sourceManaged).value / " scala-library-src"
945
- args match {
946
- case Seq (" list" ) =>
947
- println(s " List of non-overriden files in $reference" )
948
- reference.allPaths.get()
949
- .flatMap(_.relativeTo(reference))
950
- .filter(_.ext == " scala" )
951
- .sorted
952
- .foreach(println)
953
- case Seq (cmd @ (" clone" | " overwrite" ), files* ) =>
954
- println(" Cloning scala-library sources: " + files.mkString(" , " ))
955
- for (file <- files) {
956
- val referenceStdlibPaths = reference / file
957
- val destination = baseDirectory.value / " src" / file
958
- if (! referenceStdlibPaths.exists) {
959
- println(" Not found " + referenceStdlibPaths)
960
- } else if (destination.exists && cmd == " clone" ) {
961
- println(s " Already exists $file. (use `overwrite` command to overwrite) " )
962
- } else {
963
- val action = if (cmd == " clone" ) " Cloning" else " Overwriting"
964
- println(s " $action $file" )
965
- IO .copyFile(referenceStdlibPaths, destination)
966
- }
967
- }
968
- case _ =>
969
- println(
970
- """ Usage:
971
- |> stdlib-bootstrapped/run list
972
- | -- lists all files that are not overriden in stdlib-bootstrapped/src
973
- |
974
- |> stdlib-bootstrapped/run clone <sources>*
975
- | -- clones the specified sources from the stdlib-bootstrapped/src
976
- | -- example: stdlib-bootstrapped/run clone scala/Option.scala
977
- |
978
- |> stdlib-bootstrapped/run overwrite <sources>*
979
- | -- (danger) overwrites the specified sources from the stdlib-bootstrapped/src
980
- |""" .stripMargin)
981
- }
982
- }
983
942
)
984
943
985
944
/** Scala library compiled by dotty using the latest published sources of the library
@@ -1096,6 +1055,48 @@ object Build {
1096
1055
),
1097
1056
mimaCheckDirection := " backward" ,
1098
1057
mimaBinaryIssueFilters ++= MiMaFilters .LibraryBootstrapped ,
1058
+ run := {
1059
+ val args : Seq [String ] = spaceDelimited(" <arg>" ).parsed
1060
+ val reference = (Compile / sourceManaged).value / " scala-library-src"
1061
+ args match {
1062
+ case Seq (" list" ) =>
1063
+ println(s " List of non-overriden files in $reference" )
1064
+ reference.allPaths.get()
1065
+ .flatMap(_.relativeTo(reference))
1066
+ .filter(_.ext == " scala" )
1067
+ .sorted
1068
+ .foreach(println)
1069
+ case Seq (cmd @ (" clone" | " overwrite" ), files* ) =>
1070
+ println(" Cloning scala-library sources: " + files.mkString(" , " ))
1071
+ for (file <- files) {
1072
+ val referenceStdlibPaths = reference / file
1073
+ val destination = baseDirectory.value / " src" / file
1074
+ if (! referenceStdlibPaths.exists) {
1075
+ println(" Not found " + referenceStdlibPaths)
1076
+ } else if (destination.exists && cmd == " clone" ) {
1077
+ println(s " Already exists $file. (use `overwrite` command to overwrite) " )
1078
+ } else {
1079
+ val action = if (cmd == " clone" ) " Cloning" else " Overwriting"
1080
+ println(s " $action $file" )
1081
+ IO .copyFile(referenceStdlibPaths, destination)
1082
+ }
1083
+ }
1084
+ case _ =>
1085
+ val projectName = projectInfo.value.nameFormal
1086
+ println(
1087
+ s """ Usage:
1088
+ |> $projectName/run list
1089
+ | -- lists all files that are not overriden in stdlib-bootstrapped/src
1090
+ |
1091
+ |> $projectName/run clone <sources>*
1092
+ | -- clones the specified sources from the stdlib-bootstrapped/src
1093
+ | -- example: $projectName/run clone scala/Option.scala
1094
+ |
1095
+ |> $projectName/run overwrite <sources>*
1096
+ | -- (danger) overwrites the specified sources from the stdlib-bootstrapped/src
1097
+ | """ .stripMargin)
1098
+ }
1099
+ }
1099
1100
)
1100
1101
1101
1102
/** Test the tasty generated by `stdlib-bootstrapped`
0 commit comments