|
1 /* |
|
2 * REPL: |
|
3 * |
|
4 * ./mill --repl -w |
|
5 * |
|
6 * Generate Idea project: |
|
7 * |
|
8 * ./mill mill.scalalib.GenIdea/idea |
|
9 * |
|
10 */ |
1 import mill._ |
11 import mill._ |
2 import mill.api.Loose |
12 import mill.api.Loose |
3 import mill.define.{Command, Input, Sources, Target} |
13 import mill.define.{Command, Input, Sources, Target} |
4 import mill.scalajslib._ |
14 import mill.scalajslib._ |
5 import mill.scalalib._ |
15 import mill.scalalib._ |
6 import mill.scalalib.publish._ |
16 import mill.scalalib.publish._ |
7 |
17 |
8 object V { |
18 object V { |
9 val app = "0.3-SNAPSHOT" |
19 val app = "0.3-SNAPSHOT" |
10 val scalaJs = "0.6.28" |
20 val scalaJs = "0.6.33" |
11 val scala211 = "2.11.12" |
21 val scala211 = "2.11.12" |
12 val scala212 = "2.12.9" |
22 val scala212 = "2.12.12" |
13 } |
23 } |
14 |
24 |
15 object D { |
25 object D { |
16 val scalatags = ivy"com.lihaoyi::scalatags::0.6.8" |
26 val scalatags = ivy"com.lihaoyi::scalatags::0.6.8" |
17 } |
27 } |
18 |
28 |
19 trait Common extends CrossSbtModule with PublishModule { |
29 trait Common extends CrossSbtModule with PublishModule { |
20 |
30 |
21 def pomSettings = PomSettings( |
31 def pomSettings: T[PomSettings] = PomSettings( |
22 description = "Scalatags DSL for purecss.io framework", |
32 description = "Scalatags DSL for purecss.io framework", |
23 organization = "cz.functionals", |
33 organization = "cz.functionals", |
24 url = "https://hg.functionals.cz/purecss", |
34 url = "https://hg.functionals.cz/purecss", |
25 licenses = Seq(License.`Apache-2.0`), |
35 licenses = Seq(License.`Apache-2.0`), |
26 versionControl = VersionControl(developerConnection = Some( |
36 versionControl = VersionControl(developerConnection = Some( |
42 "-language:reflectiveCalls", |
52 "-language:reflectiveCalls", |
43 "-language:postfixOps", |
53 "-language:postfixOps", |
44 "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
54 "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
45 "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
55 "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
46 "-Xfuture", // Turn on future language features. |
56 "-Xfuture", // Turn on future language features. |
47 "-target:jvm-1.8", |
57 "-target:jvm-1.8" |
48 )} |
58 )} |
49 |
59 |
50 def hgId: Input[String] = T.input { |
60 def hgId: Input[String] = T.input { |
51 os.proc("hg", "id", "-i").call().out.text.trim |
61 os.proc("hg", "id", "-i").call().out.text.trim |
52 } |
62 } |
80 } |
90 } |
81 |
91 |
82 object jvm extends Cross[JvmModule](V.scala211, V.scala212) |
92 object jvm extends Cross[JvmModule](V.scala211, V.scala212) |
83 object js extends Cross[JsModule](V.scala211, V.scala212) |
93 object js extends Cross[JsModule](V.scala211, V.scala212) |
84 |
94 |
|
95 def compileAll(): Command[Unit] = T.command{ |
|
96 jvm(V.scala212).compile() |
|
97 js(V.scala212).compile() |
|
98 jvm(V.scala211).compile() |
|
99 js(V.scala211).compile() |
|
100 () |
|
101 } |
|
102 |
85 def publishLocal(): Command[Unit] = T.command{ |
103 def publishLocal(): Command[Unit] = T.command{ |
86 jvm(V.scala212).publishLocal()() |
104 jvm(V.scala212).publishLocal()() |
87 js(V.scala212).publishLocal()() |
105 js(V.scala212).publishLocal()() |
88 jvm(V.scala211).publishLocal()() |
106 jvm(V.scala211).publishLocal()() |
89 js(V.scala211).publishLocal()() |
107 js(V.scala211).publishLocal()() |