@@ -44,6 +44,16 @@ trait SjsonnetCrossModule extends CrossScalaModule with PublishModule {
4444 Developer (" lihaoyi" , " Li Haoyi" ," https://github.com/lihaoyi" )
4545 )
4646 )
47+ def scalacOptions = Seq (" -deprecation" , " -Werror" ) ++ (
48+ if (! ZincWorkerUtil .isScala3(scalaVersion())) Seq (
49+ " -opt:l:inline" ,
50+ " -opt-inline-from:sjsonnet.*,sjsonnet.**" ,
51+ " -Xsource:3" ,
52+ " -Xlint:_" ) ++ (
53+ if (scalaVersion() startsWith " 2.13" ) Seq (" -Wconf:origin=scala.collection.compat.*:s" )
54+ else Seq (" -Xfatal-warnings" , " -Ywarn-unused:-nowarn" ))
55+ else Seq [String ](" -Wconf:origin=scala.collection.compat.*:s" , " -Xlint:all" )
56+ )
4757 trait CrossTests extends ScalaModule with TestModule .Utest {
4858 def ivyDeps = Agg (ivy " com.lihaoyi::utest::0.8.5 " )
4959 }
@@ -69,11 +79,6 @@ object sjsonnet extends Module {
6979 )
7080 object test extends ScalaJSTests with CrossTests {
7181 def jsEnvConfig = JsEnvConfig .NodeJs (args= List (" --stack-size=" + stackSizekBytes))
72- def sources = T .sources(
73- this .millSourcePath / " src" ,
74- this .millSourcePath / " src-js" ,
75- this .millSourcePath / " src-jvm-js"
76- )
7782 def generatedSources = T {
7883 val files = os.walk(this .millSourcePath / " resources" ).filterNot(os.isDir).map(p => p.relativeTo(this .millSourcePath / " resources" ) -> os.read.bytes(p)).toMap
7984 os.write(
@@ -133,13 +138,7 @@ object sjsonnet extends Module {
133138 def forkEnv = Map (
134139 " SCALANATIVE_THREAD_STACK_SIZE" -> stackSize,
135140 )
136- def scalaNativeVersion = SjsonnetNativeModule .this .scalaNativeVersion
137141 def nativeLTO = LTO .None
138- def sources = T .sources(
139- this .millSourcePath / " src" ,
140- this .millSourcePath / " src-native" ,
141- this .millSourcePath / " src-jvm-native"
142- )
143142 }
144143 }
145144
@@ -159,18 +158,9 @@ object sjsonnet extends Module {
159158 ivy " org.yaml:snakeyaml::2.0 " ,
160159 ivy " com.google.re2j:re2j:1.8 " ,
161160 )
162- def scalacOptions = super .scalacOptions() ++ (
163- if (! ZincWorkerUtil .isScala3(scalaVersion())) Seq (" -opt:l:inline" , " -opt-inline-from:sjsonnet.*,sjsonnet.**" , " -Xsource:3" )
164- else Seq [String ]()
165- )
166161
167162 object test extends ScalaTests with CrossTests {
168163 def forkArgs = Seq (" -Xss" + stackSize)
169- def sources = T .sources(
170- this .millSourcePath / " src" ,
171- this .millSourcePath / " src-jvm" ,
172- this .millSourcePath / " src-jvm-native"
173- )
174164 }
175165
176166 object client extends JavaModule {
0 commit comments