11package build
2+
23import mill._
4+ import mill.scalalib._
35import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
4- import scalalib._
5- import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0 `
6- import $ivy.`com.github.lolgab::mill-mima::0.0.23 `
6+
7+ import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1 `
8+ import $ivy.`com.github.lolgab::mill-mima::0.0.24 `
79
810import de.tobiasroeser.mill.vcs.version.VcsVersion
911import com.github.lolgab.mill.mima._
1012
11- val dottyVersion = sys.props.get("dottyVersion")
13+ val scalaNextVersion = sys.props.get("scalaNextVersion")
14+ val scalaVersions = List("2.12.20", "2.13.15", "3.3.4") ++ scalaNextVersion
15+ val scalaNativeVer = "0.5.6"
1216
13- val scalaVersions = List("2.12.17", "2.13.10", "2.11.12", "3.1.1") ++ dottyVersion
17+ trait MimaCheck extends Mima {
18+ def mimaPreviousVersions = Seq("0.6.9", "0.7.0", "0.7.1", "0.8.0","0.8.2", "0.9.0").distinct
1419
15- object requests extends Cross[RequestsModule](scalaVersions)
16- trait RequestsModule extends CrossScalaModule with PublishModule with Mima {
17- def publishVersion = VcsVersion.vcsState().format()
18- def mimaPreviousVersions =
19- (
20- Seq("0.7.0", "0.7.1", "0.8.2") ++
21- Option.when(VcsVersion.vcsState().commitsSinceLastTag != 0)(VcsVersion.vcsState().lastTag).flatten
22- ).distinct
2320 override def mimaBinaryIssueFilters = Seq(
2421 ProblemFilter.exclude[ReversedMissingMethodProblem]("requests.BaseSession.send"),
25- ProblemFilter.exclude[DirectMissingMethodProblem]("requests.Response.string")
22+ ProblemFilter.exclude[DirectMissingMethodProblem]("requests.Response.string"),
2623 )
24+ }
25+
26+ trait RequestsPublishModule extends PublishModule with MimaCheck {
27+ def artifactName = "requests"
28+
29+ def publishVersion = VcsVersion.vcsState().format()
2730
2831 def pomSettings = PomSettings(
2932 description = "Scala port of the popular Python Requests HTTP client",
@@ -32,17 +35,39 @@ trait RequestsModule extends CrossScalaModule with PublishModule with Mima {
3235 licenses = Seq(License.MIT),
3336 versionControl = VersionControl.github("com-lihaoyi", "requests-scala"),
3437 developers = Seq(
35- Developer("lihaoyi", "Li Haoyi","https://github.com/lihaoyi")
38+ Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
3639 )
3740 )
3841
39- def ivyDeps = Agg(ivy"com.lihaoyi::geny::1.0.0")
42+ def ivyDeps = Agg(ivy"com.lihaoyi::geny::1.1.1")
43+ }
4044
41- object test extends ScalaTests with TestModule.Utest {
42- def ivyDeps = Agg(
43- ivy"com.lihaoyi::utest::0.7.10",
44- ivy"com.lihaoyi::ujson::1.3.13",
45- ivy"com.dimafeng::testcontainers-scala-core:0.41.3"
46- )
45+ trait RequestsCrossScalaModule extends CrossScalaModule with ScalaModule {
46+ def millSourcePath = build.millSourcePath / "requests"
47+ def sources = T.sources(millSourcePath / "src")
48+ }
49+
50+ trait RequestsTestModule extends TestModule.Utest {
51+ def ivyDeps = Agg(
52+ ivy"com.lihaoyi::utest::0.7.10",
53+ ivy"com.lihaoyi::ujson::1.3.13",
54+ ivy"com.dimafeng::testcontainers-scala-core:0.41.3"
55+ )
56+ }
57+
58+ object requests extends Module {
59+ trait RequestsJvmModule extends RequestsCrossScalaModule with RequestsPublishModule {
60+ object test extends ScalaTests with RequestsTestModule
4761 }
62+ object jvm extends Cross[RequestsJvmModule](scalaVersions)
63+
64+ // trait RequestsNativeModule extends ScalaNativeModule with RequestsPublishModule {
65+ // override def scalaNativeVersion = scalaNativeVer
66+ //
67+ // def ivyDeps =
68+ // super.ivyDeps() ++ Agg(ivy"com.github.lolgab::scala-native-crypto::0.1.0")
69+ //
70+ // object test extends ScalaNativeTests with RequestsTestModule
71+ // }
72+ // object native extends Cross[RequestsNativeModule](scalaVersions)
4873}
0 commit comments