11import ammonite .ops ._
22
33import scala .util .Try
4- import scala .util .control .NonFatal
54
65case class DemoRepo (repo : String , name : String )(implicit path : os.Path ) {
76
@@ -18,6 +17,7 @@ case class DemoRepo(repo: String, name: String)(implicit path: os.Path) {
1817 s """ addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % " $version") """
1918 case line => line
2019 }
20+ os.write.over(path / " project" / " build.properties" , " sbt.version=1.4.0" )
2121 os.write.over(pluginsFile, newLines.mkString(" \n " ))
2222 % .sbt(" dist" )
2323 % .git(" add" , " -A" )
@@ -48,7 +48,7 @@ object DemoRepo {
4848 }
4949}
5050
51- class Repo (version : String )(implicit val wd : os.Path ) {
51+ case class Repo (version : String )(implicit val wd : os.Path ) {
5252 val tag = s " v $version"
5353
5454 def assertClean () =
@@ -74,23 +74,17 @@ class Repo(version: String)(implicit val wd: os.Path) {
7474}
7575
7676@ main
77- def doRelease (version : String ): Int =
78- try {
79- val repo = new Repo (version)(os.pwd)
80- repo.assertClean()
81- repo.refreshTag()
82- repo.publishLocal()
83- val demoRepos = DemoRepo .initialized(os.Path (" /tmp/st-release-temp" ))
84- demoRepos.foreach(_.update())
85- demoRepos.foreach(_.build(version))
86- demoRepos.foreach(_.pushCache())
87- // at this point we're ready to push everything
88- repo.publish()
89- demoRepos.foreach(_.pushGit())
90- 0
91- } catch {
92- case NonFatal (th) =>
93- println(s " Release of $version failed " )
94- th.printStackTrace()
95- 1
96- }
77+ def doRelease (version : String ): Int = {
78+ val repo = Repo (version)(os.pwd)
79+ repo.assertClean()
80+ repo.refreshTag()
81+ repo.publishLocal()
82+ val demoRepos = DemoRepo .initialized(os.Path (" /tmp/st-release-temp" ))
83+ demoRepos.foreach(_.update())
84+ demoRepos.foreach(_.build(version))
85+ demoRepos.foreach(_.pushCache())
86+ // at this point we're ready to push everything
87+ repo.publish()
88+ demoRepos.foreach(_.pushGit())
89+ 0
90+ }
0 commit comments