-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.mill
More file actions
155 lines (133 loc) · 4.68 KB
/
build.mill
File metadata and controls
155 lines (133 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//| mvnDeps:
//| - com.goyeau::mill-git::0.3.2
/*
* Copyright 2025 Salar Rahmanian
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import mill.*
import mill.scalalib.*
import mill.scalalib.publish.*
import com.goyeau.mill.git.GitVersionedPublishModule
val duckdbVersion = "1.4.4.0"
val munitV = "1.2.2"
val catsEffectVersion = "3.6.3"
val fs2Version = "3.11.0"
val munitCEVersion = "2.1.0"
val scalaVersions = Seq("3.3.6", "3.8.2")
object duck4s extends Cross[Duck4sModule](scalaVersions)
trait Duck4sModule
extends ScalaModule
with CrossScalaModule
with GitVersionedPublishModule:
def artifactName = "duck4s"
override def artifactScalaVersion: T[String] = Task {
val v = crossScalaVersion
if v.startsWith("3.") then "3"
else v.split('.').take(2).mkString(".")
}
def mvnDeps = Seq(
mvn"org.duckdb:duckdb_jdbc:$duckdbVersion"
)
// Enforce Java 17 as minimum version
def javacOptions = Seq("-source", "17", "-target", "17")
// Scaladoc configuration for documentation website generation
def scalacOptions =
val common = Seq("-explain", "-explain-types", "-release", "17")
if crossScalaVersion.startsWith("3.8") then
common :+ "-Xkind-projector:underscores"
else common
def scalaDocOptions = Task {
val version = Task.env.get("DUCK4S_DOC_VERSION").getOrElse(publishVersion())
super.scalaDocOptions() ++ Seq(
"-project",
"Duck4s",
"-project-version",
version,
"-social-links:github::https://github.com/softinio/duck4s",
"-groups",
"-snippet-compiler:compile",
"-external-mappings:" +
".*scala.*::scaladoc3::https://scala-lang.org/api/3.x/," +
".*java.*::javadoc::https://docs.oracle.com/en/java/javase/17/docs/api/"
)
}
def pomSettings = PomSettings(
description = "Scala 3 wrapper library for DuckDB",
organization = "com.softinio",
url = "https://www.duck4s.com",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("softinio", "duck4s"),
developers = Seq(
Developer(
"softinio",
"Salar Rahmanian",
"https://www.softinio.com"
)
)
)
object test extends ScalaTests with TestModule.Munit:
def mvnDeps = Seq(
mvn"org.scalameta::munit::$munitV"
)
object `duck4s-cats-effect` extends Cross[Duck4sCatsEffectModule](scalaVersions)
trait Duck4sCatsEffectModule
extends ScalaModule
with CrossScalaModule
with GitVersionedPublishModule:
def artifactName = "duck4s-cats-effect"
def moduleDeps = Seq(duck4s(crossScalaVersion))
override def artifactScalaVersion: T[String] = Task {
val v = crossScalaVersion
if v.startsWith("3.") then "3"
else v.split('.').take(2).mkString(".")
}
def mvnDeps = Seq(
mvn"org.typelevel::cats-effect:$catsEffectVersion",
mvn"co.fs2::fs2-core:$fs2Version"
)
def javacOptions = Seq("-source", "17", "-target", "17")
def scalacOptions =
val common = Seq("-explain", "-explain-types", "-release", "17")
if crossScalaVersion.startsWith("3.8") then
common :+ "-Xkind-projector:underscores"
else common
def scalaDocOptions = Task {
val version = Task.env.get("DUCK4S_DOC_VERSION").getOrElse(publishVersion())
super.scalaDocOptions() ++ Seq(
"-project",
"Duck4s Cats Effect",
"-project-version",
version,
"-social-links:github::https://github.com/softinio/duck4s",
"-groups",
"-external-mappings:" +
".*scala.*::scaladoc3::https://scala-lang.org/api/3.x/," +
".*java.*::javadoc::https://docs.oracle.com/en/java/javase/17/docs/api/"
)
}
def pomSettings = PomSettings(
description = "Scala 3 cats-effect integration for duck4s DuckDB library",
organization = "com.softinio",
url = "https://www.duck4s.com",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("softinio", "duck4s"),
developers = Seq(
Developer("softinio", "Salar Rahmanian", "https://www.softinio.com")
)
)
object test extends ScalaTests with TestModule.Munit:
def mvnDeps = Seq(
mvn"org.scalameta::munit::$munitV",
mvn"org.typelevel::munit-cats-effect::$munitCEVersion"
)