Skip to content

Commit 3de215a

Browse files
committed
Refactor build.sbt.
It's important to skip publish in the root build to avoid publishing an empty package.
1 parent a65a1aa commit 3de215a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

build.sbt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ val baseSettings = Seq(
2222
id = "lihaoyi",
2323
name = "Li Haoyi",
2424
url = url("https://github.com/lihaoyi")
25-
)
25+
),
26+
publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
27+
)
28+
lazy val noPublish = Seq(
29+
publishArtifact := false,
30+
publish := {},
31+
publishLocal := {}
2632
)
2733

2834
baseSettings
35+
noPublish
2936

3037
def macroDependencies(version: String) =
3138
Seq(
@@ -39,8 +46,8 @@ def macroDependencies(version: String) =
3946
Seq())
4047

4148
lazy val sourcecode = crossProject(JSPlatform, JVMPlatform, NativePlatform)
42-
.settings(baseSettings)
4349
.settings(
50+
baseSettings,
4451
libraryDependencies ++= macroDependencies(scalaVersion.value),
4552
test in Test := (run in Test).toTask("").value,
4653
unmanagedSourceDirectories in Compile ++= {
@@ -51,15 +58,13 @@ lazy val sourcecode = crossProject(JSPlatform, JVMPlatform, NativePlatform)
5158
Seq()
5259
}
5360
},
54-
publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
55-
)
56-
.enablePlugins(SbtOsgi)
57-
.settings(
61+
// Osgi settings
5862
osgiSettings,
5963
exportPackage := Seq("sourcecode.*"),
6064
privatePackage := Seq(),
6165
dynamicImportPackage := Seq("*")
6266
)
67+
.enablePlugins(SbtOsgi)
6368
.jsSettings(
6469
scalaJSUseMainModuleInitializer in Test := true // use JVM-style main.
6570
)

0 commit comments

Comments
 (0)