|
| 1 | +import mill.* |
| 2 | +import mill.api.daemon.internal.TestReporter |
| 3 | +import mill.api.{ PathRef, Task } |
| 4 | +import mill.javalib.PublishModule |
| 5 | +import mill.javalib.publish.* |
| 6 | +import mill.scalalib.* |
| 7 | +import mill.util.Jvm |
| 8 | + |
| 9 | +object `package` extends ScalaModule, PublishModule: |
| 10 | + def publishVersion = "1.9.0" |
| 11 | + def scalaVersion = "3.3.8" |
| 12 | + def jvmVersion = "17" |
| 13 | + |
| 14 | + def mvnDeps = |
| 15 | + Seq( |
| 16 | + mvn"io.github.charpov::tiny-scala-utils::${publishVersion()}", |
| 17 | + mvn"org.jspecify:jspecify::1.0.0" |
| 18 | + ) |
| 19 | + |
| 20 | + object test extends ScalaTests, TestModule.Junit6: |
| 21 | + def jupiterVersion = "6.1.0" |
| 22 | + def testLogLevel = TestReporter.LogLevel.Warn |
| 23 | + |
| 24 | + def scalacOptions = |
| 25 | + Seq( |
| 26 | + "-deprecation", // Emit warning and location for usages of deprecated APIs. |
| 27 | + "-feature", // Emit warning for usages of features that should be imported explicitly. |
| 28 | + "-unchecked", // Enable detailed unchecked (erasure) warnings. |
| 29 | + "-language:noAutoTupling", // Disable automatic tupling. |
| 30 | + "-Wunused:linted", // Check unused imports and variables. |
| 31 | + "-java-output-version:17", // Java version. |
| 32 | + "-source:future" // Source version. |
| 33 | + ) |
| 34 | + |
| 35 | + def javacOptions = Seq("-Xlint:all,-processing", "--release", "17") |
| 36 | + |
| 37 | + def javadocOptions = |
| 38 | + Seq("-Xdoclint:none", "-doctitle", "TinyScalaUtils (Java bridges)", "-link", |
| 39 | + "https://jspecify.dev/docs/api/") |
| 40 | + |
| 41 | + def versionScheme = Some(VersionScheme.SemVerSpec) |
| 42 | + |
| 43 | + def artifactName = "tiny-scala-utils-java" |
| 44 | + |
| 45 | + def pomSettings = |
| 46 | + PomSettings( |
| 47 | + description = "Java bridges for the TinyScalaUtils library.", |
| 48 | + organization = "io.github.charpov", |
| 49 | + url = "https://github.com/charpov/TinyScalaUtilsJava", |
| 50 | + licenses = Seq(License.`Apache-2.0`), |
| 51 | + versionControl = VersionControl.github("charpov", "TinyScalaUtilsJava"), |
| 52 | + developers = Seq(Developer("charpov", "Michel Charpentier", "https://github.com/charpov")), |
| 53 | + ) |
| 54 | + |
| 55 | + // hack to remove the _3 from the artifact name |
| 56 | + override def artifactSuffix = "" |
| 57 | + |
| 58 | + // hacks to run javadoc instead of scalaDoc; see https://github.com/com-lihaoyi/mill/discussions/7261 |
| 59 | + override def docSources = allSources() |
| 60 | + override def docJar = PathRef(Jvm.createJar(Task.dest / "out.jar", Seq(javadocGenerated().path))) |
0 commit comments