forked from domino-osgi/domino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sc
140 lines (116 loc) · 4.52 KB
/
build.sc
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
import ammonite.ops._
import mill._
import mill.define.Task
import mill.scalalib._
import mill.scalalib.publish._
import $ivy.`de.tototec::de.tobiasroeser.mill.osgi:0.2.0`
import de.tobiasroeser.mill.osgi._
val scalaVersions = Seq("2.13.2", "2.12.11", "2.11.12", "2.10.7")
val dominoVersion = "1.1.5"
object Deps {
val osgiCore = ivy"org.osgi:org.osgi.core:4.3.0"
val osgiCompendium = ivy"org.osgi:org.osgi.compendium:4.3.0"
val slf4j = ivy"org.slf4j:slf4j-api:1.7.25"
val scalaTest = ivy"org.scalatest::scalatest:3.0.8"
val felixConfigAdmin = ivy"org.apache.felix:org.apache.felix.configadmin:1.8.8"
val pojosr = ivy"com.googlecode.pojosr:de.kalpatec.pojosr.framework.bare:0.2.1"
val bndlib = ivy"biz.aQute.bnd:biz.aQute.bndlib:4.0.0"
val bndLauncher = ivy"biz.aQute.bnd:biz.aQute.launcher:4.0.0"
val logbackClassic = ivy"ch.qos.logback:logback-classic:1.1.3"
}
object domino extends Cross[DominoModule](scalaVersions: _*)
class DominoModule(override val crossScalaVersion: String)
extends CrossScalaModule
with PublishModule
with OsgiBundleModule { dominoModule =>
override def skipIdea = crossScalaVersion != scalaVersions.head
override val millSourcePath = super.millSourcePath / up / 'src / 'main
override def sources = T.sources { millSourcePath / 'scala }
override def resources = T.sources { millSourcePath / 'resources }
val scalaBinVersion = crossScalaVersion.split("[.]").take(2).mkString(".")
override def artifactName = "domino"
def scalaReflectIvyDeps = T{
if(mill.scalalib.api.Util.isDotty(crossScalaVersion))
Agg.empty[Dep]
else
Agg(
ivy"${scalaOrganization()}:scala-reflect:${scalaVersion()}".forceVersion()
)
}
override def ivyDeps = T{
scalaLibraryIvyDeps() ++ scalaReflectIvyDeps() ++ Agg(
Deps.osgiCore,
Deps.osgiCompendium,
Deps.slf4j
)}
override def osgiHeaders = T {
super.osgiHeaders().copy(
`Bundle-Name` = Some(s"Domino for Scala ${scalaBinVersion}"),
`Bundle-Activator` = Some("domino.internal.DominoBundleActivator"),
`Import-Package` = Seq(
s"""scala.*;version="[${scalaBinVersion},${scalaBinVersion}.50)"""",
"org.slf4j.*;resolution:=optional",
"*"
),
`Private-Package` = Seq( // "domino.logging.internal"
),
`Export-Package` = Seq(
"""domino;version="3.0.0"""",
"""domino.bundle_watching;version="2.0.0"""",
"""domino.capsule;version="1.1.0"""",
"""domino.configuration_watching;version="2.0.0"""",
"""domino.logging;version="1.1.0"""",
"""domino.scala_logging;version="1.1.0"""",
"""domino.scala_osgi_metatype;version="1.1.0"""",
"""domino.scala_osgi_metatype.adapters;version="1.1.0"""",
"""domino.scala_osgi_metatype.builders;version="1.1.0"""",
"""domino.scala_osgi_metatype.interfaces;version="1.2.0"""",
"""domino.service_consuming;version="1.1.0"""",
"""domino.service_providing;version="2.1.0"""",
"""domino.service_watching;version="2.0.1"""",
"""domino.service_watching.monitor;version="1.0.0""""
)
)
}
override def publishVersion = dominoVersion
object test extends Tests {
override def skipIdea = dominoModule.skipIdea
override val millSourcePath = dominoModule.millSourcePath / up / 'test
override def sources = T.sources { millSourcePath / 'scala }
override def resources = T.sources { millSourcePath / 'resources }
override def ivyDeps = Agg(
Deps.scalaTest,
Deps.felixConfigAdmin,
Deps.pojosr,
Deps.logbackClassic
)
override def testFrameworks = Seq("org.scalatest.tools.Framework")
}
override def pomSettings = PomSettings(
description = "A lightweight Scala library for writing elegant OSGi bundle activators",
organization = "com.github.domino-osgi",
url = "https://github.com/domino-osgi/domino",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("domino-osgi", "domino"),
developers = Seq(
Developer("lefou", "Tobias Roeser", "https://github.com/lefou"),
Developer("helgoboss", "Benjamin Klum", "[email protected]")
)
)
}
object integrationTest extends Module {
object support extends ScalaModule {
override def scalaVersion = scalaVersions.head
}
trait TestCase extends JavaModule {
}
object test1 extends TestCase {
override def ivyDeps = Agg(
Deps.bndlib,
Deps.bndLauncher,
Deps.slf4j,
Deps.osgiCore
)
override def mainClass = Some("aQute.launcher.Launcher")
}
}