@@ -4,15 +4,12 @@ import $ivy.`com.github.lolgab::mill-mima::0.1.0`
4
4
import mill ._ , scalalib ._ , scalajslib ._ , scalanativelib ._ , publish ._
5
5
import de .tobiasroeser .mill .vcs .version .VcsVersion
6
6
import com .github .lolgab .mill .mima ._
7
- import mill .scalalib .api .Util .isScala3
7
+ import mill .scalalib .api .ZincWorkerUtil .isScala3
8
8
9
9
val dottyCommunityBuildVersion = sys.props.get(" dottyVersion" ).toList
10
10
11
11
val scalaVersions =
12
- " 2.11.12" :: " 2.12.16" :: " 2.13.8" :: " 3.1.3" :: dottyCommunityBuildVersion
13
-
14
- val scalaJSVersions = scalaVersions.map((_, " 1.10.1" ))
15
- val scalaNativeVersions = scalaVersions.map((_, " 0.4.5" ))
12
+ " 2.12.16" :: " 2.13.8" :: " 3.3.1" :: dottyCommunityBuildVersion
16
13
17
14
trait MimaCheck extends Mima {
18
15
def mimaPreviousVersions = Seq (" 0.2.4" , " 0.2.5" , " 0.2.6" , " 0.2.7" , " 0.2.8" , " 0.3.0" , " 0.3.1" )
@@ -41,98 +38,42 @@ trait SourcecodeModule extends PublishModule with MimaCheck {
41
38
)
42
39
)
43
40
}
44
- trait SourcecodeMainModule extends CrossScalaModule {
45
- def millSourcePath = super .millSourcePath / offset
46
-
47
- def offset : os.RelPath = os.rel
48
-
41
+ trait SourcecodeMainModule extends CrossScalaModule with PlatformScalaModule {
49
42
def compileIvyDeps =
50
43
if (crossScalaVersion.startsWith(" 2" )) Agg (
51
44
ivy " org.scala-lang:scala-reflect: ${crossScalaVersion}" ,
52
45
ivy " org.scala-lang:scala-compiler: ${crossScalaVersion}"
53
46
)
54
47
else Agg .empty[Dep ]
55
-
56
- def sources = T .sources(
57
- super .sources()
58
- .flatMap(source =>
59
- Seq (
60
- PathRef (source.path / os.up / source.path.last),
61
- PathRef (source.path / os.up / os.up / source.path.last)
62
- )
63
- )
64
- )
65
48
}
66
49
50
+ object sourcecode extends Module {
51
+ object jvm extends Cross [JvmSourcecodeModule ](scalaVersions)
52
+ trait JvmSourcecodeModule extends SourcecodeMainModule with ScalaModule with SourcecodeModule {
67
53
68
- trait SourcecodeTestModule extends ScalaModule {
69
- def crossScalaVersion : String
70
-
71
- def offset : os.RelPath = os.rel
72
- def millSourcePath = super .millSourcePath / os.up
73
-
74
- def sources = T .sources(
75
- super .sources()
76
- .++ (CrossModuleBase .scalaVersionPaths(crossScalaVersion, s => millSourcePath / s " src- $s" ))
77
- .flatMap(source =>
78
- Seq (
79
- PathRef (source.path / os.up / " test" / source.path.last),
80
- PathRef (source.path / os.up / os.up / " test" / source.path.last)
81
- )
82
- )
83
- .distinct
84
- )
85
- }
54
+ object test extends ScalaTests {
86
55
87
- object sourcecode extends Module {
88
- object jvm extends Cross [JvmSourcecodeModule ](scalaVersions : _* )
89
- class JvmSourcecodeModule (val crossScalaVersion : String )
90
- extends SourcecodeMainModule with ScalaModule with SourcecodeModule {
91
-
92
- object test extends SourcecodeTestModule {
93
- def scalaVersion = crossScalaVersion
94
- def moduleDeps = Seq (JvmSourcecodeModule .this )
95
- val crossScalaVersion = JvmSourcecodeModule .this .crossScalaVersion
56
+ def testFramework = " "
96
57
}
97
58
}
98
59
99
- object js extends Cross [JsSourcecodeModule ](scalaJSVersions : _* )
100
- class JsSourcecodeModule (val crossScalaVersion : String , crossJSVersion : String )
101
- extends SourcecodeMainModule with ScalaJSModule with SourcecodeModule {
102
- def offset = os.up
103
-
104
- def scalaJSVersion = crossJSVersion
105
- object test extends SourcecodeTestModule with ScalaJSModule {
106
- def scalaVersion = crossScalaVersion
107
- def scalaJSVersion = crossJSVersion
108
- def offset = os.up
109
- def moduleDeps = Seq (JsSourcecodeModule .this )
110
- val crossScalaVersion = JsSourcecodeModule .this .crossScalaVersion
60
+ object js extends Cross [JsSourcecodeModule ](scalaVersions)
61
+ trait JsSourcecodeModule extends SourcecodeMainModule with ScalaJSModule with SourcecodeModule {
62
+
63
+ def scalaJSVersion = " 1.12.0"
64
+ object test extends ScalaJSTests {
65
+ def testFramework = " "
111
66
}
112
67
}
113
68
114
- object native extends Cross [NativeSourcecodeModule ](scalaNativeVersions : _* )
115
- class NativeSourcecodeModule (val crossScalaVersion : String , crossScalaNativeVersion : String )
116
- extends SourcecodeMainModule with ScalaNativeModule with SourcecodeModule {
117
- def offset = os.up
118
-
119
- def scalaNativeVersion = crossScalaNativeVersion
120
-
121
- override def docJar =
122
- if (crossScalaVersion.startsWith(" 2." )) super .docJar
123
- else T {
124
- val outDir = T .ctx().dest
125
- val javadocDir = outDir / " javadoc"
126
- os.makeDir.all(javadocDir)
127
- mill.api.Result .Success (mill.modules.Jvm .createJar(Agg (javadocDir))(outDir))
128
- }
129
-
130
- object test extends SourcecodeTestModule with ScalaNativeModule {
131
- def scalaVersion = crossScalaVersion
132
- def scalaNativeVersion = crossScalaNativeVersion
133
- def offset = os.up
134
- def moduleDeps = Seq (NativeSourcecodeModule .this )
135
- val crossScalaVersion = NativeSourcecodeModule .this .crossScalaVersion
69
+ object native extends Cross [NativeSourcecodeModule ](scalaVersions)
70
+ trait NativeSourcecodeModule extends SourcecodeMainModule with ScalaNativeModule with SourcecodeModule {
71
+
72
+ def scalaNativeVersion = " 0.5.0"
73
+ object test extends ScalaNativeTests {
74
+ // stub to make use of test plumbing but not running a test suite
75
+ def mainClass = Some (" sourcecode.Main" )
76
+ def testFramework = " "
136
77
}
137
78
}
138
79
}
0 commit comments