You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pfn
I noticed that Kotlin sources are not packaged with sbt publish or publishLocal. As result my maven source artifact is empty. Could you please suggest how I can fix it ?
Basically, I added following setting in SBT to properly generate sources artifact:
// Include Kotlin files in sources
packageConfiguration in Compile:= {
valold= (packageConfiguration in Compile in packageSrc).value
valnewSources= (sourceDirectories in Compile).value.flatMap(_ **"*.kt" get)
newPackage.Configuration(
old.sources ++ newSources.map(f => f -> f.getName),
old.jar,
old.options
)
}
For the documentation artifact, I added Gradle build to my Kotlin module. I set it up as shown here https://github.com/makiftutuncu/e/blob/master/e-kotlin/build.gradle.kts. This way, I make Gradle build generate the Dokka documentation. And finally, added following setting in SBT to run Gradle while building docs:
// Delegate doc generation to Gradle and Dokka
doc in Compile:= {
importsys.process._Process(Seq("./gradlew", "dokkaJavadoc"), baseDirectory.value).!
target.value /"api"
}
I admit, this is a lot of work just to get 2 artifacts but it did the trick for me. 🤷🏻 Hope this helps.
@pfn
I noticed that Kotlin sources are not packaged with sbt publish or publishLocal. As result my maven source artifact is empty. Could you please suggest how I can fix it ?
Here is what I tried so far
https://stackoverflow.com/questions/59256494/how-do-i-make-sbt-include-non-java-sources-to-published-artifact
The text was updated successfully, but these errors were encountered: