does anybody has a working example of a build.grad...
# gradle
b
does anybody has a working example of a build.gradle.kts for a library to be published on bintray?
s
b
Thanks. Do I need that metadata part?
here
s
Nah, that’s just for multiplatform. Swap to branch 0.3.0 for a JVM-only example
b
So I have the same error as I had in other tries I did
from(java.sourceSets["main"].allJava.sourceDirectories.files)
complains that from(java.sourceSets["main"].allJava.sourceDirectories.files) ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public val Project.sourceSets: SourceSetContainer defined in org.gradle.kotlin.dsl public val KotlinJvmProjectExtension.sourceSets: NamedDomainObjectContainer<DefaultKotlinSourceSet> defined in org.gradle.kotlin.dsl
s
What Gradle version are you using
b
5.0 I think
s
Replace that line with
from(sourceSets["main"].allSource.sourceDirectories.files)
b
where did you find that?
branch 0.4.0
b
Sorry if I ask stupid questions, I'm really new to all those build things
s
You’re fine. The
from
statement you had was for an older version of the Gradle Kotlin DSL, it would have worked with an older version of Gradle
b
what is detekt?
s
A code quality plugin, a linter of sorts
I don’t use it anymore
The Bintray plugin isn’t really built for the Kotlin DSL, so you have to do some weird and inconsistent stuff for it to compile
b
oh so it is not just me 😄
s
Nope, it’s not just you. They haven’t updated the plugin in a long time either lol
b
should I consider something else?
s
Nah, Bintray is fine. The plugin does work, even if configuration can be a bit funky
b
Publication jvm not found in project :.
i'm getting there
s
what did you name the publication? like here:
publishing.publications.create<MavenPublication>("BintrayRelease") {
it’s named “BintrayRelease”
b
I tried to call it that
but it fails too
s
can you gist your build.gradle.kts for me
s
try changing the publication creation block to what I posted above
see if that fixes it
b
seems to accept my config
executing bintrayUpload
hey look it is uploading
thank you so much !!!
s
no problem! happy to help :)
b
now I have to learn how to split things (move the examples out etc)
(you are officially thanked 😉 https://github.com/bjonnh/rdf4k)
🙂 1