hi, if I setup the idea plugin and configure it li...
# korge
p
hi, if I setup the idea plugin and configure it like this, shouldnt it download korge’s code alongside the libraries?
Copy code
idea {
    module {
        setDownloadJavadoc(true)
        setDownloadSources(true)
    }
}
d
I’m not sure. Had inconsistencies with source code downloading / using from maven local
Not sure when it worked and when it didn’t work
p
Are you sure it's added as part of the publications?
d
what do you mean?
for example
I can see the -sources and -javadoc artifacts
p
Yeah, meant that
k
facing the same issue
its a little unintuitive to work with a library without sources/javadoc
p
have you checked if you download the artifacts ‘by hand’ if the sources are effectively in there ?
havent’ had time yet to verify that
d
Just tried the Pablo apprach. It seemed to download a lot of javadocs at least from unrelated libraries, but didn't work for KorGE
I think we should ask how should we do that
Also going to compare kotlinx.coroutines for example to see how thje -sources.jar file is created to try to figure out if we have something different there
👍🏻 1
p
for my korge project I have this and it works:
Copy code
publishing {
    publications {
        register("aar", MavenPublication::class) {
            groupId = "com.qwerty"
            artifactId = "toolframework"
            version = toolFrameworkMultiplatformVersion

            artifact("$buildDir/platforms/android/build/outputs/aar/tool_framework_multi_platform-debug.aar")
            artifact("sourcesJar")
        }
    }
}
d
I think I know what's going on
p
what’s that ?
d
Can you try something for me to be sure?
p
of course, shoot
d
Can you create src/jvmMAin/kotlin
put some code there
and check if you see the source code from there?
p
maybe an empty class with a couple of methods ?
yes, one sec
d
anything
just to have a reference to a KorGE related class
p
like this ?
d
yes
k
yes that works
p
what else ?
d
go to declaration and check if you have sources
you should have sources
p
i do
d
yay!
p
👏
d
it seems that it uses -sources from the artifact used for that sourceset
p
so it’s something related to how idea resolves for other source sets ?
d
and it seems that the -sources for the common code is fucking empty lol 😄
😂 1
p
aaaahhh
gotcha
d
so... I'm going to check how the -sources is generated and fix this shit
I always wondered why this shit didn't work
and now it makes sense lol
p
excellent! thx, this will be very useful
👌 3
k
yeah
d
sources will be available on the next published version hopefully
k
Also it would be nice if we can move away from the buildscript and use plugins probably
p
not getting that @kartikpatodi, what do you want to do ?
k
I mean in build.gradle.kts we use the buildscript block/dsl. I think the new plugins dsl is more elegent and concise
p
ahhh ok
k
Is there some limitation that I am not aware of @Deactivated User @Pablo Caviglia
p
im not that expert 😄, @Deactivated User?
k
Yeah maybe It would be.a better idea to reference kotlinx.coroutines or serialization to see how those libraries are structured
d
let me read
I think I don't fully get it either. So you are using build.gradle, and plan to use build.gradle.kts, but not sure if you will face issues with it?
p
i can share with you my build.gradle.kts @kartikpatodi, it’s not super complex, but can give you an idea about how it’s a standard configuration:
Copy code
import com.soywiz.korge.gradle.*
import org.jfrog.gradle.plugin.artifactory.dsl.*

val toolFrameworkMultiplatformVersion = "3.0.0"

buildscript {
    val korgePluginVersion: String by project

    repositories {
        mavenLocal()
        maven { url = uri("<https://dl.bintray.com/korlibs/korlibs>") }
        maven { url = uri("<https://plugins.gradle.org/m2/>") }
        mavenCentral()
        google()
        maven { url = uri("<https://dl.bintray.com/kotlin/kotlin-dev>") }
        maven { url = uri("<https://dl.bintray.com/kotlin/kotlin-eap>") }
    }
    dependencies {
        classpath("com.soywiz.korlibs.korge.plugins:korge-gradle-plugin:$korgePluginVersion")
    }
}

plugins {
    id("maven-publish")
    id("com.jfrog.artifactory") version "4.17.2"
    id("idea")
}

apply<KorgeGradlePlugin>()

korge {
    id = "com.senaptec.toolframework"
    androidLibrary = true
    version = toolFrameworkMultiplatformVersion

    androidPermission("android.permission.WRITE_EXTERNAL_STORAGE")
    androidPermission("android.permission.READ_EXTERNAL_STORAGE")

    targetAndroidIndirect()
    targetIos()

}

dependencies {
    add("commonMainApi", "com.soywiz.korlibs.korvi:korvi:2.0.0")
    add("commonMainApi", "com.soywiz.korlibs.korgw:korgw:2.0.0")
}

publishing {
    publications {
        register("aar", MavenPublication::class) {
            groupId = "com.senaptec"
            artifactId = "toolframework"
            version = toolFrameworkMultiplatformVersion

            artifact("$buildDir/platforms/android/build/outputs/aar/tool_framework_multi_platform-debug.aar")
            artifact("sourcesJar")
        }
    }
}


artifactory {
    setContextUrl("<http://adgdagad:8081/artifactory>")
    publish(delegateClosureOf<PublisherConfig> {
        repository(delegateClosureOf<DoubleDelegateWrapper> {
            setProperty("repoKey", "libs-release-local")
            setProperty("username", "adgadgadgad")
            setProperty("password", "adgdsgadg")
            setProperty("maven", true)
        })
        defaults(delegateClosureOf<groovy.lang.GroovyObject> {
            invokeMethod("publications", arrayOf("aar"))
        })
    })
}

idea {
    module {
        setDownloadJavadoc(true)
        setDownloadSources(true)
    }
}
k
Yeah I think I have to look more into this 👀
d
2.0.0.1 released with sourcecode available on the common source set :)