@@ -51,12 +51,12 @@ lazy val metadataSettings = Seq(
5151lazy val compileSettings = Seq (
5252 scalacOptions := Seq (" -feature" , " -unchecked" , " -deprecation" ),
5353 scalaVersion := scala213,
54- crossScalaVersions := Seq (scala210, scala211, scala212, scala213)
54+ crossScalaVersions := Seq (scala210, scala211, scala212, scala213, scala3 )
5555)
5656
5757lazy val publishSettings = Seq (
5858 publishMavenStyle := true ,
59- publishArtifact in Test := false ,
59+ Test / publishArtifact := false ,
6060 publishTo := {
6161 if (isSnapshot.value) {
6262 Some (" Apache Snapshots" at " https://repository.apache.org/content/repositories/snapshots" )
@@ -82,23 +82,45 @@ lazy val licensePackagingSettings =
8282 )
8383
8484lazy val sourceSettings = Seq (
85- unmanagedSourceDirectories in Compile ++= {
86- (unmanagedSourceDirectories in Compile ).value.map { dir =>
85+ Compile / unmanagedSourceDirectories ++= {
86+ (Compile / unmanagedSourceDirectories ).value.flatMap { dir =>
8787 CrossVersion .partialVersion(scalaVersion.value) match {
88- case Some ((2 , n11)) if n11 >= 11 => file(dir.getPath ++ " -2.11+" )
89- case Some ((2 , n10)) if n10 <= 10 => file(dir.getPath ++ " -2.10" )
88+ case Some ((3 , _)) => Seq (file(dir.getPath ++ " -3" ))
89+ case Some ((2 , n11)) if n11 >= 11 => Seq (file(dir.getPath ++ " -2" ), file(dir.getPath ++ " -2.11+" ))
90+ case Some ((2 , n10)) if n10 <= 10 => Seq (file(dir.getPath ++ " -2" ), file(dir.getPath ++ " -2.10" ))
9091 }
9192 }
9293 },
93- unmanagedSourceDirectories in Compile ++= {
94- (unmanagedSourceDirectories in Compile ).value.map { dir =>
94+ Compile / unmanagedSourceDirectories ++= {
95+ (Compile / unmanagedSourceDirectories).value.map { dir =>
96+ CrossVersion .partialVersion(scalaVersion.value) match {
97+ case Some ((3 , _)) => file(dir.getPath ++ " -2.13+" )
98+ case Some ((2 , n13)) if n13 >= 13 => file(dir.getPath ++ " -2.13+" )
99+ case Some ((2 , n12)) if n12 <= 12 => file(dir.getPath ++ " -2.12-" )
100+ }
101+ }
102+ }
103+ )
104+
105+ lazy val testSourceSettings = Seq (
106+ Test / unmanagedSourceDirectories ++= {
107+ (Test / unmanagedSourceDirectories).value.map { dir =>
95108 CrossVersion .partialVersion(scalaVersion.value) match {
109+ case Some ((3 , _)) => file(dir.getPath ++ " -3" )
110+ case Some ((2 , _)) => file(dir.getPath ++ " -2" )
111+ }
112+ }
113+ },
114+ Compile / unmanagedSourceDirectories ++= {
115+ (Compile / unmanagedSourceDirectories).value.map { dir =>
116+ CrossVersion .partialVersion(scalaVersion.value) match {
117+ case Some ((3 , _)) => file(dir.getPath ++ " -2.13+" )
96118 case Some ((2 , n13)) if n13 >= 13 => file(dir.getPath ++ " -2.13+" )
97119 case Some ((2 , n12)) if n12 <= 12 => file(dir.getPath ++ " -2.12-" )
98120 }
99121 }
100122 }
101- )
123+ )
102124
103125lazy val releaseSettings = Seq (
104126 releaseCrossBuild := true ,
@@ -109,7 +131,7 @@ lazy val releaseSettings = Seq(
109131 checkSnapshotDependencies,
110132 inquireVersions,
111133 runClean,
112- releaseStepTask(auditCheck in Compile ),
134+ releaseStepTask(Compile / auditCheck ),
113135 runTest,
114136 setReleaseVersion,
115137 commitReleaseVersion,
@@ -125,20 +147,19 @@ lazy val releaseSettings = Seq(
125147
126148lazy val siteSettings = Seq (
127149 apiURL := Some (url(s " https://logging.apache.org/log4j/log4j-scala- ${version.value}/ " )),
128- siteSubdirName in SiteScaladoc := s " api/ ${scalaBinaryVersion.value}" ,
129- managedSources in Asciidoc += {
130- (auditReport in Compile ).value
131- (target in Compile ).value / " rat.adoc"
150+ SiteScaladoc / siteSubdirName := s " api/ ${scalaBinaryVersion.value}" ,
151+ Asciidoc / managedSources += {
152+ (Compile / auditReport ).value
153+ (Compile / target ).value / " rat.adoc"
132154 },
133- mappings in makeSite ++= Seq (
155+ makeSite / mappings ++= Seq (
134156 (baseDirectory.value / " LICENSE.txt" , " LICENSE" ),
135157 (baseDirectory.value / " NOTICE.txt" , " NOTICE" )
136158 )
137159)
138160
139161lazy val apiDependencies = Seq (
140- libraryDependencies ++= Seq (
141- scalaReflect(scalaVersion.value),
162+ libraryDependencies ++= scalaReflect(scalaVersion.value).toSeq ++ Seq (
142163 osgiCoreApi,
143164 log4jApi,
144165 log4jApiTests,
@@ -165,6 +186,7 @@ lazy val root = (project in file("."))
165186 .settings(publishSettings : _* )
166187 .settings(licensePackagingSettings : _* )
167188 .settings(sourceSettings : _* )
189+ .settings(testSourceSettings : _* )
168190 .settings(releaseSettings : _* )
169191 .settings(siteSettings : _* )
170192 .settings(apiDependencies : _* )
@@ -174,7 +196,7 @@ lazy val nopublish = Seq(
174196 publish := {},
175197 publishLocal := {},
176198 publishM2 := {},
177- skip in publish := true
199+ publish / skip := true
178200)
179201
180202lazy val sample = (project in file(" sample" ))
0 commit comments