https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Rohan Maity

06/01/2019, 9:49 AM
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

Dominaezzz

06/01/2019, 11:10 AM
Header files? Do you mean klibs?
a

adev_one

06/01/2019, 11:28 AM
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

Rohan Maity

06/01/2019, 11:38 AM
currently module are like
commonMain
,
jvamMain
,
linuxMain
. How would I do for this. Do I have replace
artifact-name
with each of these
d

Dominaezzz

06/01/2019, 12:56 PM
You replace
artifact-name
with the name of your project. All the targets (main) will be published.
r

Rohan Maity

06/01/2019, 1:33 PM
Let me try !!
r

Rohan Maity

06/02/2019, 11:37 AM
what is encrypted password ?
a

addamsson

06/02/2019, 11:45 AM
have you tried jitpack?
r

Rohan Maity

06/02/2019, 11:45 AM
nope
a

addamsson

06/02/2019, 11:46 AM
i'd give it a try
bintray is notoriously sketchy
jitpack is much easier to set up
r

Rohan Maity

06/02/2019, 11:47 AM
I will give it shot
a

addamsson

06/02/2019, 11:47 AM
if you don't put your stuff into maven central then it it doesn't matter where you put it
r

Rohan Maity

06/02/2019, 11:48 AM
I dont follow
There is gradle task
install
do i have to write it on my own ?
t

Tobi

06/02/2019, 11:57 AM
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

Rohan Maity

06/02/2019, 12:45 PM
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

Tobi

06/02/2019, 2:10 PM
Can you share your gradle script?
r

Rohan Maity

06/02/2019, 2:26 PM
I have refractored my project. just like the mentioned repo. I will share it asap.
r

russhwolf

06/02/2019, 3:13 PM
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

Rohan Maity

06/02/2019, 3:38 PM
@russhwolf could I DM you regarding different problem but related to Multi-platform ?
r

russhwolf

06/02/2019, 3:56 PM
Sure, if you like.
r

Rohan Maity

06/02/2019, 6:24 PM
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

serebit

06/03/2019, 11:57 AM
@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

serebit

06/03/2019, 12:01 PM
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

addamsson

06/03/2019, 1:02 PM
👍