Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build tooling #156

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.1
0.11.6
5 changes: 4 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.4"
version = "3.7.15"

align.preset = none
align.openParenCallSite = false
Expand All @@ -16,3 +16,6 @@ docstrings.wrap = no
maxColumn = 120

newlines.source = keep

runner.dialect = scala213

25 changes: 20 additions & 5 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ object Deps_0_6 extends Deps {
/** Cross build versions */
val millPlatforms = Seq(Deps_0_11, Deps_0_10, Deps_0_9, Deps_0_7, Deps_0_6).map(x => x.millPlatform -> x)

trait MyScoverageModule extends ScoverageModule {
override lazy val scoverage: ScoverageData = new MyScoverageData {}
trait MyScoverageData extends ScoverageData {
override def skipIdea: Boolean = true
}
}

trait MillOsgiModule extends ScalaModule with PublishModule with Cross.Module[String] {
def millPlatform: String = crossValue
def deps: Deps = millPlatforms.toMap.apply(millPlatform)
Expand All @@ -86,7 +93,15 @@ trait MillOsgiModule extends ScalaModule with PublishModule with Cross.Module[St
override def artifactSuffix = s"_mill${deps.millPlatform}_${artifactScalaVersion()}"
def publishVersion = VcsVersion.vcsState().format()
override def javacOptions = Seq("-source", "1.8", "-target", "1.8", "-encoding", "UTF-8")
override def scalacOptions = Seq("-target:jvm-1.8", "-encoding", "UTF-8", "-deprecation", "-Xsource:3")
override def scalacOptions = T {
val jvmSpecific =
if (scala.util.Properties.isJavaAtLeast(11))
Seq("-release", "8")
else
Seq("-target:jvm-1.8")

jvmSpecific ++ Seq("-encoding", "UTF-8", "-deprecation", "-Xsource:3")
}
override def pomSettings = T {
PomSettings(
description = "Mill module adding OSGi bundle support",
Expand All @@ -101,14 +116,14 @@ trait MillOsgiModule extends ScalaModule with PublishModule with Cross.Module[St
super.sources() ++
(
ZincWorkerUtil.matchingVersions(deps.millPlatform) ++
ZincWorkerUtil.versionRanges(deps.millPlatform, millPlatforms.map(_._1))
)
ZincWorkerUtil.versionRanges(deps.millPlatform, millPlatforms.map(_._1))
)
.map(p => PathRef(millSourcePath / s"src-${p}"))
}
}

object core extends Cross[Core](millPlatforms.map(_._1))
trait Core extends MillOsgiModule with ScoverageModule {
trait Core extends MillOsgiModule with MyScoverageModule {
override def artifactName = "de.tobiasroeser.mill.osgi"
override def ivyDeps = super.ivyDeps() ++ Agg(
deps.bndlib,
Expand Down Expand Up @@ -136,7 +151,7 @@ trait Core extends MillOsgiModule with ScoverageModule {

override def scoverageVersion = deps.scoverageVersion

override def skipIdea: Boolean = millPlatforms.head._1 != millPlatform
// override def skipIdea: Boolean = millPlatforms.head._1 != millPlatform

object test extends ScoverageTests with TestModule.ScalaTest {
override def ivyDeps = Agg(
Expand Down
Loading