13 import mill.api.Loose |
13 import mill.api.Loose |
14 import mill.define.{Input, Sources, Target} |
14 import mill.define.{Input, Sources, Target} |
15 import mill.scalajslib._ |
15 import mill.scalajslib._ |
16 import mill.scalalib._ |
16 import mill.scalalib._ |
17 import mill.scalalib.publish._ |
17 import mill.scalalib.publish._ |
18 import $ivy.`de.tototec::de.tobiasroeser.mill.publishM2:0.1.0` |
|
19 import de.tobiasroeser.mill.publishM2._ |
|
20 |
18 |
21 import scala.language.postfixOps |
19 import scala.language.postfixOps |
22 |
20 |
23 object V { |
21 object V { |
24 val fatags = "0.6-SNAPSHOT" |
22 val fatags = "0.6-SNAPSHOT" |
69 "-language:reflectiveCalls", |
67 "-language:reflectiveCalls", |
70 "-language:postfixOps", |
68 "-language:postfixOps", |
71 "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
69 "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
72 "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
70 "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
73 "-Xfuture", // Turn on future language features. |
71 "-Xfuture", // Turn on future language features. |
74 "-target:jvm-1.8", |
72 "-target:jvm-1.8" |
75 )} |
73 )} |
76 |
74 |
77 def hgId: Input[String] = T.input { |
75 def hgId: Input[String] = T.input { |
78 os.proc("hg", "id", "-i").call().out.string.trim |
76 os.proc("hg", "id", "-i").call().out.text.trim |
79 } |
77 } |
80 |
78 |
81 def hgNum: Input[String] = T.input { |
79 def hgNum: Input[String] = T.input { |
82 os.proc("hg", "id", "-n").call().out.string.trim |
80 os.proc("hg", "id", "-n").call().out.text.trim |
83 } |
81 } |
84 |
82 |
85 def hgTag: Input[Option[String]] = T.input { |
83 def hgTag: Input[Option[String]] = T.input { |
86 os.proc("hg", "id", "-t").call().out.string.trim.split(' ').headOption |
84 os.proc("hg", "id", "-t").call().out.text.trim.split(' ').headOption |
87 } |
85 } |
88 |
86 |
89 override def ivyDeps: Target[Loose.Agg[Dep]] = Agg(D.scalatags) |
87 override def ivyDeps: Target[Loose.Agg[Dep]] = Agg(D.scalatags) |
90 |
88 |
91 override def sources: Sources = T.sources{ |
89 override def sources: Sources = T.sources{ |
153 jvm(V.scala211).publishLocal()() |
151 jvm(V.scala211).publishLocal()() |
154 js(V.scala211).publishLocal()() |
152 js(V.scala211).publishLocal()() |
155 } |
153 } |
156 |
154 |
157 def publishM2Local(p: os.Path): define.Command[Unit] = T.command{ |
155 def publishM2Local(p: os.Path): define.Command[Unit] = T.command{ |
158 jvm(V.scala212).publishM2Local(p)() |
156 jvm(V.scala212).publishM2Local(p.toString)() |
159 js(V.scala212).publishM2Local(p)() |
157 js(V.scala212).publishM2Local(p.toString)() |
160 jvm(V.scala211).publishM2Local(p)() |
158 jvm(V.scala211).publishM2Local(p.toString)() |
161 js(V.scala211).publishM2Local(p)() |
159 js(V.scala211).publishM2Local(p.toString)() |
162 () |
160 () |
163 } |
161 } |
164 |
162 |
165 object example extends ScalaModule with ScalaJSModule { |
163 object example extends ScalaModule with ScalaJSModule { |
166 override def scalaVersion: Target[String] = T{V.scala212} |
164 override def scalaVersion: Target[String] = T{V.scala212} |