How Can I publish the multi lib to bintray ?
# multiplatform
r
How Can I publish the multi lib to bintray ?
3
Currently I can think of configuring publishing tasks differently for JVM , JS. But what about Native headers files ?
d
Header files? Do you mean klibs?
a
You can apply
maven-publish
plugin
Copy code
plugins {
    id("org.jetbrains.kotlin.multiplatform")
    id("maven-publish")
}
Then set up publishing info
Copy code
project.name = "artifact-name" // default is module name
group = "com.example"
version = "0.1.0"

publishing {
    repositories {
        maven {
            url = REPO_URL + '/' + REPO_KEY
            credentials {
                username REPO_USERNAME
                password REPO_ENCRYPTED_PASSWORD
            }
        }
    }
}
And in terminal:
./gradlew :artifact-name:publish
Native artifact will be published as
com.example:artifact-name.native:0.1.0
r
currently module are like
commonMain
,
jvamMain
,
linuxMain
. How would I do for this. Do I have replace
artifact-name
with each of these
d
You replace
artifact-name
with the name of your project. All the targets (main) will be published.
r
Let me try !!
r
what is encrypted password ?
a
have you tried jitpack?
r
nope
a
i'd give it a try
bintray is notoriously sketchy
jitpack is much easier to set up
r
I will give it shot
a
if you don't put your stuff into maven central then it it doesn't matter where you put it
r
I dont follow
There is gradle task
install
do i have to write it on my own ?
t
If you use the gradle file I linked above you just need to run
mavenPublish bintrayUpload
this will first generate the publications and then upload them to bintray. Just make sure to apply both plugins
maven-publish
and
bintray
. You can also first perform a
dryRun
(https://github.com/bintray/gradle-bintray-plugin/blob/master/README.md#Plugin_DSL) to see whether all artifacts are included and all names are correct.
r
Copy code
* What went wrong:
Some problems were found with the configuration of task ':bintrayUpload'.
> No value has been specified for property 'apiKey'.
> No value has been specified for property 'packageName'.
> No value has been specified for property 'repoName'.
> No value has been specified for property 'user'.
I am facing this issue even though I gave tthe user and key'
t
Can you share your gradle script?
r
I have refractored my project. just like the mentioned repo. I will share it asap.
r
One thing to note if you’re using a configuration similar to what I have in Multiplatform Settings, is that it uses a special Jetbrains-published version of the bintray plugin, which I learned from studying the publishing configs for some of the Jetbrains libraries. You can see that here https://github.com/russhwolf/multiplatform-settings/blob/master/build.gradle
Note both the repository
maven { url '<https://dl.bintray.com/jetbrains/kotlin-native-dependencies>' }
as well as the dependency
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4-jetbrains-3"
I also read from a file called
keys.properties
which isn’t checked in but has the format
Copy code
bintrayUser=...
bintrayKey=...
r
@russhwolf could I DM you regarding different problem but related to Multi-platform ?
r
Sure, if you like.
r
my
bintrayUpload
task ran successfully But I recieved this skipping message. I think none of files uplafed
Copy code
> Task :KParser:bintrayUpload
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-js-0.0.1-sources.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-js-0.0.1.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/js/module.json'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/js/pom-default.xml'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-jvm-0.0.1-sources.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-jvm-0.0.1.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/jvm/module.json'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/jvm/pom-default.xml'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/kotlinMultiplatform/module.json'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/kotlinMultiplatform/pom-default.xml'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-linux-0.0.1-sources.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/classes/kotlin/linux/main/KParser.klib'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/linux/module.json'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/linux/pom-default.xml'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-metadata-0.0.1-sources.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/libs/KParser-metadata-0.0.1.jar'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/metadata/module.json'.
Skipping upload for missing file '/home/thelimitbreaker/KParser/KParser/build/publications/metadata/pom-default.xml'.
s
@addamsson What do you mean by bintray being “sketchy”?
I was just referring to the growing reports of sketchy software which is being deployed to bintray
as opposed to Maven Central
s
Ah, okay. It seems as though they have fixed this, at least:
Copy code
Update 2: Bintray has now published a full incident report detailing the events, their remediation efforts, and apologizing for the incident again.
a
👍